mirror of
https://github.com/zoriya/vim.git
synced 2025-12-08 00:06:17 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d56a79d339 | ||
|
|
5acff71d3b | ||
|
|
46522af724 | ||
|
|
803452046b | ||
|
|
c525e3a1c2 | ||
|
|
3df0173fa6 | ||
|
|
8c50d50b6e | ||
|
|
507647da31 | ||
|
|
79518e2ace | ||
|
|
226c534291 |
@@ -2,12 +2,13 @@
|
||||
" Description: Perform Ada specific completion & tagging.
|
||||
" Language: Ada (2005)
|
||||
" $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $
|
||||
" Maintainer: Martin Krischik <krischik@users.sourceforge.net>
|
||||
" Maintainer: Mathias Brousset <mathiasb17@gmail.com>
|
||||
" Martin Krischik <krischik@users.sourceforge.net>
|
||||
" Taylor Venable <taylor@metasyntax.net>
|
||||
" Neil Bird <neil@fnxweb.com>
|
||||
" Ned Okie <nokie@radford.edu>
|
||||
" $Author: krischik $
|
||||
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
|
||||
" $Date: 2017-01-31 20:20:05 +0200 (Mon, 01 Jan 2017) $
|
||||
" Version: 4.6
|
||||
" $Revision: 887 $
|
||||
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/ada.vim $
|
||||
@@ -23,6 +24,7 @@
|
||||
" 09.05.2007 MK Session just won't work no matter how much
|
||||
" tweaking is done
|
||||
" 19.09.2007 NO still some mapleader problems
|
||||
" 31.01.2017 MB fix more mapleader problems
|
||||
" Help Page: ft-ada-functions
|
||||
"------------------------------------------------------------------------------
|
||||
|
||||
@@ -447,7 +449,7 @@ function ada#Switch_Session (New_Session)
|
||||
|
||||
if a:New_Session != v:this_session
|
||||
"
|
||||
" We actualy got a new session - otherwise there
|
||||
" We actually got a new session - otherwise there
|
||||
" is nothing to do.
|
||||
"
|
||||
if strlen (v:this_session) > 0
|
||||
@@ -585,11 +587,11 @@ function ada#Map_Menu (Text, Keys, Command)
|
||||
\ " :" . a:Command . "<CR>"
|
||||
execute
|
||||
\ "nnoremap <buffer>" .
|
||||
\ escape(l:leader . "a" . a:Keys , '\') .
|
||||
\ " <Leader>a" . a:Keys .
|
||||
\" :" . a:Command
|
||||
execute
|
||||
\ "inoremap <buffer>" .
|
||||
\ escape(l:leader . "a" . a:Keys , '\') .
|
||||
\ " <Learder>a" . a:Keys .
|
||||
\" <C-O>:" . a:Command
|
||||
endif
|
||||
return
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 8.0. Last change: 2016 Nov 19
|
||||
*change.txt* For Vim version 8.0. Last change: 2017 Feb 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -635,12 +635,14 @@ For other systems the tmpnam() library function is used.
|
||||
For the {pattern} see |pattern|.
|
||||
{string} can be a literal string, or something
|
||||
special; see |sub-replace-special|.
|
||||
*E939*
|
||||
When [range] and [count] are omitted, replace in the
|
||||
current line only.
|
||||
When [count] is given, replace in [count] lines,
|
||||
starting with the last line in [range]. When [range]
|
||||
is omitted start in the current line.
|
||||
Also see |cmdline-ranges|.
|
||||
current line only. When [count] is given, replace in
|
||||
[count] lines, starting with the last line in [range].
|
||||
When [range] is omitted start in the current line.
|
||||
[count] must be a positive number. Also see
|
||||
|cmdline-ranges|.
|
||||
|
||||
See |:s_flags| for [flags].
|
||||
|
||||
:[range]s[ubstitute] [flags] [count]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*diff.txt* For Vim version 8.0. Last change: 2016 Aug 24
|
||||
*diff.txt* For Vim version 8.0. Last change: 2017 Feb 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -131,6 +131,8 @@ file for a moment and come back to the same file and be in diff mode again.
|
||||
related options only happens in a window that has 'diff' set,
|
||||
if the current window does not have 'diff' set then no options
|
||||
in it are changed.
|
||||
Hidden buffers are also removed from the list of diff'ed
|
||||
buffers.
|
||||
|
||||
The `:diffoff` command resets the relevant options to the values they had when
|
||||
using `:diffsplit`, `:diffpatch` , `:diffthis`. or starting Vim in diff mode.
|
||||
@@ -164,7 +166,8 @@ The alignment of text will go wrong when:
|
||||
|
||||
All the buffers edited in a window where the 'diff' option is set will join in
|
||||
the diff. This is also possible for hidden buffers. They must have been
|
||||
edited in a window first for this to be possible.
|
||||
edited in a window first for this to be possible. To get rid of the hidden
|
||||
buffers use `:diffoff!`.
|
||||
|
||||
*:DiffOrig* *diff-original-file*
|
||||
Since 'diff' is a window-local option, it's possible to view the same buffer
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Jan 28
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Feb 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1329,7 +1329,8 @@ b:changedtick The total number of changes to the current buffer. It is
|
||||
: let my_changedtick = b:changedtick
|
||||
: call My_Update()
|
||||
:endif
|
||||
<
|
||||
< You cannot change or delete the b:changedtick variable.
|
||||
|
||||
*window-variable* *w:var* *w:*
|
||||
A variable name that is preceded with "w:" is local to the current window. It
|
||||
is deleted when the window is closed.
|
||||
@@ -4371,8 +4372,8 @@ getfontname([{name}]) *getfontname()*
|
||||
Only works when the GUI is running, thus not in your vimrc or
|
||||
gvimrc file. Use the |GUIEnter| autocommand to use this
|
||||
function just after the GUI has started.
|
||||
Note that the GTK 2 GUI accepts any font name, thus checking
|
||||
for a valid name does not work.
|
||||
Note that the GTK GUI accepts any font name, thus checking for
|
||||
a valid name does not work.
|
||||
|
||||
getfperm({fname}) *getfperm()*
|
||||
The result is a String, which is the read, write, and execute
|
||||
@@ -5978,7 +5979,7 @@ printf({fmt}, {expr1} ...) *printf()*
|
||||
%e floating point number as 1.23e3, inf, -inf or nan
|
||||
%E floating point number as 1.23E3, INF, -INF or NAN
|
||||
%g floating point number, as %f or %e depending on value
|
||||
%G floating point number, as %f or %E depending on value
|
||||
%G floating point number, as %F or %E depending on value
|
||||
%% the % character itself
|
||||
|
||||
Conversion specifications start with '%' and end with the
|
||||
@@ -7807,6 +7808,8 @@ test_settime({expr}) *test_settime()*
|
||||
Set the time Vim uses internally. Currently only used for
|
||||
timestamps in the history, as they are used in viminfo, and
|
||||
for undo.
|
||||
Using a value of 1 makes Vim not sleep after a warning or
|
||||
error message.
|
||||
{expr} must evaluate to a number. When the value is zero the
|
||||
normal behavior is restored.
|
||||
|
||||
@@ -8463,6 +8466,7 @@ toolbar Compiled with support for |gui-toolbar|.
|
||||
ttyin input is a terminal (tty)
|
||||
ttyout output is a terminal (tty)
|
||||
unix Unix version of Vim.
|
||||
unnamedplus Compiled with support for "unnamedplus" in 'clipboard'
|
||||
user_commands User-defined commands.
|
||||
vertsplit Compiled with vertically split windows |:vsplit|.
|
||||
vim_starting True while initial source'ing takes place. |startup|
|
||||
@@ -8966,6 +8970,11 @@ This does NOT work: >
|
||||
value and the global value are changed.
|
||||
Example: >
|
||||
:let &path = &path . ',/usr/local/include'
|
||||
< This also works for terminal codes in the form t_xx.
|
||||
But only for alphanumerical names. Example: >
|
||||
:let &t_k1 = "\<Esc>[234;"
|
||||
< When the code does not exist yet it will be created as
|
||||
a terminal key code, there is no error.
|
||||
|
||||
:let &{option-name} .= {expr1}
|
||||
For a string option: Append {expr1} to the value.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*helphelp.txt* For Vim version 8.0. Last change: 2016 Apr 01
|
||||
*helphelp.txt* For Vim version 8.0. Last change: 2017 Feb 09
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -28,10 +28,16 @@ Help on help files *helphelp*
|
||||
|
||||
*{subject}* *E149* *E661*
|
||||
:h[elp] {subject} Like ":help", additionally jump to the tag {subject}.
|
||||
{subject} can include wildcards like "*", "?" and
|
||||
For example: >
|
||||
:help options
|
||||
|
||||
< {subject} can include wildcards such as "*", "?" and
|
||||
"[a-z]":
|
||||
:help z? jump to help for any "z" command
|
||||
:help z. jump to the help for "z."
|
||||
But when a tag exists it is taken literally:
|
||||
:help :? jump to help for ":?"
|
||||
|
||||
If there is no full match for the pattern, or there
|
||||
are several matches, the "best" match will be used.
|
||||
A sophisticated algorithm is used to decide which
|
||||
@@ -68,18 +74,19 @@ Help on help files *helphelp*
|
||||
example to find help for CTRL-V in Insert mode: >
|
||||
:help i^V
|
||||
<
|
||||
To use a regexp |pattern|, first do ":help" and then
|
||||
It is also possible to first do ":help" and then
|
||||
use ":tag {pattern}" in the help window. The
|
||||
":tnext" command can then be used to jump to other
|
||||
matches, "tselect" to list matches and choose one. >
|
||||
:help index| :tse z.
|
||||
:help index
|
||||
:tselect /.*mode
|
||||
|
||||
< When there is no argument you will see matches for
|
||||
"help", to avoid listing all possible matches (that
|
||||
would be very slow).
|
||||
The number of matches displayed is limited to 300.
|
||||
|
||||
This command can be followed by '|' and another
|
||||
The `:help` command can be followed by '|' and another
|
||||
command, but you don't need to escape the '|' inside a
|
||||
help command. So these both work: >
|
||||
:help |
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_pyth.txt* For Vim version 8.0. Last change: 2017 Jan 28
|
||||
*if_pyth.txt* For Vim version 8.0. Last change: 2017 Feb 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Paul Moore
|
||||
@@ -731,9 +731,11 @@ To use the Python interface the Python DLL must be in your search path. In a
|
||||
console window type "path" to see what directories are used. The 'pythondll'
|
||||
or 'pythonthreedll' option can be also used to specify the Python DLL.
|
||||
|
||||
The name of the DLL must match the Python version Vim was compiled with.
|
||||
Currently the name is "python24.dll". That is for Python 2.4. To know for
|
||||
sure edit "gvim.exe" and search for "python\d*.dll\c".
|
||||
The name of the DLL should match the Python version Vim was compiled with.
|
||||
Currently the name for Python 2 is "python27.dll", that is for Python 2.7.
|
||||
That is the default value for 'pythondll'. For Python 3 it is python35.dll
|
||||
(Python 3.5). To know for sure edit "gvim.exe" and search for
|
||||
"python\d*.dll\c".
|
||||
|
||||
|
||||
Unix ~
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Jan 28
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Feb 09
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -2684,8 +2684,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
This option cannot be set from a |modeline|. It would most likely
|
||||
corrupt the text.
|
||||
|
||||
NOTE: For GTK+ 2 it is highly recommended to set 'encoding' to
|
||||
"utf-8". Although care has been taken to allow different values of
|
||||
NOTE: For GTK+ 2 or later, it is highly recommended to set 'encoding'
|
||||
to "utf-8". Although care has been taken to allow different values of
|
||||
'encoding', "utf-8" is the natural choice for the environment and
|
||||
avoids unnecessary conversion overhead. "utf-8" has not been made
|
||||
the default to prevent different behavior of the GUI and terminal
|
||||
@@ -3596,6 +3596,14 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
On systems where 'guifontset' is supported (X11) and 'guifontset' is
|
||||
not empty, then 'guifont' is not used.
|
||||
|
||||
Note: As to the GTK GUIs, no error is given against any invalid names,
|
||||
and the first element of the list is always picked up and made use of.
|
||||
This is because, instead of identifying a given name with a font, the
|
||||
GTK GUIs use it to construct a pattern and try to look up a font which
|
||||
best matches the pattern among available fonts, and this way, the
|
||||
matching never fails. An invalid name doesn't matter because a number
|
||||
of font properties other than name will do to get the matching done.
|
||||
|
||||
Spaces after a comma are ignored. To include a comma in a font name
|
||||
precede it with a backslash. Setting an option requires an extra
|
||||
backslash before a space and a backslash. See also
|
||||
@@ -3618,7 +3626,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The font name depends on the GUI used. See |setting-guifont| for a
|
||||
way to set 'guifont' for various systems.
|
||||
|
||||
For the GTK+ 2 GUI the font name looks like this: >
|
||||
For the GTK+ 2 and 3 GUIs, the font name looks like this: >
|
||||
:set guifont=Andale\ Mono\ 11
|
||||
< That's all. XLFDs are not used. For Chinese this is reported to work
|
||||
well: >
|
||||
@@ -3627,13 +3635,15 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
set guifontwide=Microsoft\ Yahei\ 12,WenQuanYi\ Zen\ Hei\ 12
|
||||
endif
|
||||
<
|
||||
(Replace gui_gtk2 with gui_gtk3 for the GTK+ 3 GUI)
|
||||
|
||||
For Mac OSX you can use something like this: >
|
||||
:set guifont=Monaco:h10
|
||||
< Also see 'macatsui', it can help fix display problems.
|
||||
*E236*
|
||||
Note that the fonts must be mono-spaced (all characters have the same
|
||||
width). An exception is GTK 2: all fonts are accepted, but
|
||||
mono-spaced fonts look best.
|
||||
width). An exception is GTK: all fonts are accepted, but mono-spaced
|
||||
fonts look best.
|
||||
|
||||
To preview a font on X11, you might be able to use the "xfontsel"
|
||||
program. The "xlsfonts" program gives a list of all available fonts.
|
||||
@@ -3671,7 +3681,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
{not in Vi}
|
||||
{only available when compiled with GUI enabled and
|
||||
with the |+xfontset| feature}
|
||||
{not available in the GTK+ 2 GUI}
|
||||
{not available in the GTK+ GUI}
|
||||
When not empty, specifies two (or more) fonts to be used. The first
|
||||
one for normal English, the second one for your special language. See
|
||||
|xfontset|.
|
||||
@@ -3700,7 +3710,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Note: The size of these fonts must be exactly twice as wide as the one
|
||||
specified with 'guifont' and the same height.
|
||||
|
||||
All GUI versions but GTK+ 2:
|
||||
All GUI versions but GTK+:
|
||||
|
||||
'guifontwide' is only used when 'encoding' is set to "utf-8" and
|
||||
'guifontset' is empty or invalid.
|
||||
@@ -3708,7 +3718,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'guifontwide' is empty Vim will attempt to find a matching
|
||||
double-width font and set 'guifontwide' to it.
|
||||
|
||||
GTK+ 2 GUI only: *guifontwide_gtk2*
|
||||
GTK+ GUI only: *guifontwide_gtk*
|
||||
|
||||
If set and valid, 'guifontwide' is always used for double width
|
||||
characters, even if 'encoding' is not set to "utf-8".
|
||||
@@ -7606,7 +7616,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
For further details see |arabic.txt|.
|
||||
|
||||
*'termencoding'* *'tenc'*
|
||||
'termencoding' 'tenc' string (default ""; with GTK+ 2 GUI: "utf-8"; with
|
||||
'termencoding' 'tenc' string (default ""; with GTK+ GUI: "utf-8"; with
|
||||
Macintosh GUI: "macroman")
|
||||
global
|
||||
{only available when compiled with the |+multi_byte|
|
||||
@@ -7618,7 +7628,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
display). Except for the Mac when 'macatsui' is off, then
|
||||
'termencoding' should be "macroman".
|
||||
*E617*
|
||||
Note: This does not apply to the GTK+ 2 GUI. After the GUI has been
|
||||
Note: This does not apply to the GTK+ GUI. After the GUI has been
|
||||
successfully initialized, 'termencoding' is forcibly set to "utf-8".
|
||||
Any attempts to set a different value will be rejected, and an error
|
||||
message is shown.
|
||||
@@ -7901,7 +7911,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'toolbariconsize' 'tbis' string (default "small")
|
||||
global
|
||||
{not in Vi}
|
||||
{only in the GTK+ 2 GUI}
|
||||
{only in the GTK+ GUI}
|
||||
Controls the size of toolbar icons. The possible values are:
|
||||
tiny Use tiny icons.
|
||||
small Use small icons (default).
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*repeat.txt* For Vim version 8.0. Last change: 2016 Sep 11
|
||||
*repeat.txt* For Vim version 8.0. Last change: 2017 Feb 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -305,6 +305,11 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
Mark) in utf-8 format Vim will recognize it, no need
|
||||
to use ":scriptencoding utf-8" then.
|
||||
|
||||
If you set the 'encoding' option in your |.vimrc|,
|
||||
`:scriptencoding` must be placed after that. E.g.: >
|
||||
set encoding=utf-8
|
||||
scriptencoding utf-8
|
||||
<
|
||||
When compiled without the |+multi_byte| feature this
|
||||
command is ignored.
|
||||
{not in Vi}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 8.0. Last change: 2017 Jan 17
|
||||
*syntax.txt* For Vim version 8.0. Last change: 2017 Feb 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1476,7 +1476,7 @@ algorithm should work in the vast majority of cases. In some cases, such as a
|
||||
file that begins with 500 or more full-line comments, the script may
|
||||
incorrectly decide that the fortran code is in fixed form. If that happens,
|
||||
just add a non-comment statement beginning anywhere in the first five columns
|
||||
of the first twenty five lines, save (:w) and then reload (:e!) the file.
|
||||
of the first twenty-five lines, save (:w) and then reload (:e!) the file.
|
||||
|
||||
Tabs in fortran files ~
|
||||
Tabs are not recognized by the Fortran standards. Tabs are not a good idea in
|
||||
@@ -2933,6 +2933,13 @@ reduce this, the "sh_maxlines" internal variable can be set. Example: >
|
||||
The default is to use the twice sh_minlines. Set it to a smaller number to
|
||||
speed up displaying. The disadvantage is that highlight errors may appear.
|
||||
|
||||
syntax/sh.vim tries to flag certain problems as errors; usually things like
|
||||
extra ']'s, 'done's, 'fi's, etc. If you find the error handling problematic
|
||||
for your purposes, you may suppress such error highlighting by putting
|
||||
the following line in your .vimrc: >
|
||||
|
||||
let g:sh_no_error= 1
|
||||
<
|
||||
|
||||
*sh-embed* *sh-awk*
|
||||
Sh: EMBEDDING LANGUAGES~
|
||||
@@ -3235,11 +3242,11 @@ syntax highlighting script handles this with the following logic:
|
||||
* If g:tex_stylish exists and is 1
|
||||
then the file will be treated as a "sty" file, so the "_"
|
||||
will be allowed as part of keywords
|
||||
(irregardless of g:tex_isk)
|
||||
(regardless of g:tex_isk)
|
||||
* Else if the file's suffix is sty, cls, clo, dtx, or ltx,
|
||||
then the file will be treated as a "sty" file, so the "_"
|
||||
will be allowed as part of keywords
|
||||
(irregardless of g:tex_isk)
|
||||
(regardless of g:tex_isk)
|
||||
|
||||
* If g:tex_isk exists, then it will be used for the local 'iskeyword'
|
||||
* Else the local 'iskeyword' will be set to 48-57,a-z,A-Z,192-255
|
||||
|
||||
@@ -139,6 +139,10 @@ something else.
|
||||
:+tabclose " close the next tab page
|
||||
:1tabclose " close the first tab page
|
||||
:$tabclose " close the last tab page
|
||||
:tabclose -2 " close the two previous tab page
|
||||
:tabclose + " close the next tab page
|
||||
:tabclose 3 " close the third tab page
|
||||
:tabclose $ " close the last tab page
|
||||
<
|
||||
*:tabo* *:tabonly*
|
||||
:tabo[nly][!] Close all other tab pages.
|
||||
@@ -153,13 +157,20 @@ something else.
|
||||
" one
|
||||
|
||||
:{count}tabo[nly][!]
|
||||
Close all tab pages except the {count}th one. >
|
||||
:tabo[nly][!] {count}
|
||||
Close all tab pages except {count} one. >
|
||||
:.tabonly " as above
|
||||
:-tabonly " close all tab pages except the previous
|
||||
" one
|
||||
:+tabonly " close all tab pages except the next one
|
||||
:1tabonly " close all tab pages except the first one
|
||||
:$tabonly " close all tab pages except the last one
|
||||
:tabonly - " close all tab pages except the previous
|
||||
" one
|
||||
:tabonly +2 " close all tab pages except the two next
|
||||
" one
|
||||
:tabonly 1 " close all tab pages except the first one
|
||||
:tabonly $ " close all tab pages except the last one
|
||||
|
||||
|
||||
SWITCHING TO ANOTHER TAB PAGE:
|
||||
@@ -174,7 +185,20 @@ gt *i_CTRL-<PageDown>* *i_<C-PageDown>*
|
||||
Go to the next tab page. Wraps around from the last to the
|
||||
first one.
|
||||
|
||||
:{count}tabn[ext]
|
||||
:tabn[ext] {count}
|
||||
Go to tab page {count}. The first tab page has number one. >
|
||||
:-tabnext " go to the previous tab page
|
||||
:+tabnext " go to the next tab page
|
||||
:+2tabnext " go to the two next tab page
|
||||
:1tabnext " go to the first tab page
|
||||
:$tabnext " go to the last tab page
|
||||
:tabnext $ " as above
|
||||
:tabnext - " go to the previous tab page
|
||||
:tabnext -1 " as above
|
||||
:tabnext + " go to the next tab page
|
||||
:tabnext +1 " as above
|
||||
|
||||
{count}<C-PageDown>
|
||||
{count}gt Go to tab page {count}. The first tab page has number one.
|
||||
|
||||
|
||||
@@ -4498,6 +4498,7 @@ E935 eval.txt /*E935*
|
||||
E936 autocmd.txt /*E936*
|
||||
E937 autocmd.txt /*E937*
|
||||
E938 eval.txt /*E938*
|
||||
E939 change.txt /*E939*
|
||||
E94 windows.txt /*E94*
|
||||
E95 message.txt /*E95*
|
||||
E96 diff.txt /*E96*
|
||||
@@ -6588,7 +6589,7 @@ gui-x11-various gui_x11.txt /*gui-x11-various*
|
||||
gui.txt gui.txt /*gui.txt*
|
||||
gui_w32.txt gui_w32.txt /*gui_w32.txt*
|
||||
gui_x11.txt gui_x11.txt /*gui_x11.txt*
|
||||
guifontwide_gtk2 options.txt /*guifontwide_gtk2*
|
||||
guifontwide_gtk options.txt /*guifontwide_gtk*
|
||||
guifontwide_win_mbyte options.txt /*guifontwide_win_mbyte*
|
||||
guioptions_a options.txt /*guioptions_a*
|
||||
guu change.txt /*guu*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Jan 28
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Feb 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -35,6 +35,17 @@ entered there will not be repeated below, unless there is extra information.
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Patch 195 introduced a regression in tag priority. (Charles Campbell, 2017 Feb
|
||||
10)
|
||||
|
||||
Memory leak in test97?
|
||||
|
||||
exists('&t_k1') returns false even when t_k1 was set.
|
||||
Use in test_assign.vim to only get value of &t_k1 if it exists. #1459
|
||||
|
||||
test_gui fails with Athena:
|
||||
Caught exception in Test_1_set_secure(): Vim(gui):E285: Failed to create input context @ function RunTheTest[21]..Test_1_set_secure, line 2
|
||||
|
||||
+channel:
|
||||
- Try out background make plugin:
|
||||
https://github.com/AndrewVos/vim-make-background
|
||||
@@ -105,51 +116,77 @@ Regexp problems:
|
||||
- Difference between two engines: ".*\zs\/\@>\/" on text "///"
|
||||
(Chris Paul, 2016 Nov 13) New engine not greedy enough?
|
||||
|
||||
'] mark invalid after undoing insert "hello".
|
||||
|
||||
When using symbolic links, a package path will not be inserted at the right
|
||||
position in 'runtimepath'. (Dugan Chen, 2016 Nov 18)
|
||||
Add a toolbar in the terminal. Can be global, above all windows, or specific
|
||||
for one window.
|
||||
Use tb_set(winid, [{'text': 'stop', 'cb': callback, 'hi': 'Green'}])
|
||||
tb_highlight(winid, 'ToolBar')
|
||||
tb_get(winid)
|
||||
|
||||
json_encode(): should convert to utf-8. (Nikolai Pavlov, 2016 Jan 23)
|
||||
What if there is an invalid character?
|
||||
|
||||
Allow using json with empty key? Dict already has it.
|
||||
|
||||
Json string with trailing \u should be an error. (Lcd)
|
||||
|
||||
Patch for double free setting 'ttytype' (Dominique, 2017 Feb 10, #1461)
|
||||
|
||||
Patch for using uninitialized memory (Dominique, 2017 Feb 11, #1464)
|
||||
|
||||
Patch for crash setting 'guicursor'. (Dominique, 2017 Feb 11, #1465)
|
||||
|
||||
Multi-byte bug: dv} splits char. (Urtica Dioica, 2017 Jan 9)
|
||||
|
||||
Patch: Make mode() return "ix" or "Rx" when in completion mode.
|
||||
(Yegappan Lakshmanan, 2017 Jan 19, #1397, update Jan 22)
|
||||
Patch to add test for 'number' and 'relativenumber'. (Ozaki Kiichi, #1447)
|
||||
Now merged in test89 (Feb 12)
|
||||
|
||||
With Visual selection of a multi-byte character the '] mark is on the last
|
||||
byte, should be first byte?
|
||||
Patch to fix tabline redraw. (Christian Brabandt, 2017 Feb 10)
|
||||
Better way to fix this?
|
||||
|
||||
When session file has name in argument list but the buffer was deleted, the
|
||||
buffer is not deleted when using the session file. (#1393)
|
||||
Should add the buffer in hidden state.
|
||||
|
||||
Patch to change VimL to "Vim script". (Hirohito Higashi, 2017 Feb 14)
|
||||
|
||||
Invalid memory access with :normal command. (Dominique Pelle, 2017 Feb 14)
|
||||
|
||||
When "gf" excludes following ":99", jump to line 99.
|
||||
Also when editing a file foo.txt:99 ?
|
||||
|
||||
When an item in the quickfix list has a file name that does not exist, behave
|
||||
like the item was not a match for :cnext.
|
||||
|
||||
Patch for warning about integer overflow in undo.c (King, 2017 Feb 12)
|
||||
And another similar one.
|
||||
|
||||
Patch for null pointer use in undo.c (King, 2017 Feb 12)
|
||||
|
||||
Patch to avoid using CTRL-O when do_cmdline_cmd is called. (James McCoy, 2017
|
||||
Feb 7, #1453)
|
||||
|
||||
Patch for multi-byte line wrap. (Ozaki Kiichi, 2017 Feb 7, #1456)
|
||||
|
||||
Patch to show balloon with a function. (Jusufadis Bakamovic, #1449)
|
||||
|
||||
Wrong diff highlighting with three files. (2016 Oct 20, #1186)
|
||||
Also get E749 on exit.
|
||||
Another example in #1309
|
||||
|
||||
Completion for user-defined commands does not work if a few chararacters were
|
||||
Completion for user-defined commands does not work if a few characters were
|
||||
already typed. (Dominique, 2017 Jan 26)
|
||||
|
||||
Patch for nsis script to add a dll file. (Christian Brabandt, 2017 Feb 10)
|
||||
Also include the .dll file?
|
||||
|
||||
Patch for capitalizations in menus. (Zhen-Huan Hu, 2017 Feb 9)
|
||||
|
||||
When deleting a mark or register, leave a tombstone, so that it's also deleted
|
||||
when writing viminfo (and the delete was the most recent action). #1339
|
||||
|
||||
Relevant neovim patch:
|
||||
https://github.com/neovim/neovim/pull/5737#issuecomment-266055165
|
||||
|
||||
Patch for better explanation of 'compatible' side effects.
|
||||
https://github.com/vim/vim/pull/1161/files
|
||||
|
||||
Patch to add 'makeencoding', useful when the system encoding differs from
|
||||
Vim's 'encoding' setting. (Ken Takata, 2017 Jan 6)
|
||||
Vim's 'encoding' setting. (Ken Takata, 2017 Jan 31)
|
||||
|
||||
Patch to adjust marks when adding a new line to the end of buffer in diff
|
||||
mode. (James McCoy, 2016 Dec 14, #1329)
|
||||
@@ -159,18 +196,37 @@ Suggestion to improve pt-br spell checking. (Marcelo D Montu, 2016 Dec 15,
|
||||
|
||||
Error in test_startup_utf8 on Solaris. (Danek Duvall, 2016 Aug 17)
|
||||
|
||||
Patch to fix that test87 fails on Arch Linux. (Jesin, 2017 Feb 10)
|
||||
|
||||
Completion for :!cmd shows each match twice. #1435
|
||||
|
||||
Rule to use "^" for statusline does not work if a space is defined with
|
||||
highlighting for both stl and stlnc. Patch by Ken Hamada (itchyny, 2016 Dec 11)
|
||||
|
||||
8 "stl" and "stlnc" in 'fillchars' don't work for multi-byte characters.
|
||||
Patch by Christian Wellenbrock, 2013 Jul 5.
|
||||
|
||||
Using CTRL-G_U in InsertCharPre causes trouble for redo. (Israel Chauca
|
||||
Fuentes, 2017 Feb 12, #1470)
|
||||
|
||||
Screen updated delayed when using CTRL-O u in Insert mode.
|
||||
(Barlik, #1191) Perhaps because status message?
|
||||
|
||||
Patch to add buffer name argument to taglist().
|
||||
Ordering of tags in result of taglist call. (Duncan McDougall, #1194)
|
||||
|
||||
Patch to fix that b_ind_has_comment is not correctly reset. (Christian
|
||||
Brabandt, 2017 Feb 14, closes #1475)
|
||||
|
||||
writefile() does not abort as soon as an error is found. (Nikolai Pavlov,
|
||||
2017 Feb 14, #1476)
|
||||
|
||||
Patch to support on-the-spot and over-the-spot input method. (Ken Takata, 2017
|
||||
Feb 14).
|
||||
|
||||
Add a command to take a range of lines, filter them and put the output
|
||||
somewhere else. :{range}copy {dest} !cmd
|
||||
|
||||
Patch to fix that empty first tab is not in session.
|
||||
(Hirohito Higashi, 2016 Nov 25, #1282)
|
||||
|
||||
@@ -184,6 +240,9 @@ The TermResponse event is not triggered when a plugin has set 'eventignore' to
|
||||
"all". Netrw does this. (Gary Johnson, 2017 Jan 24)
|
||||
Postpone the event until 'eventignore' is reset.
|
||||
|
||||
Patch to make urxvt mouse work better, recognize Esc[*M termcap code.
|
||||
(Maurice Bos, 2017 Feb 17, #1486)
|
||||
|
||||
Once .exe with updated installer is available: Add remark to download page
|
||||
about /S and /D options (Ken Takata, 2016 Apr 13)
|
||||
Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases
|
||||
@@ -191,6 +250,11 @@ Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases
|
||||
Problem passing non-UTF-8 strings to Python 3. (Björn Linse, 2016 Sep 11,
|
||||
#1053) With patch, does it work?
|
||||
|
||||
Using --remote to open a file in which a # appears does not work on
|
||||
MS-Windows. Perhaps in \# the \ is seen as a path separator. (Axel Bender,
|
||||
2017 Feb 9) Can we expand wildcards first and send the path literally to the
|
||||
receiving Vim? Or make an exception for #, it's not useful remotely.
|
||||
|
||||
Use ADDR_OTHER instead of ADDR_LINES for many more commands.
|
||||
Add tests for using number larger than number of lines in buffer.
|
||||
|
||||
@@ -228,6 +292,8 @@ Patch to add trim() function. (Bukn, 2016 Nov 25, #1280)
|
||||
|
||||
Patch to add MODIFIED_BY to MSVC build file. (Chen Lei, 2016 Nov 24, #1275)
|
||||
|
||||
Patch to change argument of :marks. (LemonBoy, 2017 Jan 29, #1426)
|
||||
|
||||
On Windows buffer completion sees backslash as escape char instead of path
|
||||
separator. (Toffanim, 2016 Nov 24, #1274)
|
||||
|
||||
@@ -265,7 +331,7 @@ change as a word boundary. (btucker-MPCData, 2016 Nov 6, #1235)
|
||||
Idea from Sven: record sequence of keys. Useful to show others what they are
|
||||
doing (look over the shoulder), and also to see what happened.
|
||||
Probably list of keystrokes, with some annotations for mode changes.
|
||||
Could store in logfile to be able to analyise it with an external command.
|
||||
Could store in logfile to be able to analyse it with an external command.
|
||||
E.g. to see when's the last time a plugin command was used.
|
||||
|
||||
execute() cannot be used with command completeion. (Daniel Hahler, 2016 Oct 1,
|
||||
@@ -293,7 +359,7 @@ Also with latest version.
|
||||
Cannot delete a file with square brackets with delete(). (#696)
|
||||
|
||||
Patch to add ":syn foldlevel" to use fold level further down the line.
|
||||
(Brad King, 2016 Oct 19)
|
||||
(Brad King, 2016 Oct 19, update 2017 Jan 30)
|
||||
|
||||
Completion for input() does not expand environment variables. (chdiza, 2016
|
||||
Jul 25, #948)
|
||||
|
||||
@@ -182,7 +182,7 @@ the following:
|
||||
|
||||
This tells you that you might want to fix something on line 33. So how do you
|
||||
find line 33? One way is to do "9999k" to go to the top of the file and "32j"
|
||||
to go down thirty two lines. It is not a good way, but it works. A much
|
||||
to go down thirty-two lines. It is not a good way, but it works. A much
|
||||
better way of doing things is to use the "G" command. With a count, this
|
||||
command positions you at the given line number. For example, "33G" puts you
|
||||
on line 33. (For a better way of going through a compiler's error list, see
|
||||
|
||||
@@ -886,7 +886,7 @@ Adjusted test2 for this.
|
||||
Allow using a URL in 'path'. Makes ":find index.html" work.
|
||||
|
||||
GTK: Allow dropping a http:// and ftp:// URL on Vim. The netrw plugin takes
|
||||
care of downloading the file. (MiKael Berthe)
|
||||
care of downloading the file. (Mikael Berthe)
|
||||
|
||||
|
||||
Window for command-line editing *new-cmdwin*
|
||||
@@ -5388,7 +5388,7 @@ Files: src/os_win32.c
|
||||
|
||||
Patch 6.0.256 (extra)
|
||||
Problem: Win32: ":highlight Comment guifg=asdf" does not give an error
|
||||
message. (Randall W. Morris) Also for other systems.
|
||||
message. (Randall W. Morris) Also for other systems.
|
||||
Solution: Add gui_get_color() to give one error message for all systems.
|
||||
Files: src/gui.c, src/gui_amiga.c, src/gui_athena.c, src/gui_motif.c,
|
||||
src/gui_riscos.c, src/gui_x11.c, src/gui_gtk_x11.c,
|
||||
@@ -9955,7 +9955,7 @@ Use "copy /y" in Make_bc5.mak to avoid a prompt for overwriting.
|
||||
|
||||
Patch 6.2.001
|
||||
Problem: The ":stopinsert" command doesn't have a help tag.
|
||||
Solution: Add the tag. (Antoine J. Mechelynck)
|
||||
Solution: Add the tag. (Antoine J. Mechelynck)
|
||||
Files: runtime/doc/insert.txt, runtime/doc/tags
|
||||
|
||||
Patch 6.2.002
|
||||
|
||||
@@ -1445,7 +1445,7 @@ g CTRL-G also shows the number of characters if it differs from the number of
|
||||
bytes.
|
||||
|
||||
Completion for ":debug" and entering an expression for the '=' register. Skip
|
||||
":" between range and command name. (Peter winters)
|
||||
":" between range and command name. (Peter Winters)
|
||||
|
||||
CTRL-Q in Insert mode now works like CTRL-V by default. Previously it was
|
||||
ignored.
|
||||
@@ -3371,7 +3371,7 @@ Files: runtime/scripts.vim
|
||||
Patch 7.0.050
|
||||
Problem: After using the netbeans interface close command a stale pointer
|
||||
may be used.
|
||||
Solution: Clear the pointer to the closed buffer. (Xaview de Gaye)
|
||||
Solution: Clear the pointer to the closed buffer. (Xavier de Gaye)
|
||||
Files: src/netbeans.c
|
||||
|
||||
Patch 7.0.051 (after 7.0.44)
|
||||
@@ -16272,7 +16272,7 @@ Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok
|
||||
|
||||
Patch 7.3.1026
|
||||
Problem: New regexp: pattern that includes a new-line matches too early.
|
||||
(john McGowan)
|
||||
(John McGowan)
|
||||
Solution: Do not start searching in the second line.
|
||||
Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok
|
||||
|
||||
|
||||
18
runtime/ftplugin/awk.vim
Normal file
18
runtime/ftplugin/awk.vim
Normal file
@@ -0,0 +1,18 @@
|
||||
" Vim filetype plugin
|
||||
" Language: awk, nawk, gawk, mawk
|
||||
" Maintainer: Antonio Colombo <azc100@gmail.com>
|
||||
" Last Change: 2017 Feb 17
|
||||
|
||||
" This plugin was prepared by Mark Sikora
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Don't load another plugin for this buffer
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = "setl commentstring<"
|
||||
|
||||
setlocal commentstring=#\ %s
|
||||
@@ -2,7 +2,7 @@
|
||||
" You can also use this as a start for your own set of menus.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2016 Jul 27
|
||||
" Last Change: 2017 Feb 09
|
||||
|
||||
" Note that ":an" (short for ":anoremenu") is often used to make a menu work
|
||||
" in all modes and avoid side effects from mappings defined by the user.
|
||||
@@ -481,7 +481,7 @@ if has("folding")
|
||||
an 40.340.130 &Tools.&Folding.C&lose\ more\ folds<Tab>zm zm
|
||||
an 40.340.140 &Tools.&Folding.&Close\ all\ folds<Tab>zM zM
|
||||
an 40.340.150 &Tools.&Folding.O&pen\ more\ folds<Tab>zr zr
|
||||
an 40.340.160 &Tools.&Folding.&Open\ all\ folds<Tab>zR zR
|
||||
an 40.340.160 &Tools.&Folding.&Open\ All\ Folds<Tab>zR zR
|
||||
" fold method
|
||||
an 40.340.200 &Tools.&Folding.-SEP1- <Nop>
|
||||
an 40.340.210 &Tools.&Folding.Fold\ Met&hod.M&anual :set fdm=manual<CR>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" These commands create the option window.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2016 Aug 21
|
||||
" Last Change: 2017 Jan 28
|
||||
|
||||
" If there already is an option window, jump to that one.
|
||||
if bufwinnr("option-window") > 0
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
" Language: shell (sh) Korn shell (ksh) bash (sh)
|
||||
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
|
||||
" Last Change: Jan 03, 2017
|
||||
" Version: 167
|
||||
" Last Change: Jan 30, 2017
|
||||
" Version: 168
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
|
||||
" For options and settings, please use: :help ft-sh-syntax
|
||||
" This file includes many ideas from Eric Brunet (eric.brunet@ens.fr)
|
||||
@@ -346,7 +346,7 @@ syn region shSingleQuote matchgroup=shQuote start=+'+ end=+'+ contains=@Spell
|
||||
syn region shDoubleQuote matchgroup=shQuote start=+\%(\%(\\\\\)*\\\)\@<!"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,@Spell
|
||||
syn match shStringSpecial "[^[:print:] \t]" contained
|
||||
syn match shStringSpecial "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]"
|
||||
syn match shSpecial "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shBkslshSnglQuote,shBkslshDblQuote
|
||||
syn match shSpecial "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]"
|
||||
syn match shSpecial "^\%(\\\\\)*\\[\\"'`$()#]"
|
||||
syn match shSpecialNxt contained "\\[\\"'`$()#]"
|
||||
syn region shBkslshSnglQuote contained matchgroup=shQuote start=+'+ end=+'+ contains=@Spell
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: TeX
|
||||
" Maintainer: Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM>
|
||||
" Last Change: Dec 07, 2016
|
||||
" Version: 102
|
||||
" Last Change: Jan 31, 2017
|
||||
" Version: 103
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX
|
||||
"
|
||||
" Notes: {{{1
|
||||
@@ -511,7 +511,7 @@ if !exists("g:tex_no_math")
|
||||
if &ambw == "double" || exists("g:tex_usedblwidth")
|
||||
let s:texMathDelimList= s:texMathDelimList + [
|
||||
\ ['\\langle' , '〈'] ,
|
||||
\ ['\\rangle' , '〉'] ,
|
||||
\ ['\\rangle' , '〉']]
|
||||
else
|
||||
let s:texMathDelimList= s:texMathDelimList + [
|
||||
\ ['\\langle' , '<'] ,
|
||||
@@ -594,8 +594,6 @@ endif
|
||||
if s:tex_fast =~# 'v'
|
||||
if exists("g:tex_verbspell") && g:tex_verbspell
|
||||
syn region texZone start="\\begin{[vV]erbatim}" end="\\end{[vV]erbatim}\|%stopzone\>" contains=@Spell
|
||||
" listings package:
|
||||
syn region texZone start="\\begin{lstlisting}" end="\\end{lstlisting}\|%stopzone\>" contains=@Spell
|
||||
if b:tex_stylish
|
||||
syn region texZone start="\\verb\*\=\z([^\ta-zA-Z@]\)" end="\z1\|%stopzone\>" contains=@Spell
|
||||
else
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
" Vim syntax file
|
||||
" Language: X Pixmap
|
||||
" Maintainer: Ronald Schild <rs@scutum.de>
|
||||
" Last Change: 2008 May 28
|
||||
" Last Change: 2017 Feb 01
|
||||
" Version: 5.4n.1
|
||||
" Jemma Nelson added termguicolors support
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -15,7 +16,7 @@ syn keyword xpmTodo TODO FIXME XXX contained
|
||||
syn region xpmComment start="/\*" end="\*/" contains=xpmTodo
|
||||
syn region xpmPixelString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@xpmColors
|
||||
|
||||
if has("gui_running")
|
||||
if has("gui_running") || has("termguicolors") && &termguicolors
|
||||
|
||||
let color = ""
|
||||
let chars = ""
|
||||
@@ -120,7 +121,7 @@ endwhile
|
||||
|
||||
unlet color chars colors cpp n i s
|
||||
|
||||
endif " has("gui_running")
|
||||
endif " has("gui_running") || has("termguicolors") && &termguicolors
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
" Vim syntax file
|
||||
" Language: X Pixmap v2
|
||||
" Maintainer: Steve Wall (hitched97@velnet.com)
|
||||
" Last Change: 2012 Jun 01
|
||||
" Last Change: 2017 Feb 01
|
||||
" (Dominique Pelle added @Spell)
|
||||
" Version: 5.8
|
||||
" Jemma Nelson added termguicolors support
|
||||
"
|
||||
" Made from xpm.vim by Ronald Schild <rs@scutum.de>
|
||||
|
||||
@@ -22,7 +23,7 @@ syn match xpm2Comment "\!.*$" contains=@Spell,xpm2Todo
|
||||
|
||||
command -nargs=+ Hi hi def <args>
|
||||
|
||||
if has("gui_running")
|
||||
if has("gui_running") || has("termguicolors") && &termguicolors
|
||||
|
||||
let color = ""
|
||||
let chars = ""
|
||||
@@ -132,7 +133,7 @@ if has("gui_running")
|
||||
|
||||
unlet color chars colors cpp n i s
|
||||
|
||||
endif " has("gui_running")
|
||||
endif " has("gui_running") || has("termguicolors") && &termguicolors
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
@@ -542,7 +542,7 @@ Nota:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lecci<EFBFBD>n 5.3: UN MANDATO DE ESCRITURA SELECTIVO
|
||||
|
||||
** Para guardar parte del fuchero escriba :#,# NOMBRE_DEL_FICHERO **
|
||||
** Para guardar parte del fichero escriba :#,# NOMBRE_DEL_FICHERO **
|
||||
|
||||
|
||||
1. Escriba de nuevo, una vez m<EFBFBD>s, :!dir o :!ls para obtener una lista
|
||||
|
||||
@@ -523,7 +523,7 @@ NOTA: La posizione del cursore si vede nell'angolo in basso a destra dello
|
||||
schiacciato mentre premi la lettera o). Ripeti CTRL-O per andare ancora
|
||||
indietro. Puoi usare CTRL-I per tornare in avanti.
|
||||
|
||||
NOTA: "errroore" non <20> il modo giusto di digitare errore; errroore <20> un errore.
|
||||
---> "errroore" non <20> il modo giusto di digitare errore; errroore <20> un errore.
|
||||
NOTA: Quando la ricerca arriva a fine file, ricomincia dall'inizio del file,
|
||||
a meno che l'opzione 'wrapscan' sia stata disattivata.
|
||||
|
||||
@@ -730,7 +730,7 @@ NOTA: Puoi anche leggere l'output prodotto da un comando esterno. Ad es.
|
||||
|
||||
4. Per aprire una linea SOPRA il cursore, batti una O maiuscola, invece
|
||||
che una o minuscola. Prova sulla linea qui sotto.
|
||||
Apri una linea SOPRA questa battendo O mentre il cursore <20> su questa linea.
|
||||
---> Apri una linea SOPRA questa battendo O mentre il cursore <20> su questa linea.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -523,7 +523,7 @@ NOTA: La posizione del cursore si vede nell'angolo in basso a destra dello
|
||||
schiacciato mentre premi la lettera o). Ripeti CTRL-O per andare ancora
|
||||
indietro. Puoi usare CTRL-I per tornare in avanti.
|
||||
|
||||
NOTA: "errroore" non è il modo giusto di digitare errore; errroore è un errore.
|
||||
---> "errroore" non è il modo giusto di digitare errore; errroore è un errore.
|
||||
NOTA: Quando la ricerca arriva a fine file, ricomincia dall'inizio del file,
|
||||
a meno che l'opzione 'wrapscan' sia stata disattivata.
|
||||
|
||||
@@ -730,7 +730,7 @@ NOTA: Puoi anche leggere l'output prodotto da un comando esterno. Ad es.
|
||||
|
||||
4. Per aprire una linea SOPRA il cursore, batti una O maiuscola, invece
|
||||
che una o minuscola. Prova sulla linea qui sotto.
|
||||
Apri una linea SOPRA questa battendo O mentre il cursore è su questa linea.
|
||||
---> Apri una linea SOPRA questa battendo O mentre il cursore è su questa linea.
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -2099,6 +2099,7 @@ test_arglist \
|
||||
test_cdo \
|
||||
test_channel \
|
||||
test_charsearch \
|
||||
test_changedtick \
|
||||
test_cmdline \
|
||||
test_command_count \
|
||||
test_crypt \
|
||||
@@ -2176,6 +2177,7 @@ test_arglist \
|
||||
test_pyx2 \
|
||||
test_pyx3 \
|
||||
test_quickfix \
|
||||
test_recover \
|
||||
test_regexp_latin \
|
||||
test_regexp_utf8 \
|
||||
test_reltime \
|
||||
|
||||
40
src/buffer.c
40
src/buffer.c
@@ -832,6 +832,7 @@ free_buffer(buf_T *buf)
|
||||
free_buffer_stuff(buf, TRUE);
|
||||
#ifdef FEAT_EVAL
|
||||
unref_var_dict(buf->b_vars);
|
||||
buf->b_changedtick = &buf->b_ct_val;
|
||||
#endif
|
||||
#ifdef FEAT_LUA
|
||||
lua_buffer_free(buf);
|
||||
@@ -872,6 +873,34 @@ free_buffer(buf_T *buf)
|
||||
vim_free(buf);
|
||||
}
|
||||
|
||||
/*
|
||||
* Initializes buf->b_changedtick.
|
||||
*/
|
||||
static void
|
||||
init_changedtick(buf_T *buf)
|
||||
{
|
||||
#ifdef FEAT_EVAL
|
||||
dictitem_T *di = dictitem_alloc((char_u *)"changedtick");
|
||||
|
||||
if (di != NULL)
|
||||
{
|
||||
di->di_flags |= DI_FLAGS_LOCK | DI_FLAGS_FIX | DI_FLAGS_RO;
|
||||
di->di_tv.v_type = VAR_NUMBER;
|
||||
di->di_tv.v_lock = VAR_FIXED;
|
||||
di->di_tv.vval.v_number = 0;
|
||||
if (dict_add(buf->b_vars, di) == OK)
|
||||
buf->b_changedtick = &di->di_tv.vval.v_number;
|
||||
else
|
||||
{
|
||||
vim_free(di);
|
||||
buf->b_changedtick = &buf->b_ct_val;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
buf->b_changedtick = &buf->b_ct_val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Free stuff in the buffer for ":bdel" and when wiping out the buffer.
|
||||
*/
|
||||
@@ -889,8 +918,14 @@ free_buffer_stuff(
|
||||
#endif
|
||||
}
|
||||
#ifdef FEAT_EVAL
|
||||
vars_clear(&buf->b_vars->dv_hashtab); /* free all internal variables */
|
||||
hash_init(&buf->b_vars->dv_hashtab);
|
||||
{
|
||||
varnumber_T tick = *buf->b_changedtick;
|
||||
|
||||
vars_clear(&buf->b_vars->dv_hashtab); /* free all buffer variables */
|
||||
hash_init(&buf->b_vars->dv_hashtab);
|
||||
init_changedtick(buf);
|
||||
*buf->b_changedtick = tick;
|
||||
}
|
||||
#endif
|
||||
#ifdef FEAT_USR_CMDS
|
||||
uc_clear(&buf->b_ucmds); /* clear local user commands */
|
||||
@@ -1979,6 +2014,7 @@ buflist_new(
|
||||
}
|
||||
init_var_dict(buf->b_vars, &buf->b_bufvar, VAR_SCOPE);
|
||||
#endif
|
||||
init_changedtick(buf);
|
||||
}
|
||||
|
||||
if (ffname != NULL)
|
||||
|
||||
@@ -1668,7 +1668,7 @@ ins_redraw(
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* Trigger TextChangedI if b_changedtick differs. */
|
||||
if (ready && has_textchangedI()
|
||||
&& last_changedtick != curbuf->b_changedtick
|
||||
&& last_changedtick != *curbuf->b_changedtick
|
||||
# ifdef FEAT_INS_EXPAND
|
||||
&& !pum_visible()
|
||||
# endif
|
||||
@@ -1677,7 +1677,7 @@ ins_redraw(
|
||||
if (last_changedtick_buf == curbuf)
|
||||
apply_autocmds(EVENT_TEXTCHANGEDI, NULL, NULL, FALSE, curbuf);
|
||||
last_changedtick_buf = curbuf;
|
||||
last_changedtick = curbuf->b_changedtick;
|
||||
last_changedtick = *curbuf->b_changedtick;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3583,7 +3583,11 @@ ins_compl_addleader(int c)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
int cc;
|
||||
#endif
|
||||
|
||||
if (stop_arrow() == FAIL)
|
||||
return;
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte && (cc = (*mb_char2len)(c)) > 1)
|
||||
{
|
||||
char_u buf[MB_MAXBYTES + 1];
|
||||
|
||||
111
src/eval.c
111
src/eval.c
@@ -1451,14 +1451,8 @@ list_glob_vars(int *first)
|
||||
static void
|
||||
list_buf_vars(int *first)
|
||||
{
|
||||
char_u numbuf[NUMBUFLEN];
|
||||
|
||||
list_hashtable_vars(&curbuf->b_vars->dv_hashtab, (char_u *)"b:",
|
||||
TRUE, first);
|
||||
|
||||
sprintf((char *)numbuf, "%ld", (long)curbuf->b_changedtick);
|
||||
list_one_var_a((char_u *)"b:", (char_u *)"changedtick", VAR_NUMBER,
|
||||
numbuf, first);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1805,20 +1799,6 @@ ex_let_one(
|
||||
return arg_end;
|
||||
}
|
||||
|
||||
/*
|
||||
* If "arg" is equal to "b:changedtick" give an error and return TRUE.
|
||||
*/
|
||||
int
|
||||
check_changedtick(char_u *arg)
|
||||
{
|
||||
if (STRNCMP(arg, "b:changedtick", 13) == 0 && !eval_isnamec(arg[13]))
|
||||
{
|
||||
EMSG2(_(e_readonlyvar), arg);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get an lval: variable, Dict item or List item that can be assigned a value
|
||||
* to: "name", "na{me}", "name[expr]", "name[expr:expr]", "name[expr][expr]",
|
||||
@@ -2208,32 +2188,29 @@ set_var_lval(
|
||||
|
||||
if (lp->ll_tv == NULL)
|
||||
{
|
||||
if (!check_changedtick(lp->ll_name))
|
||||
cc = *endp;
|
||||
*endp = NUL;
|
||||
if (op != NULL && *op != '=')
|
||||
{
|
||||
cc = *endp;
|
||||
*endp = NUL;
|
||||
if (op != NULL && *op != '=')
|
||||
{
|
||||
typval_T tv;
|
||||
typval_T tv;
|
||||
|
||||
/* handle +=, -= and .= */
|
||||
di = NULL;
|
||||
if (get_var_tv(lp->ll_name, (int)STRLEN(lp->ll_name),
|
||||
&tv, &di, TRUE, FALSE) == OK)
|
||||
{
|
||||
if ((di == NULL
|
||||
|| (!var_check_ro(di->di_flags, lp->ll_name, FALSE)
|
||||
&& !tv_check_lock(di->di_tv.v_lock, lp->ll_name,
|
||||
FALSE)))
|
||||
&& tv_op(&tv, rettv, op) == OK)
|
||||
set_var(lp->ll_name, &tv, FALSE);
|
||||
clear_tv(&tv);
|
||||
}
|
||||
/* handle +=, -= and .= */
|
||||
di = NULL;
|
||||
if (get_var_tv(lp->ll_name, (int)STRLEN(lp->ll_name),
|
||||
&tv, &di, TRUE, FALSE) == OK)
|
||||
{
|
||||
if ((di == NULL
|
||||
|| (!var_check_ro(di->di_flags, lp->ll_name, FALSE)
|
||||
&& !tv_check_lock(di->di_tv.v_lock, lp->ll_name,
|
||||
FALSE)))
|
||||
&& tv_op(&tv, rettv, op) == OK)
|
||||
set_var(lp->ll_name, &tv, FALSE);
|
||||
clear_tv(&tv);
|
||||
}
|
||||
else
|
||||
set_var(lp->ll_name, rettv, copy);
|
||||
*endp = cc;
|
||||
}
|
||||
else
|
||||
set_var(lp->ll_name, rettv, copy);
|
||||
*endp = cc;
|
||||
}
|
||||
else if (tv_check_lock(lp->ll_newkey == NULL
|
||||
? lp->ll_tv->v_lock
|
||||
@@ -2776,9 +2753,7 @@ do_unlet_var(
|
||||
*name_end = NUL;
|
||||
|
||||
/* Normal name or expanded name. */
|
||||
if (check_changedtick(lp->ll_name))
|
||||
ret = FAIL;
|
||||
else if (do_unlet(lp->ll_name, forceit) == FAIL)
|
||||
if (do_unlet(lp->ll_name, forceit) == FAIL)
|
||||
ret = FAIL;
|
||||
*name_end = cc;
|
||||
}
|
||||
@@ -2904,21 +2879,16 @@ do_lock_var(
|
||||
*name_end = NUL;
|
||||
|
||||
/* Normal name or expanded name. */
|
||||
if (check_changedtick(lp->ll_name))
|
||||
di = find_var(lp->ll_name, NULL, TRUE);
|
||||
if (di == NULL)
|
||||
ret = FAIL;
|
||||
else
|
||||
{
|
||||
di = find_var(lp->ll_name, NULL, TRUE);
|
||||
if (di == NULL)
|
||||
ret = FAIL;
|
||||
if (lock)
|
||||
di->di_flags |= DI_FLAGS_LOCK;
|
||||
else
|
||||
{
|
||||
if (lock)
|
||||
di->di_flags |= DI_FLAGS_LOCK;
|
||||
else
|
||||
di->di_flags &= ~DI_FLAGS_LOCK;
|
||||
item_lock(&di->di_tv, deep, lock);
|
||||
}
|
||||
di->di_flags &= ~DI_FLAGS_LOCK;
|
||||
item_lock(&di->di_tv, deep, lock);
|
||||
}
|
||||
*name_end = cc;
|
||||
}
|
||||
@@ -3139,11 +3109,6 @@ get_user_var_name(expand_T *xp, int idx)
|
||||
++hi;
|
||||
return cat_prefix_varname('b', hi->hi_key);
|
||||
}
|
||||
if (bdone == ht->ht_used)
|
||||
{
|
||||
++bdone;
|
||||
return (char_u *)"b:changedtick";
|
||||
}
|
||||
|
||||
/* w: variables */
|
||||
ht = &curwin->w_vars->dv_hashtab;
|
||||
@@ -6815,7 +6780,6 @@ get_var_tv(
|
||||
{
|
||||
int ret = OK;
|
||||
typval_T *tv = NULL;
|
||||
typval_T atv;
|
||||
dictitem_T *v;
|
||||
int cc;
|
||||
|
||||
@@ -6823,28 +6787,15 @@ get_var_tv(
|
||||
cc = name[len];
|
||||
name[len] = NUL;
|
||||
|
||||
/*
|
||||
* Check for "b:changedtick".
|
||||
*/
|
||||
if (STRCMP(name, "b:changedtick") == 0)
|
||||
{
|
||||
atv.v_type = VAR_NUMBER;
|
||||
atv.vval.v_number = curbuf->b_changedtick;
|
||||
tv = &atv;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for user-defined variables.
|
||||
*/
|
||||
else
|
||||
v = find_var(name, NULL, no_autoload);
|
||||
if (v != NULL)
|
||||
{
|
||||
v = find_var(name, NULL, no_autoload);
|
||||
if (v != NULL)
|
||||
{
|
||||
tv = &v->di_tv;
|
||||
if (dip != NULL)
|
||||
*dip = v;
|
||||
}
|
||||
tv = &v->di_tv;
|
||||
if (dip != NULL)
|
||||
*dip = v;
|
||||
}
|
||||
|
||||
if (tv == NULL)
|
||||
|
||||
@@ -2539,7 +2539,7 @@ f_diff_hlID(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
#ifdef FEAT_DIFF
|
||||
linenr_T lnum = get_tv_lnum(argvars);
|
||||
static linenr_T prev_lnum = 0;
|
||||
static int changedtick = 0;
|
||||
static varnumber_T changedtick = 0;
|
||||
static int fnum = 0;
|
||||
static int change_start = 0;
|
||||
static int change_end = 0;
|
||||
@@ -2550,7 +2550,7 @@ f_diff_hlID(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
if (lnum < 0) /* ignore type error in {lnum} arg */
|
||||
lnum = 0;
|
||||
if (lnum != prev_lnum
|
||||
|| changedtick != curbuf->b_changedtick
|
||||
|| changedtick != *curbuf->b_changedtick
|
||||
|| fnum != curbuf->b_fnum)
|
||||
{
|
||||
/* New line, buffer, change: need to get the values. */
|
||||
@@ -2572,7 +2572,7 @@ f_diff_hlID(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
else
|
||||
hlID = (hlf_T)0;
|
||||
prev_lnum = lnum;
|
||||
changedtick = curbuf->b_changedtick;
|
||||
changedtick = *curbuf->b_changedtick;
|
||||
fnum = curbuf->b_fnum;
|
||||
}
|
||||
|
||||
@@ -3957,7 +3957,7 @@ get_buffer_info(buf_T *buf)
|
||||
dict_add_nr_str(dict, "loaded", buf->b_ml.ml_mfp != NULL, NULL);
|
||||
dict_add_nr_str(dict, "listed", buf->b_p_bl, NULL);
|
||||
dict_add_nr_str(dict, "changed", bufIsChanged(buf), NULL);
|
||||
dict_add_nr_str(dict, "changedtick", buf->b_changedtick, NULL);
|
||||
dict_add_nr_str(dict, "changedtick", *buf->b_changedtick, NULL);
|
||||
dict_add_nr_str(dict, "hidden",
|
||||
buf->b_ml.ml_mfp != NULL && buf->b_nwindows == 0,
|
||||
NULL);
|
||||
@@ -4190,12 +4190,6 @@ f_getbufvar(typval_T *argvars, typval_T *rettv)
|
||||
/* buffer-local-option */
|
||||
done = TRUE;
|
||||
}
|
||||
else if (STRCMP(varname, "changedtick") == 0)
|
||||
{
|
||||
rettv->v_type = VAR_NUMBER;
|
||||
rettv->vval.v_number = curbuf->b_changedtick;
|
||||
done = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Look up the variable. */
|
||||
@@ -6576,21 +6570,16 @@ f_islocked(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
if (lv.ll_tv == NULL)
|
||||
{
|
||||
if (check_changedtick(lv.ll_name))
|
||||
rettv->vval.v_number = 1; /* always locked */
|
||||
else
|
||||
di = find_var(lv.ll_name, NULL, TRUE);
|
||||
if (di != NULL)
|
||||
{
|
||||
di = find_var(lv.ll_name, NULL, TRUE);
|
||||
if (di != NULL)
|
||||
{
|
||||
/* Consider a variable locked when:
|
||||
* 1. the variable itself is locked
|
||||
* 2. the value of the variable is locked.
|
||||
* 3. the List or Dict value is locked.
|
||||
*/
|
||||
rettv->vval.v_number = ((di->di_flags & DI_FLAGS_LOCK)
|
||||
|| tv_islocked(&di->di_tv));
|
||||
}
|
||||
/* Consider a variable locked when:
|
||||
* 1. the variable itself is locked
|
||||
* 2. the value of the variable is locked.
|
||||
* 3. the List or Dict value is locked.
|
||||
*/
|
||||
rettv->vval.v_number = ((di->di_flags & DI_FLAGS_LOCK)
|
||||
|| tv_islocked(&di->di_tv));
|
||||
}
|
||||
}
|
||||
else if (lv.ll_range)
|
||||
@@ -11551,8 +11540,8 @@ f_submatch(typval_T *argvars, typval_T *rettv)
|
||||
return;
|
||||
if (no < 0 || no >= NSUBEXP)
|
||||
{
|
||||
EMSGN(_("E935: invalid submatch number: %d"), no);
|
||||
return;
|
||||
EMSGN(_("E935: invalid submatch number: %d"), no);
|
||||
return;
|
||||
}
|
||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
||||
retList = (int)get_tv_number_chk(&argvars[1], &error);
|
||||
|
||||
@@ -626,7 +626,7 @@ do_exmode(
|
||||
int save_msg_scroll;
|
||||
int prev_msg_row;
|
||||
linenr_T prev_line;
|
||||
int changedtick;
|
||||
varnumber_T changedtick;
|
||||
|
||||
if (improved)
|
||||
exmode_active = EXMODE_VIM;
|
||||
@@ -660,7 +660,7 @@ do_exmode(
|
||||
need_wait_return = FALSE;
|
||||
ex_pressedreturn = FALSE;
|
||||
ex_no_reprint = FALSE;
|
||||
changedtick = curbuf->b_changedtick;
|
||||
changedtick = *curbuf->b_changedtick;
|
||||
prev_msg_row = msg_row;
|
||||
prev_line = curwin->w_cursor.lnum;
|
||||
if (improved)
|
||||
@@ -673,7 +673,7 @@ do_exmode(
|
||||
lines_left = Rows - 1;
|
||||
|
||||
if ((prev_line != curwin->w_cursor.lnum
|
||||
|| changedtick != curbuf->b_changedtick) && !ex_no_reprint)
|
||||
|| changedtick != *curbuf->b_changedtick) && !ex_no_reprint)
|
||||
{
|
||||
if (curbuf->b_ml.ml_flags & ML_EMPTY)
|
||||
EMSG(_(e_emptybuf));
|
||||
|
||||
@@ -4926,9 +4926,9 @@ restore_backup:
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* buf->b_changedtick is always incremented in unchanged() but that
|
||||
* should not trigger a TextChanged event. */
|
||||
if (last_changedtick + 1 == buf->b_changedtick
|
||||
if (last_changedtick + 1 == *buf->b_changedtick
|
||||
&& last_changedtick_buf == buf)
|
||||
last_changedtick = buf->b_changedtick;
|
||||
last_changedtick = *buf->b_changedtick;
|
||||
#endif
|
||||
u_unchanged(buf);
|
||||
u_update_save_nr(buf);
|
||||
|
||||
@@ -1088,7 +1088,7 @@ EXTERN pos_T last_cursormoved /* for CursorMoved event */
|
||||
= INIT_POS_T(0, 0, 0)
|
||||
# endif
|
||||
;
|
||||
EXTERN int last_changedtick INIT(= 0); /* for TextChanged event */
|
||||
EXTERN varnumber_T last_changedtick INIT(= 0); /* for TextChanged event */
|
||||
EXTERN buf_T *last_changedtick_buf INIT(= NULL);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1164,13 +1164,13 @@ main_loop(
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* Trigger TextChanged if b_changedtick differs. */
|
||||
if (!finish_op && has_textchanged()
|
||||
&& last_changedtick != curbuf->b_changedtick)
|
||||
&& last_changedtick != *curbuf->b_changedtick)
|
||||
{
|
||||
if (last_changedtick_buf == curbuf)
|
||||
apply_autocmds(EVENT_TEXTCHANGED, NULL, NULL,
|
||||
FALSE, curbuf);
|
||||
last_changedtick_buf = curbuf;
|
||||
last_changedtick = curbuf->b_changedtick;
|
||||
last_changedtick = *curbuf->b_changedtick;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1388,11 +1388,11 @@ getout(int exitval)
|
||||
/* Autocmd must have close the buffer already, skip. */
|
||||
continue;
|
||||
buf = wp->w_buffer;
|
||||
if (buf->b_changedtick != -1)
|
||||
if (buf->b_ct_val != -1)
|
||||
{
|
||||
apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname,
|
||||
buf->b_fname, FALSE, buf);
|
||||
buf->b_changedtick = -1; /* note that we did it already */
|
||||
buf->b_ct_val = -1; /* note that we did it already */
|
||||
/* start all over, autocommands may mess up the lists */
|
||||
next_tp = first_tabpage;
|
||||
break;
|
||||
|
||||
@@ -1148,11 +1148,11 @@ ml_recover(void)
|
||||
len = (int)STRLEN(fname);
|
||||
if (len >= 4 &&
|
||||
#if defined(VMS)
|
||||
STRNICMP(fname + len - 4, "_s" , 2)
|
||||
STRNICMP(fname + len - 4, "_s", 2)
|
||||
#else
|
||||
STRNICMP(fname + len - 4, ".s" , 2)
|
||||
STRNICMP(fname + len - 4, ".s", 2)
|
||||
#endif
|
||||
== 0
|
||||
== 0
|
||||
&& vim_strchr((char_u *)"UVWuvw", fname[len - 2]) != NULL
|
||||
&& ASCII_ISALPHA(fname[len - 1]))
|
||||
{
|
||||
@@ -1649,7 +1649,7 @@ ml_recover(void)
|
||||
if (!(curbuf->b_ml.ml_line_count == 2 && *ml_get(1) == NUL))
|
||||
{
|
||||
changed_int();
|
||||
++curbuf->b_changedtick;
|
||||
++*curbuf->b_changedtick;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1663,7 +1663,7 @@ ml_recover(void)
|
||||
if (i != 0)
|
||||
{
|
||||
changed_int();
|
||||
++curbuf->b_changedtick;
|
||||
++*curbuf->b_changedtick;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1863,8 +1863,10 @@ recover_names(
|
||||
else
|
||||
{
|
||||
#if defined(UNIX) || defined(WIN3264)
|
||||
p = dir_name + STRLEN(dir_name);
|
||||
if (after_pathsep(dir_name, p) && p[-1] == p[-2])
|
||||
int len = STRLEN(dir_name);
|
||||
|
||||
p = dir_name + len;
|
||||
if (after_pathsep(dir_name, p) && len > 1 && p[-1] == p[-2])
|
||||
{
|
||||
/* Ends with '//', Use Full path for swap name */
|
||||
tail = make_percent_swname(dir_name, fname_res);
|
||||
@@ -3922,8 +3924,10 @@ makeswapname(
|
||||
#endif
|
||||
|
||||
#if defined(UNIX) || defined(WIN3264) /* Need _very_ long file names */
|
||||
s = dir_name + STRLEN(dir_name);
|
||||
if (after_pathsep(dir_name, s) && s[-1] == s[-2])
|
||||
int len = STRLEN(dir_name);
|
||||
|
||||
s = dir_name + len;
|
||||
if (after_pathsep(dir_name, s) && len > 1 && s[-1] == s[-2])
|
||||
{ /* Ends with '//', Use Full path */
|
||||
r = NULL;
|
||||
if ((s = make_percent_swname(dir_name, fname)) != NULL)
|
||||
|
||||
10
src/misc1.c
10
src/misc1.c
@@ -492,7 +492,7 @@ get_breakindent_win(
|
||||
static int prev_indent = 0; /* cached indent value */
|
||||
static long prev_ts = 0L; /* cached tabstop value */
|
||||
static char_u *prev_line = NULL; /* cached pointer to line */
|
||||
static int prev_tick = 0; /* changedtick of cached value */
|
||||
static varnumber_T prev_tick = 0; /* changedtick of cached value */
|
||||
int bri = 0;
|
||||
/* window width minus window margin space, i.e. what rests for text */
|
||||
const int eff_wwidth = W_WIDTH(wp)
|
||||
@@ -502,11 +502,11 @@ get_breakindent_win(
|
||||
|
||||
/* used cached indent, unless pointer or 'tabstop' changed */
|
||||
if (prev_line != line || prev_ts != wp->w_buffer->b_p_ts
|
||||
|| prev_tick != wp->w_buffer->b_changedtick)
|
||||
|| prev_tick != *wp->w_buffer->b_changedtick)
|
||||
{
|
||||
prev_line = line;
|
||||
prev_ts = wp->w_buffer->b_p_ts;
|
||||
prev_tick = wp->w_buffer->b_changedtick;
|
||||
prev_tick = *wp->w_buffer->b_changedtick;
|
||||
prev_indent = get_indent_str(line,
|
||||
(int)wp->w_buffer->b_p_ts, wp->w_p_list);
|
||||
}
|
||||
@@ -2768,7 +2768,7 @@ changed(void)
|
||||
}
|
||||
changed_int();
|
||||
}
|
||||
++curbuf->b_changedtick;
|
||||
++*curbuf->b_changedtick;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3195,7 +3195,7 @@ unchanged(
|
||||
need_maketitle = TRUE; /* set window title later */
|
||||
#endif
|
||||
}
|
||||
++buf->b_changedtick;
|
||||
++*buf->b_changedtick;
|
||||
#ifdef FEAT_NETBEANS_INTG
|
||||
netbeans_unmodified(buf);
|
||||
#endif
|
||||
|
||||
@@ -7017,7 +7017,7 @@ did_set_string_option(
|
||||
/* skip optional filename after 'k' and 's' */
|
||||
while (*s && *s != ',' && *s != ' ')
|
||||
{
|
||||
if (*s == '\\')
|
||||
if (*s == '\\' && s[1] != NUL)
|
||||
++s;
|
||||
++s;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ void *call_func_retlist(char_u *func, int argc, char_u **argv, int safe);
|
||||
int eval_foldexpr(char_u *arg, int *cp);
|
||||
void ex_let(exarg_T *eap);
|
||||
void list_hashtable_vars(hashtab_T *ht, char_u *prefix, int empty, int *first);
|
||||
int check_changedtick(char_u *arg);
|
||||
char_u *get_lval(char_u *name, typval_T *rettv, lval_T *lp, int unlet, int skip, int flags, int fne_flags);
|
||||
void clear_lval(lval_T *lp);
|
||||
void *eval_for_line(char_u *arg, int *errp, char_u **nextcmdp, int skip);
|
||||
|
||||
@@ -4357,6 +4357,10 @@ current_quote(
|
||||
/* Correct cursor when 'selection' is exclusive */
|
||||
if (VIsual_active)
|
||||
{
|
||||
/* this only works within one line */
|
||||
if (VIsual.lnum != curwin->w_cursor.lnum)
|
||||
return FALSE;
|
||||
|
||||
vis_bef_curs = lt(VIsual, curwin->w_cursor);
|
||||
if (*p_sel == 'e' && vis_bef_curs)
|
||||
dec_cursor();
|
||||
|
||||
@@ -1916,7 +1916,9 @@ struct file_buffer
|
||||
|
||||
int b_changed; /* 'modified': Set to TRUE if something in the
|
||||
file has been changed and not written out. */
|
||||
int b_changedtick; /* incremented for each change, also for undo */
|
||||
varnumber_T *b_changedtick; /* points into b:changedtick or b_ct_val;
|
||||
incremented for each change, also for undo */
|
||||
varnumber_T b_ct_val; /* fallback for b:changedtick */
|
||||
|
||||
int b_saving; /* Set to TRUE if we are in the middle of
|
||||
saving the buffer. */
|
||||
|
||||
@@ -503,7 +503,7 @@ syntax_start(win_T *wp, linenr_T lnum)
|
||||
linenr_T parsed_lnum;
|
||||
linenr_T first_stored;
|
||||
int dist;
|
||||
static int changedtick = 0; /* remember the last change ID */
|
||||
static varnumber_T changedtick = 0; /* remember the last change ID */
|
||||
|
||||
#ifdef FEAT_CONCEAL
|
||||
current_sub_char = NUL;
|
||||
@@ -516,13 +516,13 @@ syntax_start(win_T *wp, linenr_T lnum)
|
||||
*/
|
||||
if (syn_block != wp->w_s
|
||||
|| syn_buf != wp->w_buffer
|
||||
|| changedtick != syn_buf->b_changedtick)
|
||||
|| changedtick != *syn_buf->b_changedtick)
|
||||
{
|
||||
invalidate_current_state();
|
||||
syn_buf = wp->w_buffer;
|
||||
syn_block = wp->w_s;
|
||||
}
|
||||
changedtick = syn_buf->b_changedtick;
|
||||
changedtick = *syn_buf->b_changedtick;
|
||||
syn_win = wp;
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Tests for getbufvar(), getwinvar(), gettabvar() and gettabwinvar().
|
||||
Tests for getwinvar(), gettabvar() and gettabwinvar().
|
||||
vim: set ft=vim :
|
||||
|
||||
STARTTEST
|
||||
@@ -10,34 +10,7 @@ STARTTEST
|
||||
:let t:testvar='abcd'
|
||||
:$put =string(gettabvar(1,'testvar'))
|
||||
:$put =string(gettabvar(1,'testvar'))
|
||||
:" Test for getbufvar()
|
||||
:let b:var_num = '1234'
|
||||
:let def_num = '5678'
|
||||
:$put =string(getbufvar(1, 'var_num'))
|
||||
:$put =string(getbufvar(1, 'var_num', def_num))
|
||||
:$put =string(getbufvar(1, ''))
|
||||
:$put =string(getbufvar(1, '', def_num))
|
||||
:unlet b:var_num
|
||||
:$put =string(getbufvar(1, 'var_num', def_num))
|
||||
:$put =string(getbufvar(1, ''))
|
||||
:$put =string(getbufvar(1, '', def_num))
|
||||
:$put =string(getbufvar(9, ''))
|
||||
:$put =string(getbufvar(9, '', def_num))
|
||||
:unlet def_num
|
||||
:$put =string(getbufvar(1, '&autoindent'))
|
||||
:$put =string(getbufvar(1, '&autoindent', 1))
|
||||
:"
|
||||
:" Open new window with forced option values
|
||||
:set fileformats=unix,dos
|
||||
:new ++ff=dos ++bin ++enc=iso-8859-2
|
||||
:let otherff = getbufvar(bufnr('%'), '&fileformat')
|
||||
:let otherbin = getbufvar(bufnr('%'), '&bin')
|
||||
:let otherfenc = getbufvar(bufnr('%'), '&fenc')
|
||||
:close
|
||||
:$put =otherff
|
||||
:$put =string(otherbin)
|
||||
:$put =otherfenc
|
||||
:unlet otherff otherbin otherfenc
|
||||
:" test for getwinvar()
|
||||
:let w:var_str = "Dance"
|
||||
:let def_str = "Chance"
|
||||
|
||||
@@ -1,20 +1,6 @@
|
||||
start:
|
||||
'abcd'
|
||||
'abcd'
|
||||
'1234'
|
||||
'1234'
|
||||
{'var_num': '1234'}
|
||||
{'var_num': '1234'}
|
||||
'5678'
|
||||
{}
|
||||
{}
|
||||
''
|
||||
'5678'
|
||||
0
|
||||
0
|
||||
dos
|
||||
1
|
||||
iso-8859-2
|
||||
'Dance'
|
||||
'Dance'
|
||||
{'var_str': 'Dance'}
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
|
||||
source test_assign.vim
|
||||
source test_autocmd.vim
|
||||
source test_changedtick.vim
|
||||
source test_cursor_func.vim
|
||||
source test_delete.vim
|
||||
source test_execute_func.vim
|
||||
source test_ex_undo.vim
|
||||
source test_execute_func.vim
|
||||
source test_expand.vim
|
||||
source test_expr.vim
|
||||
source test_expand_dllpath.vim
|
||||
@@ -33,6 +34,7 @@ source test_messages.vim
|
||||
source test_partial.vim
|
||||
source test_popup.vim
|
||||
source test_put.vim
|
||||
source test_recover.vim
|
||||
source test_reltime.vim
|
||||
source test_searchpos.vim
|
||||
source test_set.vim
|
||||
|
||||
45
src/testdir/test_changedtick.vim
Normal file
45
src/testdir/test_changedtick.vim
Normal file
@@ -0,0 +1,45 @@
|
||||
" Tests for b:changedtick
|
||||
|
||||
func Test_changedtick_increments()
|
||||
new
|
||||
" New buffer has an empty line, tick starts at 2.
|
||||
let expected = 2
|
||||
call assert_equal(expected, b:changedtick)
|
||||
call assert_equal(expected, b:['changedtick'])
|
||||
call setline(1, 'hello')
|
||||
let expected += 1
|
||||
call assert_equal(expected, b:changedtick)
|
||||
call assert_equal(expected, b:['changedtick'])
|
||||
undo
|
||||
" Somehow undo counts as two changes.
|
||||
let expected += 2
|
||||
call assert_equal(expected, b:changedtick)
|
||||
call assert_equal(expected, b:['changedtick'])
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_changedtick_dict_entry()
|
||||
let d = b:
|
||||
call assert_equal(b:changedtick, d['changedtick'])
|
||||
endfunc
|
||||
|
||||
func Test_changedtick_bdel()
|
||||
new
|
||||
let bnr = bufnr('%')
|
||||
let v = b:changedtick
|
||||
bdel
|
||||
" Delete counts as a change too.
|
||||
call assert_equal(v + 1, getbufvar(bnr, 'changedtick'))
|
||||
endfunc
|
||||
|
||||
func Test_changedtick_fixed()
|
||||
call assert_fails('let b:changedtick = 4', 'E46')
|
||||
call assert_fails('let b:["changedtick"] = 4', 'E46')
|
||||
|
||||
call assert_fails('unlet b:changedtick', 'E795')
|
||||
call assert_fails('unlet b:["changedtick"]', 'E46')
|
||||
|
||||
let d = b:
|
||||
call assert_fails('unlet d["changedtick"]', 'E46')
|
||||
|
||||
endfunc
|
||||
@@ -424,3 +424,45 @@ func! Test_mode()
|
||||
bwipe!
|
||||
iunmap <F2>
|
||||
endfunc
|
||||
|
||||
func Test_getbufvar()
|
||||
let bnr = bufnr('%')
|
||||
let b:var_num = '1234'
|
||||
let def_num = '5678'
|
||||
call assert_equal('1234', getbufvar(bnr, 'var_num'))
|
||||
call assert_equal('1234', getbufvar(bnr, 'var_num', def_num))
|
||||
|
||||
let bd = getbufvar(bnr, '')
|
||||
call assert_equal('1234', bd['var_num'])
|
||||
call assert_true(exists("bd['changedtick']"))
|
||||
call assert_equal(2, len(bd))
|
||||
|
||||
let bd2 = getbufvar(bnr, '', def_num)
|
||||
call assert_equal(bd, bd2)
|
||||
|
||||
unlet b:var_num
|
||||
call assert_equal(def_num, getbufvar(bnr, 'var_num', def_num))
|
||||
call assert_equal('', getbufvar(bnr, 'var_num'))
|
||||
|
||||
let bd = getbufvar(bnr, '')
|
||||
call assert_equal(1, len(bd))
|
||||
let bd = getbufvar(bnr, '',def_num)
|
||||
call assert_equal(1, len(bd))
|
||||
|
||||
call assert_equal('', getbufvar(9, ''))
|
||||
call assert_equal(def_num, getbufvar(9, '', def_num))
|
||||
unlet def_num
|
||||
|
||||
call assert_equal(0, getbufvar(bnr, '&autoindent'))
|
||||
call assert_equal(0, getbufvar(bnr, '&autoindent', 1))
|
||||
|
||||
" Open new window with forced option values
|
||||
set fileformats=unix,dos
|
||||
new ++ff=dos ++bin ++enc=iso-8859-2
|
||||
call assert_equal('dos', getbufvar(bufnr('%'), '&fileformat'))
|
||||
call assert_equal(1, getbufvar(bufnr('%'), '&bin'))
|
||||
call assert_equal('iso-8859-2', getbufvar(bufnr('%'), '&fenc'))
|
||||
close
|
||||
|
||||
set fileformats&
|
||||
endfunc
|
||||
|
||||
@@ -136,6 +136,15 @@ func Test_thesaurus()
|
||||
call Check_dir_option('thesaurus')
|
||||
endfun
|
||||
|
||||
func Test_complete()
|
||||
" Trailing single backslash used to cause invalid memory access.
|
||||
set complete=s\
|
||||
new
|
||||
call feedkeys("i\<C-N>\<Esc>", 'xt')
|
||||
bwipe!
|
||||
set complete&
|
||||
endfun
|
||||
|
||||
func Test_set_completion()
|
||||
call feedkeys(":set di\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"set dictionary diff diffexpr diffopt digraph directory display', @:)
|
||||
|
||||
@@ -531,4 +531,24 @@ func Test_completion_respect_bs_option()
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
func CompleteUndo() abort
|
||||
call complete(1, g:months)
|
||||
return ''
|
||||
endfunc
|
||||
|
||||
func Test_completion_can_undo()
|
||||
inoremap <Right> <c-r>=CompleteUndo()<cr>
|
||||
set completeopt+=noinsert,noselect
|
||||
|
||||
new
|
||||
call feedkeys("a\<Right>a\<Esc>", 'xt')
|
||||
call assert_equal('a', getline(1))
|
||||
undo
|
||||
call assert_equal('', getline(1))
|
||||
|
||||
bwipe!
|
||||
set completeopt&
|
||||
iunmap <Right>
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
18
src/testdir/test_recover.vim
Normal file
18
src/testdir/test_recover.vim
Normal file
@@ -0,0 +1,18 @@
|
||||
" Test :recover
|
||||
|
||||
func Test_recover_root_dir()
|
||||
" This used to access invalid memory.
|
||||
split Xtest
|
||||
set dir=/
|
||||
call assert_fails('recover', 'E305:')
|
||||
close!
|
||||
|
||||
if has('win32')
|
||||
" can write in / directory on MS-Windows
|
||||
set dir=/notexist/
|
||||
endif
|
||||
call assert_fails('split Xtest', 'E303:')
|
||||
set dir&
|
||||
endfunc
|
||||
|
||||
" TODO: move recover tests from test78.in to here.
|
||||
@@ -39,3 +39,70 @@ function! Test_multiline_subst()
|
||||
call assert_equal('xxxxx', getline(13))
|
||||
enew!
|
||||
endfunction
|
||||
|
||||
function! Test_substitute_variants()
|
||||
" Validate that all the 2-/3-letter variants which embed the flags into the
|
||||
" command name actually work.
|
||||
enew!
|
||||
let ln = 'Testing string'
|
||||
let variants = [
|
||||
\ { 'cmd': ':s/Test/test/c', 'exp': 'testing string', 'prompt': 'y' },
|
||||
\ { 'cmd': ':s/foo/bar/ce', 'exp': ln },
|
||||
\ { 'cmd': ':s/t/r/cg', 'exp': 'Tesring srring', 'prompt': 'a' },
|
||||
\ { 'cmd': ':s/t/r/ci', 'exp': 'resting string', 'prompt': 'y' },
|
||||
\ { 'cmd': ':s/t/r/cI', 'exp': 'Tesring string', 'prompt': 'y' },
|
||||
\ { 'cmd': ':s/t/r/cn', 'exp': ln },
|
||||
\ { 'cmd': ':s/t/r/cp', 'exp': 'Tesring string', 'prompt': 'y' },
|
||||
\ { 'cmd': ':s/t/r/cl', 'exp': 'Tesring string', 'prompt': 'y' },
|
||||
\ { 'cmd': ':s/t/r/gc', 'exp': 'Tesring srring', 'prompt': 'a' },
|
||||
\ { 'cmd': ':s/foo/bar/ge', 'exp': ln },
|
||||
\ { 'cmd': ':s/t/r/g', 'exp': 'Tesring srring' },
|
||||
\ { 'cmd': ':s/t/r/gi', 'exp': 'resring srring' },
|
||||
\ { 'cmd': ':s/t/r/gI', 'exp': 'Tesring srring' },
|
||||
\ { 'cmd': ':s/t/r/gn', 'exp': ln },
|
||||
\ { 'cmd': ':s/t/r/gp', 'exp': 'Tesring srring' },
|
||||
\ { 'cmd': ':s/t/r/gl', 'exp': 'Tesring srring' },
|
||||
\ { 'cmd': ':s//r/gr', 'exp': 'Testr strr' },
|
||||
\ { 'cmd': ':s/t/r/ic', 'exp': 'resting string', 'prompt': 'y' },
|
||||
\ { 'cmd': ':s/foo/bar/ie', 'exp': ln },
|
||||
\ { 'cmd': ':s/t/r/i', 'exp': 'resting string' },
|
||||
\ { 'cmd': ':s/t/r/iI', 'exp': 'Tesring string' },
|
||||
\ { 'cmd': ':s/t/r/in', 'exp': ln },
|
||||
\ { 'cmd': ':s/t/r/ip', 'exp': 'resting string' },
|
||||
\ { 'cmd': ':s//r/ir', 'exp': 'Testr string' },
|
||||
\ { 'cmd': ':s/t/r/Ic', 'exp': 'Tesring string', 'prompt': 'y' },
|
||||
\ { 'cmd': ':s/foo/bar/Ie', 'exp': ln },
|
||||
\ { 'cmd': ':s/t/r/Ig', 'exp': 'Tesring srring' },
|
||||
\ { 'cmd': ':s/t/r/Ii', 'exp': 'resting string' },
|
||||
\ { 'cmd': ':s/t/r/I', 'exp': 'Tesring string' },
|
||||
\ { 'cmd': ':s/t/r/Ip', 'exp': 'Tesring string' },
|
||||
\ { 'cmd': ':s/t/r/Il', 'exp': 'Tesring string' },
|
||||
\ { 'cmd': ':s//r/Ir', 'exp': 'Testr string' },
|
||||
\ { 'cmd': ':s//r/rc', 'exp': 'Testr string', 'prompt': 'y' },
|
||||
\ { 'cmd': ':s//r/rg', 'exp': 'Testr strr' },
|
||||
\ { 'cmd': ':s//r/ri', 'exp': 'Testr string' },
|
||||
\ { 'cmd': ':s//r/rI', 'exp': 'Testr string' },
|
||||
\ { 'cmd': ':s//r/rn', 'exp': 'Testing string' },
|
||||
\ { 'cmd': ':s//r/rp', 'exp': 'Testr string' },
|
||||
\ { 'cmd': ':s//r/rl', 'exp': 'Testr string' },
|
||||
\ { 'cmd': ':s//r/r', 'exp': 'Testr string' },
|
||||
\]
|
||||
|
||||
for var in variants
|
||||
for run in [1, 2]
|
||||
let cmd = var.cmd
|
||||
if run == 2 && cmd =~ "/.*/.*/."
|
||||
" Change :s/from/to/{flags} to :s{flags}
|
||||
let cmd = substitute(cmd, '/.*/', '', '')
|
||||
endif
|
||||
call setline(1, [ln])
|
||||
let msg = printf('using "%s"', cmd)
|
||||
let @/='ing'
|
||||
let v:errmsg = ''
|
||||
call feedkeys(cmd . "\<CR>" . get(var, 'prompt', ''), 'ntx')
|
||||
" No error should exist (matters for testing e flag)
|
||||
call assert_equal('', v:errmsg, msg)
|
||||
call assert_equal(var.exp, getline('.'), msg)
|
||||
endfor
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
@@ -43,3 +43,10 @@ func Test_Visual_vapo()
|
||||
normal vapo
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_Visual_inner_quote()
|
||||
new
|
||||
normal oxX
|
||||
normal vki'
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
@@ -764,6 +764,24 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
341,
|
||||
/**/
|
||||
340,
|
||||
/**/
|
||||
339,
|
||||
/**/
|
||||
338,
|
||||
/**/
|
||||
337,
|
||||
/**/
|
||||
336,
|
||||
/**/
|
||||
335,
|
||||
/**/
|
||||
334,
|
||||
/**/
|
||||
333,
|
||||
/**/
|
||||
332,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user