mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Merge remote-tracking branch 'vim/master'
This commit is contained in:
@@ -9034,7 +9034,7 @@ taglist({expr} [, {filename}]) *taglist()*
|
||||
entry depends on the language specific
|
||||
kind values. Only available when
|
||||
using a tags file generated by
|
||||
Exuberant ctags or hdrtag.
|
||||
Universal/Exuberant ctags or hdrtag.
|
||||
static A file specific tag. Refer to
|
||||
|static-tag| for more information.
|
||||
More entries may be present, depending on the content of the
|
||||
|
||||
+13
-13
@@ -1,4 +1,4 @@
|
||||
*ft_ada.txt* For Vim version 8.2. Last change: 2010 Jul 20
|
||||
*ft_ada.txt* For Vim version 8.2. Last change: 2022 Mar 13
|
||||
|
||||
|
||||
ADA FILE TYPE PLUG-INS REFERENCE MANUAL~
|
||||
@@ -89,9 +89,9 @@ file is opened and adds Ada related entries to the main and pop-up menu.
|
||||
*ft-ada-omni*
|
||||
|
||||
The Ada omni-completions (|i_CTRL-X_CTRL-O|) uses tags database created either
|
||||
by "gnat xref -v" or the "exuberant Ctags (http://ctags.sourceforge.net). The
|
||||
complete function will automatically detect which tool was used to create the
|
||||
tags file.
|
||||
by "gnat xref -v" or the "Universal Ctags" (https://ctags.io). The complete
|
||||
function will automatically detect which tool was used to create the tags
|
||||
file.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
3.1 Omni Completion with "gnat xref" ~
|
||||
@@ -125,18 +125,18 @@ NOTE: "gnat xref -v" is very tricky to use as it has almost no diagnostic
|
||||
3.2 Omni Completion with "ctags"~
|
||||
*ada-ctags*
|
||||
|
||||
Exuberant Ctags uses its own multi-language code parser. The parser is quite
|
||||
fast, produces a lot of extra information (hence the name "Exuberant Ctags")
|
||||
and can run on files which currently do not compile.
|
||||
Universal/Exuberant Ctags use their own multi-language code parser. The
|
||||
parser is quite fast, produces a lot of extra information and can run on files
|
||||
which currently do not compile.
|
||||
|
||||
There are also lots of other Vim-tools which use exuberant Ctags.
|
||||
There are also lots of other Vim-tools which use Universal/Exuberant Ctags.
|
||||
Universal Ctags is preferred, Exuberant Ctags is no longer being developed.
|
||||
|
||||
You will need to install a version of the Exuberant Ctags which has Ada
|
||||
support patched in. Such a version is available from the GNU Ada Project
|
||||
(http://gnuada.sourceforge.net).
|
||||
You will need to install Universal Ctags which is available from
|
||||
https://ctags.io
|
||||
|
||||
The Ada parser for Exuberant Ctags is fairly new - don't expect complete
|
||||
support yet.
|
||||
The Ada parser for Universal/Exuberant Ctags is fairly new - don't expect
|
||||
complete support yet.
|
||||
|
||||
==============================================================================
|
||||
4. Compiler Support ~
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*gui_w32.txt* For Vim version 8.2. Last change: 2021 Oct 24
|
||||
*gui_w32.txt* For Vim version 8.2. Last change: 2022 Mar 09
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -236,7 +236,8 @@ The "* register reflects the contents of the clipboard. |quotestar|
|
||||
|
||||
When the "unnamed" string is included in the 'clipboard' option, the unnamed
|
||||
register is the same. Thus you can yank to and paste from the clipboard
|
||||
without prepending "* to commands.
|
||||
without prepending "* to commands. If this doesn't work use the "unnamedplus"
|
||||
string in the 'clipboard' option.
|
||||
|
||||
The 'a' flag in 'guioptions' is not included by default. This means that text
|
||||
is only put on the clipboard when an operation is performed on it. Just
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_perl.txt* For Vim version 8.2. Last change: 2022 Jan 28
|
||||
*if_perl.txt* For Vim version 8.2. Last change: 2022 Mar 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Sven Verdoolaege
|
||||
@@ -22,9 +22,9 @@ line of a file, regardless of the filename suffix, to check if a file is a
|
||||
Perl script (see scripts.vim in Vim's syntax directory). Vim assumes a file
|
||||
is POD text if the filename has a .POD suffix.
|
||||
|
||||
To use tags with Perl, you need a recent version of Exuberant ctags. Look
|
||||
here:
|
||||
http://ctags.sourceforge.net
|
||||
To use tags with Perl, you need Universal/Exuberant Ctags. Look here:
|
||||
Universal Ctags (preferred): https://ctags.io
|
||||
Exuberant Ctags: http://ctags.sourceforge.net
|
||||
|
||||
Alternatively, you can use the Perl script pltags.pl, which is shipped with
|
||||
Vim in the $VIMRUNTIME/tools directory. This script has currently more
|
||||
|
||||
+15
-7
@@ -1,4 +1,4 @@
|
||||
*insert.txt* For Vim version 8.2. Last change: 2022 Mar 06
|
||||
*insert.txt* For Vim version 8.2. Last change: 2022 Mar 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1409,11 +1409,16 @@ in 'runtimepath'. Thus for "java" it is autoload/javacomplete.vim.
|
||||
|
||||
C *ft-c-omni*
|
||||
|
||||
Completion of C code requires a tags file. You should use Exuberant ctags,
|
||||
because it adds extra information that is needed for completion. You can find
|
||||
it here: http://ctags.sourceforge.net/ Version 5.6 or later is recommended.
|
||||
Completion of C code requires a tags file. You should use Universal/
|
||||
Exuberant ctags, because it adds extra information that is needed for
|
||||
completion. You can find it here:
|
||||
Universal Ctags: https://ctags.io
|
||||
Exuberant Ctags: http://ctags.sourceforge.net
|
||||
|
||||
For version 5.5.4 you should add a patch that adds the "typename:" field:
|
||||
Universal Ctags is preferred, Exuberant Ctags is no longer being developed.
|
||||
|
||||
For Exuberant ctags, version 5.6 or later is recommended. For version 5.5.4
|
||||
you should add a patch that adds the "typename:" field:
|
||||
ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch
|
||||
A compiled .exe for MS-Windows can be found at:
|
||||
http://ctags.sourceforge.net/
|
||||
@@ -1534,8 +1539,11 @@ will be suggested. All other elements are not placed in suggestion list.
|
||||
PHP *ft-php-omni*
|
||||
|
||||
Completion of PHP code requires a tags file for completion of data from
|
||||
external files and for class aware completion. You should use Exuberant ctags
|
||||
version 5.5.4 or newer. You can find it here: http://ctags.sourceforge.net/
|
||||
external files and for class aware completion. You should use Universal/
|
||||
Exuberant ctags version 5.5.4 or newer. You can find it here:
|
||||
|
||||
Universal Ctags: https://ctags.io
|
||||
Exuberant Ctags: http://ctags.sourceforge.net
|
||||
|
||||
Script completes:
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.2. Last change: 2022 Feb 18
|
||||
*options.txt* For Vim version 8.2. Last change: 2022 Mar 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -7991,9 +7991,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
linear search can be avoided when case is ignored. Use a value of '2'
|
||||
in the "!_TAG_FILE_SORTED" line for this. A tag file can be case-fold
|
||||
sorted with the -f switch to "sort" in most unices, as in the command:
|
||||
"sort -f -o tags tags". For "Exuberant ctags" version 5.x or higher
|
||||
(at least 5.5) the --sort=foldcase switch can be used for this as
|
||||
well. Note that case must be folded to uppercase for this to work.
|
||||
"sort -f -o tags tags". For Universal ctags and Exuberant ctags
|
||||
version 5.x or higher (at least 5.5) the --sort=foldcase switch can be
|
||||
used for this as well. Note that case must be folded to uppercase for
|
||||
this to work.
|
||||
|
||||
By default, tag searches are case-sensitive. Case is ignored when
|
||||
'ignorecase' is set and 'tagcase' is "followic", or when 'tagcase' is
|
||||
|
||||
@@ -197,6 +197,12 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
:so[urce] {file} Read Ex commands from {file}. These are commands that
|
||||
start with a ":".
|
||||
Triggers the |SourcePre| autocommand.
|
||||
|
||||
:[range]so[urce] Read Ex commands from the [range] of lines in the
|
||||
current buffer. When sourcing commands from the
|
||||
current buffer, the same script-ID |<SID>| is used
|
||||
even if the buffer is sourced multiple times.
|
||||
|
||||
*:source!*
|
||||
:so[urce]! {file} Read Vim commands from {file}. These are commands
|
||||
that are executed from Normal mode, like you type
|
||||
|
||||
@@ -5553,11 +5553,12 @@ WARNING: The longer the tags file, the slower this will be, and the more
|
||||
memory Vim will consume.
|
||||
|
||||
Only highlighting typedefs, unions and structs can be done too. For this you
|
||||
must use Exuberant ctags (found at http://ctags.sf.net).
|
||||
must use Universal Ctags (found at https://ctags.io) or Exuberant ctags (found
|
||||
at http://ctags.sf.net).
|
||||
|
||||
Put these lines in your Makefile:
|
||||
|
||||
# Make a highlight file for types. Requires Exuberant ctags and awk
|
||||
# Make a highlight file for types. Requires Universal/Exuberant ctags and awk
|
||||
types: types.vim
|
||||
types.vim: *.[ch]
|
||||
ctags --c-kinds=gstu -o- *.[ch] |\
|
||||
|
||||
@@ -4308,6 +4308,7 @@ E1265 eval.txt /*E1265*
|
||||
E1266 if_pyth.txt /*E1266*
|
||||
E127 eval.txt /*E127*
|
||||
E1270 change.txt /*E1270*
|
||||
E1271 vim9.txt /*E1271*
|
||||
E128 eval.txt /*E128*
|
||||
E129 eval.txt /*E129*
|
||||
E13 message.txt /*E13*
|
||||
|
||||
@@ -561,7 +561,8 @@ also works. The <CR> and <NL> characters can never appear inside a line.
|
||||
|
||||
The second format is new. It includes additional information in optional
|
||||
fields at the end of each line. It is backwards compatible with Vi. It is
|
||||
only supported by new versions of ctags (such as Exuberant ctags).
|
||||
only supported by new versions of ctags (such as Universal ctags or Exuberant
|
||||
ctags).
|
||||
|
||||
{tagname} The identifier. Normally the name of a function, but it can
|
||||
be any identifier. It cannot contain a <Tab>.
|
||||
|
||||
+32
-62
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.2. Last change: 2022 Mar 08
|
||||
*todo.txt* For Vim version 8.2. Last change: 2022 Mar 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -38,27 +38,10 @@ browser use: https://github.com/vim/vim/issues/1234
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Allow for assigning v:null to job/channel/funcref etc.
|
||||
- Check that the declared type is not lost.
|
||||
- Check: var d: dict<func> = {a: function('tr'), b: null}
|
||||
|
||||
Fix that with s being an empty string, this returns TRUE:
|
||||
echo s is null_string
|
||||
|
||||
Make sure null types work to:
|
||||
- assign to a variable
|
||||
- use as an argument
|
||||
- use as default value of optional argument
|
||||
- use as return value
|
||||
- use in a list/dict constant, type is correct
|
||||
- revert comparing with null?
|
||||
|
||||
TODO item in eval.c
|
||||
|
||||
Really drop the Athena GUI? And NeXtaw?
|
||||
Really drop the Athena and NeXtaw GUI? Decide end of March.
|
||||
|
||||
Once Vim9 is stable:
|
||||
- Use Vim9 for runtime files.
|
||||
- Use Vim9 for more runtime files.
|
||||
- Check code coverage, add more tests if needed.
|
||||
vim9execute.c line 1900
|
||||
vim9expr.c
|
||||
@@ -123,7 +106,6 @@ Popup windows:
|
||||
- Should popup_getoptions() also return the mask? #7774
|
||||
- Add a way to use popup_menu() synchronously: instead of invoking the
|
||||
callback, return the choice. (Ben Jackson, #6534)
|
||||
- Use popup (or popup menu) for command line completion
|
||||
- When using a popup for the info of a completion menu, and there is not
|
||||
enough space, let the popup overlap with the menu. (#4544)
|
||||
- Implement flip option.
|
||||
@@ -2231,10 +2213,6 @@ Jan 7)
|
||||
|
||||
Problem with editing file in binary mode. (Ingo Krabbe, 2009 Oct 8)
|
||||
|
||||
With 'wildmode' set to "longest:full,full" and pressing Tab once the first
|
||||
entry in wildmenu is highlighted, that shouldn't happen. (Yuki Watanabe, 2011
|
||||
Feb 12)
|
||||
|
||||
Display error when 'tabline' that includes a file name with double-width
|
||||
characters. (2010 Aug 14, bootleq)
|
||||
|
||||
@@ -2437,10 +2415,6 @@ is executed.
|
||||
first line. (Ingo Karkat, 2008 Jul 1) Ian Kelling is working on this.
|
||||
Similar problem with ":e". (Marc Montu, 2014 Apr 22)
|
||||
|
||||
Wildmenu not deleted: "gvim -u NONE", ":set nocp wildmenu cmdheight=3
|
||||
laststatus=2", CTRL-D CTRL-H CTRL-H CTRL-H. (A.Politz, 2008 April 1)
|
||||
Works OK with Vim in an xterm.
|
||||
|
||||
Cursor line moves in other window when using CTRL-W J that doesn't change
|
||||
anything. (Dasn, 2009 Apr 7)
|
||||
|
||||
@@ -2473,10 +2447,6 @@ backslash? (Robert Vibrant, 2008 Jun 5)
|
||||
When 'rightleft' is set, cursorcolumn isn't highlighted after the end of a
|
||||
line. It's also wrong in folds. (Dominique Pelle, 2010 Aug 21)
|
||||
|
||||
After using <Tab> for command line completion after ":ta blah" and getting E33
|
||||
(no tags file), further editing the command to e.g., ":echo 'blah'", the
|
||||
command is not executed. Fix by Ian Kelling?
|
||||
|
||||
":help s/~" jumps to *s/\~*, while ":help s/\~" doesn't find anything. (Tim
|
||||
Chase) Fix by Ian Kelling, 2008 Jul 14.
|
||||
|
||||
@@ -2652,16 +2622,6 @@ This should avoid flicker. Other solution by A.Politz, 2007 Aug 22.
|
||||
When a register contains illegal bytes, writing viminfo in utf-8 and reading
|
||||
it back doesn't result in utf-8. (Devin Bayer)
|
||||
|
||||
Command line completion: Scanning for tags doesn't check for typed key now and
|
||||
then? Hangs for about 5 seconds. Appears to be caused by finding include
|
||||
files with "foo/**" in 'path'. (Kalisiak, 2006 July 15)
|
||||
Additional info: When using the |wildcards| ** globing, vim hangs
|
||||
indefinitely on lots of directories. The |file-searching| globing, like in
|
||||
":set path=/**" does not hang as often as with globing with |wildcards|, like
|
||||
in ":1find /**/file". This is for files that unix "find" can find very
|
||||
quickly. Merging the 2 kinds of globing might make this an easier fix. (Ian
|
||||
Kelling, 2008 July 4)
|
||||
|
||||
When the file name has parenthesis, e.g., "foo (bar).txt", ":!ls '%'" has the
|
||||
parenthesis escaped but not the space. That's inconsistent. Either escape
|
||||
neither or both. No escaping might be best, because it doesn't depend on
|
||||
@@ -2740,8 +2700,6 @@ Cursor displayed in the wrong position when using 'numberwidth'. (James Vega,
|
||||
When $VAR contains a backslash expand('$VAR') removes it. (Teemu Likonen, 2008
|
||||
Jun 18)
|
||||
|
||||
If the variable "g:x#y#z" exists completion after ":echo g:x#" doesn't work.
|
||||
|
||||
In debug mode, using CTRL-R = to evaluate a function causes stepping through
|
||||
the function. (Hari Krishna Dara, 2006 Jun 28)
|
||||
|
||||
@@ -2850,13 +2808,6 @@ reload it then?
|
||||
|
||||
For Aap: include a config.arg.example file with hints how to use config.arg.
|
||||
|
||||
Command line completion when 'cmdheight' is maximum and 'wildmenu' is set,
|
||||
only one buffer line displayed, causes display errors.
|
||||
|
||||
Completing with 'wildmenu' and using <Up> and <Down> to move through directory
|
||||
tree stops unexpectedly when using ":cd " and entering a directory that
|
||||
doesn't contain other directories.
|
||||
|
||||
Default for 'background' is wrong when using xterm with 256 colors.
|
||||
Table with estimates from Matteo Cavalleri, 2014 Jan 10.
|
||||
|
||||
@@ -3538,8 +3489,6 @@ Macintosh:
|
||||
8 When doing Insert mode completion a mapping cannot recursively call
|
||||
edit(), because the completion information is global. Put everything in
|
||||
an allocated structure?
|
||||
8 Command line completion: buffers "foo.txt" and "../b/foo.txt", completing
|
||||
":buf foo<Tab>" doesn't find the second one. (George V. Reilly)
|
||||
7 mb_off2cells() doesn't work correctly on the tail byte of a double-byte
|
||||
character. (Yasuhiro Matsumoto) It should return 1 when used on a tail
|
||||
byte, like for utf-8. Store second byte of double-byte in ScreenLines2[]
|
||||
@@ -4274,8 +4223,6 @@ Syntax highlighting:
|
||||
7 CTRL-] checks the highlight group for finding out what the tag is.
|
||||
7 Add an explanation how a list of words can be used to highlight misspelled
|
||||
words.
|
||||
8 Add more command line completion for :syntax.
|
||||
8 Add more command line completion for :highlight.
|
||||
7 Should find a better way to parse the :syntax and :highlight commands.
|
||||
Use tables or lists that can be shared by parsing for execution and
|
||||
completion?
|
||||
@@ -4333,12 +4280,6 @@ Vim script language:
|
||||
restore option values. Especially useful for new options. Problem: how
|
||||
to avoid a performance penalty (esp. for string options)?
|
||||
- range for ":exec", pass it on to the executed command. (Webb)
|
||||
8 ":{range}source": source the lines from the current file.
|
||||
You can already yank lines and use :@" to execute them.
|
||||
Most of do_source() would not be used, need a new function.
|
||||
It's easy when not doing breakpoints or profiling.
|
||||
Requires copying the lines into a list and then creating a function to
|
||||
execute lines from the list. Similar to getnextac().
|
||||
7 ":include" command: just like ":source" but doesn't start a new scriptID?
|
||||
Will be tricky for the list of script names.
|
||||
8 Have a look at VSEL. Would it be useful to include? (Bigham)
|
||||
@@ -5067,6 +5008,35 @@ Command line completion:
|
||||
- Add 'wildlongest' option: Key to use to find longest common match for
|
||||
command line completion (default CTRL-L), like 'wildchar'. (Cregut)
|
||||
Also: when there are several matches, show them line a CTRL-D.
|
||||
- With 'wildmode' set to "longest:full,full" and pressing Tab once the first
|
||||
entry in wildmenu is highlighted, that shouldn't happen. (Yuki Watanabe,
|
||||
2011 Feb 12)
|
||||
- After using <Tab> for command line completion after ":ta blah" and getting
|
||||
E33 (no tags file), further editing the command to e.g., ":echo 'blah'",
|
||||
the command is not executed. Fix by Ian Kelling?
|
||||
- Command line completion: Scanning for tags doesn't check for typed key now
|
||||
and then? Hangs for about 5 seconds. Appears to be caused by finding
|
||||
include files with "foo/**" in 'path'. (Kalisiak, 2006 July 15)
|
||||
Additional info: When using the |wildcards| ** globing, vim hangs
|
||||
indefinitely on lots of directories. The |file-searching| globing, like in
|
||||
":set path=/**" does not hang as often as with globing with |wildcards|,
|
||||
like in ":1find /**/file". This is for files that unix "find" can find
|
||||
very quickly. Merging the 2 kinds of globing might make this an easier
|
||||
fix. (Ian Kelling, 2008 July 4)
|
||||
- Command line completion when 'cmdheight' is maximum and 'wildmenu' is set,
|
||||
only one buffer line displayed, causes display errors.
|
||||
- Completing with 'wildmenu' and using <Up> and <Down> to move through
|
||||
directory tree stops unexpectedly when using ":cd " and entering a
|
||||
directory that doesn't contain other directories.
|
||||
8 Command line completion: buffers "foo.txt" and "../b/foo.txt", completing
|
||||
":buf foo<Tab>" doesn't find the second one. (George V. Reilly)
|
||||
8 Add more command line completion for :syntax.
|
||||
8 Add more command line completion for :highlight.
|
||||
- Wildmenu not deleted: "gvim -u NONE", ":set nocp wildmenu cmdheight=3
|
||||
laststatus=2", CTRL-D CTRL-H CTRL-H CTRL-H. (A.Politz, 2008 April 1) Works
|
||||
OK with Vim in an xterm.
|
||||
- If the variable "g:x#y#z" exists completion after ":echo g:x#" doesn't
|
||||
work.
|
||||
|
||||
|
||||
Command line history:
|
||||
|
||||
+12
-9
@@ -1,4 +1,4 @@
|
||||
*usr_29.txt* For Vim version 8.2. Last change: 2016 Feb 27
|
||||
*usr_29.txt* For Vim version 8.2. Last change: 2022 Mar 13
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -33,10 +33,12 @@ following command: >
|
||||
ctags *.c
|
||||
|
||||
"ctags" is a separate program. Most Unix systems already have it installed.
|
||||
If you do not have it yet, you can find Exuberant ctags here:
|
||||
|
||||
If you do not have it yet, you can find Universal/Exuberant ctags at:
|
||||
http://ctags.io ~
|
||||
http://ctags.sf.net ~
|
||||
|
||||
Universal ctags is preferred, Exuberant ctags is no longer being developed.
|
||||
|
||||
Now when you are in Vim and you want to go to a function definition, you can
|
||||
jump to it by using the following command: >
|
||||
|
||||
@@ -142,15 +144,15 @@ ONE TAGS FILE
|
||||
When Vim has to search many places for tags files, you can hear the disk
|
||||
rattling. It may get a bit slow. In that case it's better to spend this
|
||||
time while generating one big tags file. You might do this overnight.
|
||||
This requires the Exuberant ctags program, mentioned above. It offers an
|
||||
argument to search a whole directory tree: >
|
||||
This requires the Universal or Exuberant ctags program, mentioned above.
|
||||
It offers an argument to search a whole directory tree: >
|
||||
|
||||
cd ~/proj
|
||||
ctags -R .
|
||||
|
||||
The nice thing about this is that Exuberant ctags recognizes various file
|
||||
types. Thus this doesn't work just for C and C++ programs, also for Eiffel
|
||||
and even Vim scripts. See the ctags documentation to tune this.
|
||||
The nice thing about this is that Universal/Exuberant ctags recognizes various
|
||||
file types. Thus this doesn't work just for C and C++ programs, also for
|
||||
Eiffel and even Vim scripts. See the ctags documentation to tune this.
|
||||
Now you only need to tell Vim where your big tags file is: >
|
||||
|
||||
:set tags=~/proj/tags
|
||||
@@ -232,7 +234,8 @@ A TAGS BROWSER
|
||||
Since CTRL-] takes you to the definition of the identifier under the cursor,
|
||||
you can use a list of identifier names as a table of contents. Here is an
|
||||
example.
|
||||
First create a list of identifiers (this requires Exuberant ctags): >
|
||||
First create a list of identifiers (this requires Universal or Exuberant
|
||||
ctags): >
|
||||
|
||||
ctags --c-types=f -f functions *.c
|
||||
|
||||
|
||||
+30
-29
@@ -837,7 +837,7 @@ Files: runtime/tools/ccfilter.c, src/libvterm/src/parser.c,
|
||||
Patch 8.2.0107
|
||||
Problem: Hgignore is out of sync from gitignore.
|
||||
Solution: Add lines to hgignore. (Ken Takata)
|
||||
Files: .hgigmore
|
||||
Files: .hgignore
|
||||
|
||||
Patch 8.2.0108
|
||||
Problem: When sign text is changed a manual redraw is needed. (Pontus
|
||||
@@ -2474,7 +2474,7 @@ Files: src/testdir/test_hardcopy.vim
|
||||
Patch 8.2.0367
|
||||
Problem: Can use :pedit in a popup window.
|
||||
Solution: Disallow it.
|
||||
Files: src/ex_docmd.c, src/testdir/test_popuwin.vim
|
||||
Files: src/ex_docmd.c, src/testdir/test_popupwin.vim
|
||||
|
||||
Patch 8.2.0368
|
||||
Problem: Vim9: import that redefines local variable does not fail.
|
||||
@@ -2513,7 +2513,7 @@ Patch 8.2.0372
|
||||
Problem: Prop_find() may not find text property at start of the line.
|
||||
Solution: Adjust the loop to find properties. (Axel Forsman, closes #5761,
|
||||
closes #5663)
|
||||
Files: src/testprop.c, src/testdir/test_textprop.vim
|
||||
Files: src/textprop.c, src/testdir/test_textprop.vim
|
||||
|
||||
Patch 8.2.0373
|
||||
Problem: Type of term_sendkeys() is unknown.
|
||||
@@ -3743,7 +3743,7 @@ Patch 8.2.0570
|
||||
Problem: Vim9: no error when omitting type from argument.
|
||||
Solution: Enforce specifying argument types.
|
||||
Files: src/userfunc.c, src/ex_eval.c, src/testdir/test_vim9_script.vim,
|
||||
src/testdir/test_vim9_func.vim, src/testdir/test_vim9_expr.vim
|
||||
src/testdir/test_vim9_func.vim, src/testdir/test_vim9_expr.vim,
|
||||
src/testdir/test_vim9_disassemble.vim
|
||||
|
||||
Patch 8.2.0571
|
||||
@@ -3921,7 +3921,7 @@ Files: runtime/doc/netbeans.txt, src/netbeans.c, src/os_win32.c,
|
||||
Patch 8.2.0600
|
||||
Problem: Vim9: cannot read or write w:, t: and b: variables.
|
||||
Solution: Implement load and store for w:, t: and b: variables.
|
||||
(closes #5950)
|
||||
(closes #5950)
|
||||
Files: src/testdir/test_vim9_disassemble.vim,
|
||||
src/testdir/test_vim9_expr.vim, src/testdir/test_vim9_script.vim,
|
||||
src/vim9.h, src/vim9compile.c, src/vim9execute.c
|
||||
@@ -4042,7 +4042,7 @@ Files: runtime/lang/menu_sv_se.latin1.vim
|
||||
|
||||
Patch 8.2.0618
|
||||
Problem: Echoing a null list results in no output. (Yegappan Lakshmanan)
|
||||
Solution: Return "[]" instead of NULL in echo_string_core().
|
||||
Solution: Return "[]" instead of NULL in echo_string_core().
|
||||
Files: src/eval.c, src/testdir/test_messages.vim
|
||||
|
||||
Patch 8.2.0619
|
||||
@@ -4095,7 +4095,7 @@ Solution: Give error for missing space. Implement :echomsg and :echoerr.
|
||||
(closes #5670)
|
||||
Files: src/vim9compile.c, src/vim9execute.c, src/vim9.h, src/userfunc.c,
|
||||
src/eval.c, src/globals.h, src/testdir/test_vim9_func.vim,
|
||||
src/testdir/test_vim9_disassemble.vim
|
||||
src/testdir/test_vim9_disassemble.vim,
|
||||
src/testdir/test_vim9_script.vim
|
||||
|
||||
Patch 8.2.0627
|
||||
@@ -5205,8 +5205,9 @@ Problem: Libvterm code lags behind the upstream version.
|
||||
Solution: Include revision 727, but add the index instead of switching
|
||||
between RGB and indexed.
|
||||
Files: src/terminal.c, src/term.c, src/libvterm/include/vterm.h,
|
||||
src/libvterm/src/pen.c src/libvterm/src/screen.c
|
||||
src/libvterm/src/vterm_internal.h src/libvterm/t/30state_pen.test
|
||||
src/libvterm/src/pen.c, src/libvterm/src/screen.c,
|
||||
src/libvterm/src/vterm_internal.h,
|
||||
src/libvterm/t/30state_pen.test,
|
||||
src/libvterm/t/harness.c, src/libvterm/src/state.c,
|
||||
src/libvterm/t/26state_query.test,
|
||||
src/libvterm/t/64screen_pen.test
|
||||
@@ -5299,7 +5300,7 @@ Files: runtime/doc/vim9.txt, src/vim9script.c, src/structs.h,
|
||||
src/evalvars.c, src/proto/evalvars.pro, src/vim9compile.c,
|
||||
src/proto/vim9compile.pro, src/vim9execute.c, src/ex_cmds.h,
|
||||
src/ex_docmd.c, src/ex_cmdidxs.h, src/vim.h, src/testdir/vim9.vim,
|
||||
src/testdir/test_vim9_disassemble.vim
|
||||
src/testdir/test_vim9_disassemble.vim,
|
||||
src/testdir/test_vim9_func.vim, src/testdir/test_vim9_script.vim
|
||||
|
||||
Patch 8.2.0819
|
||||
@@ -5667,7 +5668,7 @@ Patch 8.2.0875
|
||||
Problem: Getting attributes for directory entries is slow.
|
||||
Solution: Add readdirex(). (Ken Takata, closes #5619)
|
||||
Files: runtime/doc/eval.txt, runtime/doc/usr_41.txt, src/evalfunc.c,
|
||||
src/fileio.c, src/filepath.c src/proto/fileio.pro,
|
||||
src/fileio.c, src/filepath.c, src/proto/fileio.pro,
|
||||
src/proto/filepath.pro, src/testdir/test_functions.vim
|
||||
|
||||
Patch 8.2.0876
|
||||
@@ -6292,7 +6293,7 @@ Patch 8.2.0981
|
||||
Problem: Vim9: cannot compile "[var, var] = list".
|
||||
Solution: Implement list assignment.
|
||||
Files: src/vim9compile.c, src/vim9.h, src/vim9execute.c, src/evalvars.c,
|
||||
src/proto/evalvars.pro src/eval.c, src/testdir/test_vim9_script.vim
|
||||
src/proto/evalvars.pro, src/eval.c, src/testdir/test_vim9_script.vim
|
||||
|
||||
Patch 8.2.0982
|
||||
Problem: Insufficient testing for reading/writing files.
|
||||
@@ -6335,7 +6336,7 @@ Files: runtime/doc/eval.txt, runtime/doc/mlang.txt, src/auto/configure,
|
||||
src/cmdexpand.c, src/config.h.in, src/configure.ac,
|
||||
src/evalfunc.c, src/evalvars.c, src/ex_cmds2.c, src/fileio.c,
|
||||
src/filepath.c, src/globals.h, src/proto/fileio.pro,
|
||||
src/testdir/test_cmdline.vim, src/testdir/test_functions.vim
|
||||
src/testdir/test_cmdline.vim, src/testdir/test_functions.vim,
|
||||
src/vim.h
|
||||
|
||||
Patch 8.2.0989
|
||||
@@ -9545,7 +9546,7 @@ Patch 8.2.1518
|
||||
Problem: Vim9: cannot assign to local option.
|
||||
Solution: Skip over "&l:" and "&g:". (closes #6749)
|
||||
Files: src/ex_docmd.c, src/proto/ex_docmd.pro, src/testdir/vim9.vim,
|
||||
src/vim9compile.c src/testdir/test_vim9_script.vim
|
||||
src/vim9compile.c, src/testdir/test_vim9_script.vim
|
||||
|
||||
Patch 8.2.1519
|
||||
Problem: Vim9: Ex command default range is not set.
|
||||
@@ -11740,7 +11741,7 @@ Files: src/structs.h, src/ex_docmd.c, src/proto/ex_docmd.pro,
|
||||
Patch 8.2.1898
|
||||
Problem: Command modifier parsing always uses global cmdmod.
|
||||
Solution: Pass in cmdmod_T to use. Rename struct fields consistently.
|
||||
Files: src/structs.h, src/arglist.c src/buffer.c, src/bufwrite.c,
|
||||
Files: src/structs.h, src/arglist.c, src/buffer.c, src/bufwrite.c,
|
||||
src/diff.c, src/change.c, src/cmdhist.c, src/edit.c,
|
||||
src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c, src/ex_getln.c,
|
||||
src/fileio.c, src/filepath.c, src/gui.c, src/gui_gtk_x11.c,
|
||||
@@ -13549,7 +13550,7 @@ Patch 8.2.2209
|
||||
Problem: Vim9: return type of => lambda not parsed.
|
||||
Solution: Parse and use the return type.
|
||||
Files: src/vim9compile.c, src/userfunc.c, src/vim9type.c,
|
||||
src/proto/vim9type.pro, src/vim9script.c, src/eval.c
|
||||
src/proto/vim9type.pro, src/vim9script.c, src/eval.c,
|
||||
src/testdir/test_vim9_expr.vim
|
||||
|
||||
Patch 8.2.2210
|
||||
@@ -13776,7 +13777,7 @@ Solution: Check the window still has lines. (Christian Brabandt,
|
||||
Files: src/term.c
|
||||
|
||||
Patch 8.2.2249
|
||||
Problem: Termcodes test is flaky when used over ssh with X forwarding.
|
||||
Problem: Termcodes test is flaky when used over ssh with X forwarding.
|
||||
Solution: Set 'mousetime' to a larger value. (Dominique Pellé, closes #7576,
|
||||
closes #7563)
|
||||
Files: src/testdir/test_termcodes.vim
|
||||
@@ -15482,7 +15483,7 @@ Problem: Vim9: cannot use a range with :unlet.
|
||||
Solution: Implement ISN_UNLETRANGE.
|
||||
Files: src/errors.h, src/eval.c, src/evalvars.c, src/list.c,
|
||||
src/proto/evalvars.pro, src/proto/list.pro, src/vim9.h,
|
||||
src/vim9compile.c, src/vim9execute.c
|
||||
src/vim9compile.c, src/vim9execute.c,
|
||||
src/testdir/test_vim9_assign.vim
|
||||
|
||||
Patch 8.2.2534
|
||||
@@ -15518,7 +15519,7 @@ Problem: Vim9: return from finally block causes a hang.
|
||||
Solution: Store both the finally and endtry indexes. (closes #7885)
|
||||
Files: src/vim9execute.c, src/vim9compile.c, src/vim9.h,
|
||||
src/testdir/test_vim9_script.vim,
|
||||
|
||||
|
||||
Patch 8.2.2540
|
||||
Problem: Vim9: no error for using script var name for argument.
|
||||
Solution: Check for this error. (closes #7868)
|
||||
@@ -17249,7 +17250,7 @@ Files: src/vim9compile.c, src/testdir/test_vim9_expr.vim
|
||||
|
||||
Patch 8.2.2841
|
||||
Problem: MS-Windows: cursor in wrong position when 'lazyredraw' and
|
||||
'statusline' are set.
|
||||
'statusline' are set.
|
||||
Solution: Call compute_cmdrow(). (closes #8170, closes #8184)
|
||||
Files: src/os_win32.c
|
||||
|
||||
@@ -17936,7 +17937,7 @@ Patch 8.2.2957
|
||||
Problem: Using getchar() in Vim9 script is problematic.
|
||||
Solution: Add getcharstr(). (closes #8343)
|
||||
Files: runtime/doc/eval.txt, src/evalfunc.c, src/getchar.c,
|
||||
src/proto/getchar.pro, src/testdir/test_getchar.vim
|
||||
src/proto/getchar.pro, src/testdir/test_functions.vim
|
||||
|
||||
Patch 8.2.2958 (after 8.2.2957)
|
||||
Problem: Function list test fails.
|
||||
@@ -18849,7 +18850,7 @@ Solution: Use eval().
|
||||
Files: src/testdir/check.vim
|
||||
|
||||
Patch 8.2.3110
|
||||
Problem: A pattern that matches the cursor position is bit complicated.
|
||||
Problem: A pattern that matches the cursor position is a bit complicated.
|
||||
Solution: Use a dot to indicate the cursor line and column. (Christian
|
||||
Brabandt, closes #8497, closes #8179)
|
||||
Files: runtime/doc/pattern.txt, src/errors.h, src/regexp_bt.c,
|
||||
@@ -18864,7 +18865,7 @@ Patch 8.2.3112 (after 8.2.3090)
|
||||
Problem: With concealing enabled and indirectly closing a fold the cursor
|
||||
may be somewhere in a folded line when it is not on the first line
|
||||
of the fold.
|
||||
Solution: Check if he cursor is somewhere in the folded text.
|
||||
Solution: Check if the cursor is somewhere in the folded text.
|
||||
Files: src/drawscreen.c
|
||||
|
||||
Patch 8.2.3113
|
||||
@@ -23950,7 +23951,7 @@ Patch 8.2.3957
|
||||
Problem: Error messages are spread out.
|
||||
Solution: Move more errors to errors.h.
|
||||
Files: src/errors.h, src/globals.h, src/arglist.c, src/bufwrite.c,
|
||||
src/evalvars.c, src/ex_cmds2.c, src/ex_docmd.c src/ex_eval.c,
|
||||
src/evalvars.c, src/ex_cmds2.c, src/ex_docmd.c, src/ex_eval.c,
|
||||
src/help.c, src/scriptfile.c, src/usercmd.c, src/userfunc.c,
|
||||
src/vim9cmds.c, src/vim9compile.c
|
||||
|
||||
@@ -23975,7 +23976,7 @@ Files: src/errors.h, src/alloc.c, src/arglist.c, src/autocmd.c,
|
||||
Patch 8.2.3961
|
||||
Problem: Error messages are spread out.
|
||||
Solution: Move more errors to errors.h.
|
||||
Files: src/errors.h, src/globals.h src/arglist.c, src/autocmd.c,
|
||||
Files: src/errors.h, src/globals.h, src/arglist.c, src/autocmd.c,
|
||||
src/blob.c, src/bufwrite.c, src/channel.c, src/clipboard.c,
|
||||
src/cmdexpand.c, src/debugger.c, src/dict.c, src/eval.c,
|
||||
src/evalfunc.c, src/evalvars.c, src/evalwindow.c, src/ex_cmds.c,
|
||||
@@ -24291,7 +24292,7 @@ Files: src/errors.h, src/channel.c, src/ex_docmd.c, src/ex_eval.c,
|
||||
|
||||
Patch 8.2.4004
|
||||
Problem: Old compiler complains about struct init with variable.
|
||||
Solution: Set the struct member later. (John Marriott)
|
||||
Solution: Set the struct member later. (John Marriott)
|
||||
Files: src/evalfunc.c
|
||||
|
||||
Patch 8.2.4005
|
||||
@@ -24494,7 +24495,7 @@ Files: src/time.c
|
||||
Patch 8.2.4036
|
||||
Problem: Vim9: script test file is getting too long.
|
||||
Solution: Split the import/export functionality to a separate file.
|
||||
Files: src/testdir/test_vim9_script.vim src/testdir/test_vim9_import.vim,
|
||||
Files: src/testdir/test_vim9_script.vim, src/testdir/test_vim9_import.vim,
|
||||
src/testdir/Make_all.mak
|
||||
|
||||
Patch 8.2.4037
|
||||
@@ -25457,7 +25458,7 @@ Patch 8.2.4202
|
||||
Problem: Vim9: cannot export function that exists globally.
|
||||
Solution: When checking if a function already exists only check for
|
||||
script-local functions. (closes #9615)
|
||||
Files: src/userfunc.c, src/proto/userfunc.pro, src/vim.h,
|
||||
Files: src/userfunc.c, src/proto/userfunc.pro, src/vim.h,
|
||||
src/vim9compile.c, src/vim9instr.c,
|
||||
src/testdir/test_vim9_import.vim
|
||||
|
||||
@@ -25853,7 +25854,7 @@ Patch 8.2.4265 (after 8.2.4264)
|
||||
Problem: Autoload tests fails.
|
||||
Solution: Use export instead of name with #.
|
||||
Files: src/testdir/sautest/autoload/auto9.vim,
|
||||
src/testdir/test_autoload.vim src/testdir/test_ins_complete.vim
|
||||
src/testdir/test_autoload.vim, src/testdir/test_ins_complete.vim
|
||||
|
||||
Patch 8.2.4266
|
||||
Problem: Compiler warning for uninitialized variable.
|
||||
|
||||
+24
-3
@@ -1,4 +1,4 @@
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2022 Mar 08
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2022 Mar 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -995,6 +995,11 @@ The values can also be useful as the default value for an argument: >
|
||||
if b == null_blob
|
||||
# b argument was not given
|
||||
|
||||
It is possible to compare `null` with any value, this will not give a type
|
||||
error. However, comparing `null` with a number, float or bool will always
|
||||
result in `false`. This is different from legacy script, where comparing
|
||||
`null` with zero or `false` would return `true`.
|
||||
|
||||
When converting a boolean to a string `false` and `true` are used, not
|
||||
`v:false` and `v:true` like in legacy script. `v:none` has no `none`
|
||||
replacement, it has no equivalent in other languages.
|
||||
@@ -1234,6 +1239,11 @@ Closures defined in a loop will share the same context. For example: >
|
||||
endfor
|
||||
echo range(5)->map((i, _) => flist[i]())
|
||||
# Result: [4, 4, 4, 4, 4]
|
||||
< *E1271*
|
||||
A closure must be compiled in the context that it is defined in, so that
|
||||
variables in that context can be found. This mostly happens correctly, except
|
||||
when a function is marked for debugging with `breakadd` after it was compiled.
|
||||
Make sure the define the breakpoint before compiling the outerh function.
|
||||
|
||||
The "inloop" variable will exist only once, all closures put in the list refer
|
||||
to the same instance, which in the end will have the value 4. This is
|
||||
@@ -1739,7 +1749,8 @@ actually needed. Using the autoload mechanism is recommended:
|
||||
prefix is obtained from the file name, as you would to manually in a
|
||||
legacy autoload script. Thus the exported function can be found with
|
||||
"for#search#Stuff", but you would normally use `import autoload` and not
|
||||
use the prefix.
|
||||
use the prefix (which has the side effect of loading the autoload script
|
||||
when compiling a function that encounters this name).
|
||||
|
||||
You can split up the functionality and import other scripts from the
|
||||
autoload script as you like. This way you can share code between plugins.
|
||||
@@ -1751,7 +1762,17 @@ script context of where the mapping was defined.
|
||||
When compiling a `:def` function and a function in an autoload script is
|
||||
encountered, the script is not loaded until the `:def` function is called.
|
||||
This also means you get any errors only at runtime, since the argument and
|
||||
return types are not known yet.
|
||||
return types are not known yet. If you would use the name with '#' characters
|
||||
then the autoload script IS loaded.
|
||||
|
||||
Be careful to not refer to an item in an autoload script that does trigger
|
||||
loading it unintentionally. For example, when setting an option that takes a
|
||||
function name, make sure to use a string, not a function reference: >
|
||||
import autoload 'qftf.vim'
|
||||
&quickfixtextfunc = 'qftf.Func' # autoload script NOT loaded
|
||||
&quickfixtextfunc = qftf.Func # autoload script IS loaded
|
||||
On the other hand, it can be useful to load the script early, at a time when
|
||||
any errors should be given.
|
||||
|
||||
For testing the |test_override()| function can be used to have the
|
||||
`import autoload` load the script right away, so that the items and types can
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Liquid
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2010 May 21
|
||||
" Last Change: 2022 Mar 15
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
@@ -53,7 +53,7 @@ if has('gui_win32')
|
||||
endif
|
||||
|
||||
if exists('loaded_matchit')
|
||||
let b:match_words .= '\<\%(if\w*\|unless\|case\)\>:\<\%(elsif\|else\|when\)\>:\<end\%(if\w*\|unless\|case\)\>,\<\%(for\|tablerow\)\>:\%({%\s*\)\@<=empty\>:\<end\%(for\|tablerow\)\>,<\(capture\|comment\|highlight\)\>:\<end\1\>'
|
||||
let b:match_words .= '\<\%(if\w*\|unless\|case\)\>:\<\%(elsif\|else\|when\)\>:\<end\%(if\w*\|unless\|case\)\>,\<\%(for\|tablerow\)\>:\%({%\s*\)\@<=empty\>:\<end\%(for\|tablerow\)\>,\<\(capture\|comment\|highlight\)\>:\<end\1\>'
|
||||
endif
|
||||
|
||||
setlocal commentstring={%\ comment\ %}%s{%\ endcomment\ %}
|
||||
|
||||
@@ -73,10 +73,11 @@ exe 'nno <buffer> <silent> ]] /' . escape(s:section, '|') . '/<CR>:nohls<CR>'
|
||||
exe 'ono <buffer> <silent> [[ ?' . escape(s:section, '|') . '?<CR>:nohls<CR>'
|
||||
exe 'ono <buffer> <silent> ]] /' . escape(s:section, '|') . '/<CR>:nohls<CR>'
|
||||
|
||||
setlocal suffixesadd=.php
|
||||
setlocal commentstring=/*%s*/
|
||||
|
||||
" Undo the stuff we changed.
|
||||
let b:undo_ftplugin = "setlocal commentstring< include< omnifunc<" .
|
||||
let b:undo_ftplugin = "setlocal suffixesadd< commentstring< include< omnifunc<" .
|
||||
\ " | unlet! b:browsefilter b:match_words | " .
|
||||
\ s:undo_ftplugin
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# Edit the src/po/gvim.desktop.in file instead.
|
||||
[Desktop Entry]
|
||||
# Translators: This is the Application Name used in the GVim desktop file
|
||||
Name[ca]=GVim
|
||||
Name[de]=GVim
|
||||
Name[eo]=GVim
|
||||
Name[fi]=GVim
|
||||
@@ -13,6 +14,7 @@ Name[sr]=GVim
|
||||
Name[tr]=GVim
|
||||
Name=GVim
|
||||
# Translators: This is the Generic Application Name used in the Vim desktop file
|
||||
GenericName[ca]=Editor de text
|
||||
GenericName[de]=Texteditor
|
||||
GenericName[eo]=Tekstoredaktilo
|
||||
GenericName[fi]=Tekstinmuokkain
|
||||
@@ -25,6 +27,7 @@ GenericName[sr]=Едитор текст
|
||||
GenericName[tr]=Metin Düzenleyici
|
||||
GenericName=Text Editor
|
||||
# Translators: This is the comment used in the Vim desktop file
|
||||
Comment[ca]=Edita fitxers de text
|
||||
Comment[de]=Textdateien bearbeiten
|
||||
Comment[eo]=Redakti tekstajn dosierojn
|
||||
Comment[fi]=Muokkaa tekstitiedostoja
|
||||
@@ -49,7 +52,6 @@ Comment[be]=Рэдагаваньне тэкставых файлаў
|
||||
Comment[bg]=Редактиране на текстови файлове
|
||||
Comment[bn]=টেক্স্ট ফাইল এডিট করুন
|
||||
Comment[bs]=Izmijeni tekstualne datoteke
|
||||
Comment[ca]=Edita fitxers de text
|
||||
Comment[cs]=Úprava textových souborů
|
||||
Comment[cy]=Golygu ffeiliau testun
|
||||
Comment[da]=Rediger tekstfiler
|
||||
@@ -105,6 +107,7 @@ Exec=gvim -f %F
|
||||
Terminal=false
|
||||
Type=Application
|
||||
# Translators: Search terms to find this application. Do NOT change the semicolons! The list MUST also end with a semicolon!
|
||||
Keywords[ca]=Text;editor;
|
||||
Keywords[de]=Text;Editor;
|
||||
Keywords[eo]=Teksto;redaktilo;
|
||||
Keywords[fi]=Teksti;muokkain;editori;
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
" Vim indent file
|
||||
" Language: bst
|
||||
" Author: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" $Id: bst.vim,v 1.1 2007/05/05 18:11:12 vimboss Exp $
|
||||
" Last Change: 2022 Mar 15
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal expandtab
|
||||
setlocal indentexpr=GetBstIndent(v:lnum)
|
||||
"setlocal smartindent
|
||||
setlocal cinkeys&
|
||||
setlocal cinkeys-=0#
|
||||
setlocal indentkeys&
|
||||
"setlocal indentkeys+=0%
|
||||
let b:undo_indent = 'setlocal indentexpr< cinkeys< indentkeys<'
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetBstIndent")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: Haml
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2019 Dec 05
|
||||
" Last Change: 2022 Mar 15
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
@@ -14,6 +14,8 @@ setlocal autoindent
|
||||
setlocal indentexpr=GetHamlIndent()
|
||||
setlocal indentkeys=o,O,*<Return>,},],0),!^F,=end,=else,=elsif,=rescue,=ensure,=when
|
||||
|
||||
let b:undo_indent = "setl ai< inde< indk<"
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetHamlIndent")
|
||||
finish
|
||||
|
||||
+13
-10
@@ -1,7 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: Liquid
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2017 Jun 13
|
||||
" Last Change: 2022 Mar 15
|
||||
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
@@ -29,17 +29,19 @@ let b:did_indent = 1
|
||||
setlocal indentexpr=GetLiquidIndent()
|
||||
setlocal indentkeys=o,O,*<Return>,<>>,{,},0),0],o,O,!^F,=end,=endif,=endunless,=endifchanged,=endcase,=endfor,=endtablerow,=endcapture,=else,=elsif,=when,=empty
|
||||
|
||||
let b:undo_indent = "setl inde< indk<"
|
||||
|
||||
" Only define the function once.
|
||||
if exists('*GetLiquidIndent')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! s:count(string,pattern)
|
||||
function! s:count(string, pattern) abort
|
||||
let string = substitute(a:string,'\C'.a:pattern,"\n",'g')
|
||||
return strlen(substitute(string,"[^\n]",'','g'))
|
||||
endfunction
|
||||
|
||||
function! GetLiquidIndent(...)
|
||||
function! GetLiquidIndent(...) abort
|
||||
if a:0 && a:1 == '.'
|
||||
let v:lnum = line('.')
|
||||
elseif a:0 && a:1 =~ '^\d'
|
||||
@@ -51,13 +53,14 @@ function! GetLiquidIndent(...)
|
||||
let lnum = prevnonblank(v:lnum-1)
|
||||
let line = getline(lnum)
|
||||
let cline = getline(v:lnum)
|
||||
let line = substitute(line,'\C^\%(\s*{%\s*end\w*\s*%}\)\+','','')
|
||||
let line .= matchstr(cline,'\C^\%(\s*{%\s*end\w*\s*%}\)\+')
|
||||
let cline = substitute(cline,'\C^\%(\s*{%\s*end\w*\s*%}\)\+','','')
|
||||
let line = substitute(line,'\C^\%(\s*{%-\=\s*end\w*\s*-\=%}\)\+','','')
|
||||
let line = substitute(line,'\C\%(\s*{%-\=\s*if.\+-\=%}.\+{%-\=\s*endif\s*-\=%}\)\+','','g')
|
||||
let line .= matchstr(cline,'\C^\%(\s*{%-\=\s*end\w*\s*-\=%}\)\+')
|
||||
let cline = substitute(cline,'\C^\%(\s*{%-\=\s*end\w*\s*-\=%}\)\+','','')
|
||||
let sw = shiftwidth()
|
||||
let ind += sw * s:count(line,'{%\s*\%(if\|elsif\|else\|unless\|ifchanged\|case\|when\|for\|empty\|tablerow\|capture\)\>')
|
||||
let ind -= sw * s:count(line,'{%\s*end\%(if\|unless\|ifchanged\|case\|for\|tablerow\|capture\)\>')
|
||||
let ind -= sw * s:count(cline,'{%\s*\%(elsif\|else\|when\|empty\)\>')
|
||||
let ind -= sw * s:count(cline,'{%\s*end\w*$')
|
||||
let ind += sw * s:count(line,'{%-\=\s*\%(if\|elsif\|else\|unless\|ifchanged\|case\|when\|for\|empty\|tablerow\|capture\)\>')
|
||||
let ind -= sw * s:count(line,'{%-\=\s*end\%(if\|unless\|ifchanged\|case\|for\|tablerow\|capture\)\>')
|
||||
let ind -= sw * s:count(cline,'{%-\=\s*\%(elsif\|else\|when\|empty\)\>')
|
||||
let ind -= sw * s:count(cline,'{%-\=\s*end\w*$')
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: Sass
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2017 Jun 13
|
||||
" Last Change: 2022 Mar 15
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
@@ -12,6 +12,8 @@ setlocal autoindent sw=2 et
|
||||
setlocal indentexpr=GetSassIndent()
|
||||
setlocal indentkeys=o,O,*<Return>,<:>,!^F
|
||||
|
||||
let b:undo_indent = "setl ai< inde< indk<"
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetSassIndent")
|
||||
finish
|
||||
|
||||
+60
-59
@@ -4,10 +4,11 @@
|
||||
" Copyright: Vim license applies, see ":help license"
|
||||
" Last Change: 2022 Jan 17
|
||||
"
|
||||
" WORK IN PROGRESS - Only the basics work
|
||||
" Note: On MS-Windows you need a recent version of gdb. The one included with
|
||||
" MingW is too old (7.6.1).
|
||||
" I used version 7.12 from http://www.equation.com/servlet/equation.cmd?fa=gdb
|
||||
" WORK IN PROGRESS - The basics works stable, more to come
|
||||
" Note: In general you need at least GDB 7.12 because this provides the
|
||||
" frame= response in MI thread-selected events we need to sync stack to file.
|
||||
" The one included with "old" MingW is too old (7.6.1), you may upgrade it or
|
||||
" use a newer version from http://www.equation.com/servlet/equation.cmd?fa=gdb
|
||||
"
|
||||
" There are two ways to run gdb:
|
||||
" - In a terminal window; used if possible, does not work on MS-Windows
|
||||
@@ -313,7 +314,7 @@ func s:StartDebug_term(dict)
|
||||
let response = line1 . line2
|
||||
if response =~ 'Undefined command'
|
||||
echoerr 'Sorry, your gdb is too old, gdb 7.12 is required'
|
||||
" CHECKME: possibly send a "server show version" here
|
||||
" CHECKME: possibly send a "server show version" here
|
||||
call s:CloseBuffers()
|
||||
return
|
||||
endif
|
||||
@@ -396,7 +397,7 @@ func s:StartDebug_prompt(dict)
|
||||
endif
|
||||
" Mark the buffer modified so that it's not easy to close.
|
||||
set modified
|
||||
let s:gdb_channel = job_getchannel(s:gdbjob)
|
||||
let s:gdb_channel = job_getchannel(s:gdbjob)
|
||||
|
||||
let s:ptybuf = 0
|
||||
if has('win32')
|
||||
@@ -662,8 +663,8 @@ func s:EndDebugCommon()
|
||||
if bufexists(bufnr)
|
||||
exe bufnr .. "buf"
|
||||
if exists('b:save_signcolumn')
|
||||
let &signcolumn = b:save_signcolumn
|
||||
unlet b:save_signcolumn
|
||||
let &signcolumn = b:save_signcolumn
|
||||
unlet b:save_signcolumn
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
@@ -739,8 +740,8 @@ func s:HandleDisasmMsg(msg)
|
||||
|
||||
let lnum = search('^' . s:asm_addr)
|
||||
if lnum != 0
|
||||
exe 'sign unplace ' . s:asm_id
|
||||
exe 'sign place ' . s:asm_id . ' line=' . lnum . ' name=debugPC'
|
||||
exe 'sign unplace ' . s:asm_id
|
||||
exe 'sign place ' . s:asm_id . ' line=' . lnum . ' name=debugPC'
|
||||
endif
|
||||
|
||||
call win_gotoid(curwinid)
|
||||
@@ -789,22 +790,22 @@ func s:CommOutput(chan, msg)
|
||||
call s:HandleDisasmMsg(msg)
|
||||
elseif msg != ''
|
||||
if msg =~ '^\(\*stopped\|\*running\|=thread-selected\)'
|
||||
call s:HandleCursor(msg)
|
||||
call s:HandleCursor(msg)
|
||||
elseif msg =~ '^\^done,bkpt=' || msg =~ '^=breakpoint-created,'
|
||||
call s:HandleNewBreakpoint(msg, 0)
|
||||
elseif msg =~ '^=breakpoint-modified,'
|
||||
call s:HandleNewBreakpoint(msg, 1)
|
||||
elseif msg =~ '^=breakpoint-deleted,'
|
||||
call s:HandleBreakpointDelete(msg)
|
||||
call s:HandleBreakpointDelete(msg)
|
||||
elseif msg =~ '^=thread-group-started'
|
||||
call s:HandleProgramRun(msg)
|
||||
call s:HandleProgramRun(msg)
|
||||
elseif msg =~ '^\^done,value='
|
||||
call s:HandleEvaluate(msg)
|
||||
call s:HandleEvaluate(msg)
|
||||
elseif msg =~ '^\^error,msg='
|
||||
call s:HandleError(msg)
|
||||
call s:HandleError(msg)
|
||||
elseif msg =~ '^disassemble'
|
||||
let s:parsing_disasm_msg = 1
|
||||
let s:asm_lines = []
|
||||
let s:parsing_disasm_msg = 1
|
||||
let s:asm_lines = []
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
@@ -986,22 +987,22 @@ func s:ClearBreakpoint()
|
||||
let nr = 0
|
||||
for id in s:breakpoint_locations[bploc]
|
||||
if has_key(s:breakpoints, id)
|
||||
" Assume this always works, the reply is simply "^done".
|
||||
call s:SendCommand('-break-delete ' . id)
|
||||
for subid in keys(s:breakpoints[id])
|
||||
exe 'sign unplace ' . s:Breakpoint2SignNumber(id, subid)
|
||||
endfor
|
||||
unlet s:breakpoints[id]
|
||||
unlet s:breakpoint_locations[bploc][idx]
|
||||
let nr = id
|
||||
break
|
||||
" Assume this always works, the reply is simply "^done".
|
||||
call s:SendCommand('-break-delete ' . id)
|
||||
for subid in keys(s:breakpoints[id])
|
||||
exe 'sign unplace ' . s:Breakpoint2SignNumber(id, subid)
|
||||
endfor
|
||||
unlet s:breakpoints[id]
|
||||
unlet s:breakpoint_locations[bploc][idx]
|
||||
let nr = id
|
||||
break
|
||||
else
|
||||
let idx += 1
|
||||
let idx += 1
|
||||
endif
|
||||
endfor
|
||||
if nr != 0
|
||||
if empty(s:breakpoint_locations[bploc])
|
||||
unlet s:breakpoint_locations[bploc]
|
||||
unlet s:breakpoint_locations[bploc]
|
||||
endif
|
||||
echomsg 'Breakpoint ' . id . ' cleared from line ' . lnum . '.'
|
||||
else
|
||||
@@ -1027,7 +1028,7 @@ func s:SendEval(expr)
|
||||
" remove text that is likely an assignment
|
||||
let exprLHS = substitute(a:expr, ' *=.*', '', '')
|
||||
endif
|
||||
|
||||
|
||||
" encoding expression to prevent bad errors
|
||||
let expr = a:expr
|
||||
let expr = substitute(expr, '\\', '\\\\', 'g')
|
||||
@@ -1036,14 +1037,14 @@ func s:SendEval(expr)
|
||||
let s:evalexpr = exprLHS
|
||||
endfunc
|
||||
|
||||
" :Evaluate - evaluate what is specified / under the cursor
|
||||
" :Evaluate - evaluate what is specified / under the cursor
|
||||
func s:Evaluate(range, arg)
|
||||
let expr = s:GetEvaluationExpression(a:range, a:arg)
|
||||
let s:ignoreEvalError = 0
|
||||
call s:SendEval(expr)
|
||||
endfunc
|
||||
|
||||
" get what is specified / under the cursor
|
||||
" get what is specified / under the cursor
|
||||
func s:GetEvaluationExpression(range, arg)
|
||||
if a:arg != ''
|
||||
" user supplied evaluation
|
||||
@@ -1192,7 +1193,7 @@ func s:GotoAsmwinOrCreateIt()
|
||||
|
||||
if exists('g:termdebug_disasm_window')
|
||||
if g:termdebug_disasm_window > 1
|
||||
exe 'resize ' . g:termdebug_disasm_window
|
||||
exe 'resize ' . g:termdebug_disasm_window
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@@ -1201,7 +1202,7 @@ func s:GotoAsmwinOrCreateIt()
|
||||
let lnum = search('^' . s:asm_addr)
|
||||
if lnum == 0
|
||||
if s:stopped
|
||||
call s:SendCommand('disassemble $pc')
|
||||
call s:SendCommand('disassemble $pc')
|
||||
endif
|
||||
else
|
||||
exe 'sign unplace ' . s:asm_id
|
||||
@@ -1236,15 +1237,15 @@ func s:HandleCursor(msg)
|
||||
|
||||
let curwinid = win_getid(winnr())
|
||||
if win_gotoid(s:asmwin)
|
||||
let lnum = search('^' . s:asm_addr)
|
||||
if lnum == 0
|
||||
call s:SendCommand('disassemble $pc')
|
||||
else
|
||||
exe 'sign unplace ' . s:asm_id
|
||||
exe 'sign place ' . s:asm_id . ' line=' . lnum . ' name=debugPC'
|
||||
endif
|
||||
let lnum = search('^' . s:asm_addr)
|
||||
if lnum == 0
|
||||
call s:SendCommand('disassemble $pc')
|
||||
else
|
||||
exe 'sign unplace ' . s:asm_id
|
||||
exe 'sign place ' . s:asm_id . ' line=' . lnum . ' name=debugPC'
|
||||
endif
|
||||
|
||||
call win_gotoid(curwinid)
|
||||
call win_gotoid(curwinid)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@@ -1263,26 +1264,26 @@ echomsg 'different fname: "' .. expand('%:p') .. '" vs "' .. fnamemodify(fname,
|
||||
\ | echo 'Warning: file is being edited elsewhere'
|
||||
\ | echohl None
|
||||
\ | let v:swapchoice = '0'
|
||||
augroup END
|
||||
if &modified
|
||||
" TODO: find existing window
|
||||
exe 'split ' . fnameescape(fname)
|
||||
let s:sourcewin = win_getid(winnr())
|
||||
call s:InstallWinbar()
|
||||
else
|
||||
exe 'edit ' . fnameescape(fname)
|
||||
endif
|
||||
augroup Termdebug
|
||||
au! SwapExists
|
||||
augroup END
|
||||
augroup END
|
||||
if &modified
|
||||
" TODO: find existing window
|
||||
exe 'split ' . fnameescape(fname)
|
||||
let s:sourcewin = win_getid(winnr())
|
||||
call s:InstallWinbar()
|
||||
else
|
||||
exe 'edit ' . fnameescape(fname)
|
||||
endif
|
||||
augroup Termdebug
|
||||
au! SwapExists
|
||||
augroup END
|
||||
endif
|
||||
exe lnum
|
||||
normal! zv
|
||||
exe 'sign unplace ' . s:pc_id
|
||||
exe 'sign place ' . s:pc_id . ' line=' . lnum . ' name=debugPC priority=110 file=' . fname
|
||||
if !exists('b:save_signcolumn')
|
||||
let b:save_signcolumn = &signcolumn
|
||||
call add(s:signcolumn_buflist, bufnr())
|
||||
let b:save_signcolumn = &signcolumn
|
||||
call add(s:signcolumn_buflist, bufnr())
|
||||
endif
|
||||
setlocal signcolumn=yes
|
||||
endif
|
||||
@@ -1396,8 +1397,8 @@ func s:HandleBreakpointDelete(msg)
|
||||
if has_key(s:breakpoints, id)
|
||||
for [subid, entry] in items(s:breakpoints[id])
|
||||
if has_key(entry, 'placed')
|
||||
exe 'sign unplace ' . s:Breakpoint2SignNumber(id, subid)
|
||||
unlet entry['placed']
|
||||
exe 'sign unplace ' . s:Breakpoint2SignNumber(id, subid)
|
||||
unlet entry['placed']
|
||||
endif
|
||||
endfor
|
||||
unlet s:breakpoints[id]
|
||||
@@ -1422,7 +1423,7 @@ func s:BufRead()
|
||||
for [id, entries] in items(s:breakpoints)
|
||||
for [subid, entry] in items(entries)
|
||||
if entry['fname'] == fname
|
||||
call s:PlaceSign(id, subid, entry)
|
||||
call s:PlaceSign(id, subid, entry)
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
@@ -1434,7 +1435,7 @@ func s:BufUnloaded()
|
||||
for [id, entries] in items(s:breakpoints)
|
||||
for [subid, entry] in items(entries)
|
||||
if entry['fname'] == fname
|
||||
let entry['placed'] = 0
|
||||
let entry['placed'] = 0
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2021 Dec 07
|
||||
" Last Change: 2022 Mar 17
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -245,8 +245,14 @@ syn match cWrongComTail display "\*/"
|
||||
|
||||
syn keyword cOperator sizeof
|
||||
if exists("c_gnu")
|
||||
syn keyword cType __label__ __complex__
|
||||
syn keyword cStatement __asm__
|
||||
syn keyword cOperator typeof __real__ __imag__
|
||||
syn keyword cOperator __alignof__
|
||||
syn keyword cOperator typeof __typeof__
|
||||
syn keyword cOperator __real__ __imag__
|
||||
syn keyword cStorageClass __attribute__ __const__ __extension__
|
||||
syn keyword cStorageClass inline __inline__
|
||||
syn keyword cStorageClass __restrict__ __volatile__ __noreturn__
|
||||
endif
|
||||
syn keyword cType int long short char void
|
||||
syn keyword cType signed unsigned float double
|
||||
@@ -270,16 +276,10 @@ if !exists("c_no_c99") " ISO C99
|
||||
syn keyword cType intptr_t uintptr_t
|
||||
syn keyword cType intmax_t uintmax_t
|
||||
endif
|
||||
if exists("c_gnu")
|
||||
syn keyword cType __label__ __complex__ __volatile__
|
||||
endif
|
||||
|
||||
syn keyword cTypedef typedef
|
||||
syn keyword cStructure struct union enum
|
||||
syn keyword cStorageClass static register auto volatile extern const
|
||||
if exists("c_gnu")
|
||||
syn keyword cStorageClass inline __attribute__
|
||||
endif
|
||||
if !exists("c_no_c99") && !s:in_cpp_family
|
||||
syn keyword cStorageClass inline restrict
|
||||
endif
|
||||
@@ -292,6 +292,7 @@ if !exists("c_no_c11")
|
||||
syn keyword cOperator _Static_assert static_assert
|
||||
syn keyword cStorageClass _Thread_local thread_local
|
||||
syn keyword cType char16_t char32_t
|
||||
syn keyword cType max_align_t
|
||||
" C11 atomics (take down the shield wall!)
|
||||
syn keyword cType atomic_bool atomic_char atomic_schar atomic_uchar
|
||||
syn keyword Ctype atomic_short atomic_ushort atomic_int atomic_uint
|
||||
|
||||
+12
-12
@@ -2,7 +2,7 @@
|
||||
" Language: Liquid
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Filenames: *.liquid
|
||||
" Last Change: 2013 May 30
|
||||
" Last Change: 2022 Mar 15
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
@@ -68,10 +68,10 @@ if !exists('s:subtype')
|
||||
unlet s:subtype
|
||||
endif
|
||||
|
||||
syn region liquidStatement matchgroup=liquidDelimiter start="{%" end="%}" contains=@liquidStatement containedin=ALLBUT,@liquidExempt keepend
|
||||
syn region liquidExpression matchgroup=liquidDelimiter start="{{" end="}}" contains=@liquidExpression containedin=ALLBUT,@liquidExempt keepend
|
||||
syn region liquidComment matchgroup=liquidDelimiter start="{%\s*comment\s*%}" end="{%\s*endcomment\s*%}" contains=liquidTodo,@Spell containedin=ALLBUT,@liquidExempt keepend
|
||||
syn region liquidRaw matchgroup=liquidDelimiter start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" contains=TOP,@liquidExempt containedin=ALLBUT,@liquidExempt keepend
|
||||
syn region liquidStatement matchgroup=liquidDelimiter start="{%-\=" end="-\=%}" contains=@liquidStatement containedin=ALLBUT,@liquidExempt keepend
|
||||
syn region liquidExpression matchgroup=liquidDelimiter start="{{-\=" end="-\=}}" contains=@liquidExpression containedin=ALLBUT,@liquidExempt keepend
|
||||
syn region liquidComment matchgroup=liquidDelimiter start="{%-\=\s*comment\s*-\=%}" end="{%-\=\s*endcomment\s*-\=%}" contains=liquidTodo,@Spell containedin=ALLBUT,@liquidExempt keepend
|
||||
syn region liquidRaw matchgroup=liquidDelimiter start="{%-\=\s*raw\s*-\=%}" end="{%-\=\s*endraw\s*-\=%}" contains=TOP,@liquidExempt containedin=ALLBUT,@liquidExempt keepend
|
||||
|
||||
syn cluster liquidExempt contains=liquidStatement,liquidExpression,liquidComment,liquidRaw,@liquidStatement,liquidYamlHead
|
||||
syn cluster liquidStatement contains=liquidConditional,liquidRepeat,liquidKeyword,@liquidExpression
|
||||
@@ -79,11 +79,11 @@ syn cluster liquidExpression contains=liquidOperator,liquidString,liquidNumber,l
|
||||
|
||||
syn keyword liquidKeyword highlight nextgroup=liquidTypeHighlight skipwhite contained
|
||||
syn keyword liquidKeyword endhighlight contained
|
||||
syn region liquidHighlight start="{%\s*highlight\s\+\w\+\s*%}" end="{% endhighlight %}" keepend
|
||||
syn region liquidHighlight start="{%-\=\s*highlight\s\+\w\+\s*-\=%}" end="{%-\= endhighlight -\=%}" keepend
|
||||
|
||||
for s:type in g:liquid_highlight_types
|
||||
exe 'syn match liquidTypeHighlight "\<'.matchstr(s:type,'[^=]*').'\>" contained'
|
||||
exe 'syn region liquidHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' start="{%\s*highlight\s\+'.matchstr(s:type,'[^=]*').'\s*%}" end="{% endhighlight %}" keepend contains=@liquidHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g')
|
||||
exe 'syn region liquidHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' start="{%-\=\s*highlight\s\+'.matchstr(s:type,'[^=]*').'\s*-\=%}" end="{%-\= endhighlight -\=%}" keepend contains=@liquidHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g')
|
||||
endfor
|
||||
unlet! s:type
|
||||
|
||||
@@ -92,18 +92,18 @@ syn region liquidString matchgroup=liquidQuote start=+'+ end=+'+ contained
|
||||
syn match liquidNumber "-\=\<\d\+\>" contained
|
||||
syn match liquidFloat "-\=\<\d\+\>\.\.\@!\%(\d\+\>\)\=" contained
|
||||
syn keyword liquidBoolean true false contained
|
||||
syn keyword liquidNull null nil contained
|
||||
syn keyword liquidNull null nil blank contained
|
||||
syn match liquidEmpty "\<empty\>" contained
|
||||
|
||||
syn keyword liquidOperator and or not contained
|
||||
syn match liquidPipe '|' contained skipwhite nextgroup=liquidFilter
|
||||
|
||||
syn keyword liquidFilter date capitalize downcase upcase first last join sort size strip_html strip_newlines newline_to_br replace replace_first remove remove_first truncate truncatewords prepend append minus plus times divided_by contained
|
||||
syn keyword liquidFilter date capitalize downcase upcase escape escape_once first last join sort size where uniq strip_html strip_newlines newline_to_br replace replace_first remove remove_first slice split strip truncate truncatewords prepend append url_encode url_decode abs at_most at_least ceil divided_by floor minus plus round times modulo contained
|
||||
|
||||
syn keyword liquidConditional if elsif else endif unless endunless case when endcase ifchanged endifchanged contained
|
||||
syn keyword liquidRepeat for endfor tablerow endtablerow in contained
|
||||
syn match liquidRepeat "\%({%\s*\)\@<=empty\>" contained
|
||||
syn keyword liquidKeyword assign cycle include with contained
|
||||
syn keyword liquidRepeat for endfor tablerow endtablerow in break continue limit offset reversed contained
|
||||
syn match liquidRepeat "\%({%-\=\s*\)\@<=empty\>" contained
|
||||
syn keyword liquidKeyword assign capture endcapture increasement decreasement cycle include with render contained
|
||||
|
||||
syn keyword liquidForloop forloop nextgroup=liquidForloopDot contained
|
||||
syn match liquidForloopDot "\." nextgroup=liquidForloopAttribute contained
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: Sass
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Filenames: *.sass
|
||||
" Last Change: 2019 Dec 05
|
||||
" Last Change: 2022 Mar 15
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -58,6 +58,7 @@ syn match sassAmpersand "&"
|
||||
" TODO: Arithmetic (including strings and concatenation)
|
||||
|
||||
syn region sassMediaQuery matchgroup=sassMedia start="@media" end="[{};]\@=\|$" contains=sassMediaOperators
|
||||
syn region sassKeyframe matchgroup=cssAtKeyword start=/@\(-[a-z]\+-\)\=keyframes\>/ end=";\|$" contains=cssVendor,cssComment nextgroup=cssDefinition
|
||||
syn keyword sassMediaOperators and not only contained
|
||||
syn region sassCharset start="@charset" end=";\|$" contains=scssComment,cssStringQ,cssStringQQ,cssURL,cssUnicodeEscape,cssMediaType
|
||||
syn region sassInclude start="@import" end=";\|$" contains=scssComment,cssStringQ,cssStringQQ,cssURL,cssUnicodeEscape,cssMediaType
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim 8.2 script
|
||||
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
|
||||
" Last Change: February 09, 2022
|
||||
" Version: 8.2-28
|
||||
" Last Change: March 14, 2022
|
||||
" Version: 8.2-29
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
|
||||
" Automatically generated keyword lists: {{{1
|
||||
|
||||
@@ -19,12 +19,13 @@ syn keyword vimTodo contained COMBAK FIXME TODO XXX
|
||||
syn cluster vimCommentGroup contains=vimTodo,@Spell
|
||||
|
||||
" regular vim commands {{{2
|
||||
syn keyword vimCommand contained a ar[gs] argg[lobal] b[uffer] bf[irst] br[ewind] bufdo c[hange] caddf[ile] cbel[ow] ce[nter] cgetb[uffer] chi[story] cmapc[lear] col[der] conf[irm] cr[ewind] cw[indow] delc[ommand] deletp di[splay] diffs[plit] dl dr[op] ec elsei[f] endt[ry] exp filetype fix[del] for gui helpg[rep] ia imp is[earch] kee[pmarks] lNf[ile] laddf[ile] lbe[fore] lcs lex[pr] lgete[xpr] lla[st] lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] mkv[imrc] nb[key] noautocmd o[pen] p[rint] perld[o] pro ptN[ext] ptp[revious] py3do python3 qa[ll] redr[aw] retu[rn] rubyd[o] sIe sN[ext] sb[uffer] sbp[revious] sci scs sf[ind] sgi si sim[alt] sm[agic] sno[magic] spe[llgood] spellu[ndo] sre[wind] st[op] stopi[nsert] sunmenu sync tab tabfir[st] tabp[revious] tcl th[row] tlnoremenu tn[ext] ts[elect] undoj[oin] up[date] vi[sual] viu[sage] wh[ile] wn[ext] wv[iminfo] xmenu xunme
|
||||
syn keyword vimCommand contained ab arga[dd] argl[ocal] ba[ll] bl[ast] brea[k] buffers ca caf[ter] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cn[ext] colo[rscheme] cons[t] cs d[elete] delel delf[unction] dif[fupdate] difft[his] dli[st] ds[earch] echoc[onsole] em[enu] endw[hile] export filt[er] fo[ld] fu[nction] gvim helpt[ags] iabc[lear] import isp[lit] keepa l[ist] laf[ter] lbel[ow] lcscope lf[ile] lgr[ep] lli[st] lnf[ile] lol[der] lt[ag] lw[indow] menut[ranslate] mkvie[w] nbc[lose] noh[lsearch] ol[dfiles] pa[ckadd] po[p] prof[ile] pta[g] ptr[ewind] py3f[ile] pythonx quita[ll] redraws[tatus] rew[ind] rubyf[ile] sIg sa[rgument] sba[ll] sbr[ewind] scl scscope sfir[st] sgl sic sin sm[ap] snoreme spelld[ump] spellw[rong] srg sta[g] sts[elect] sus[pend] syncbind tabN[ext] tabl[ast] tabr[ewind] tcld[o] tj[ump] tlu tno[remap] tu[nmenu] undol[ist] v vie[w] vne[w] win[size] wp[revious] x[it] xnoreme xunmenu
|
||||
syn keyword vimCommand contained abc[lear] argd[elete] argu[ment] bad[d] bm[odified] breaka[dd] bun[load] cabc[lear] cal[l] cc cf[ile] changes cla[st] cnew[er] com cope[n] cscope debug delep dell diffg[et] dig[raphs] do dsp[lit] echoe[rr] en[dif] ene[w] exu[sage] fin[d] foldc[lose] g h[elp] hi if in iuna[bbrev] keepalt la[st] lan[guage] lbo[ttom] ld[o] lfdo lgrepa[dd] lma lo[adview] lop[en] lua m[ove] mes[sages] mod[e] nbs[tart] nor omapc[lear] packl[oadall] popu[p] profd[el] ptf[irst] pts[elect] py3f[ile] pyx r[ead] redrawt[abline] ri[ght] rundo sIl sal[l] sbf[irst] sc scp se[t] sg sgn sie sip sme snoremenu spelli[nfo] spr[evious] sri star[tinsert] substitutepattern sv[iew] syntime tabc[lose] tabm[ove] tabs tclf[ile] tl[ast] tlunmenu to[pleft] tunma[p] unh[ide] var vim9[cmd] vs[plit] winc[md] wq xa[ll] xnoremenu xwininfo
|
||||
syn keyword vimCommand contained abo[veleft] argded[upe] as[cii] balt bn[ext] breakd[el] bw[ipeout] cabo[ve] cat[ch] ccl[ose] cfdo chd[ir] class cnf[ile] comc[lear] cp[revious] cstag debugg[reedy] deletel delm[arks] diffo[ff] dir doau e[dit] echom[sg] enddef eval f[ile] fina[lly] foldd[oopen] go[to] ha[rdcopy] hid[e] ij[ump] inor j[oin] keepj[umps] lab[ove] lat lc[d] le[ft] lfir[st] lh[elpgrep] lmak[e] loadk lp[revious] luado ma[rk] mk[exrc] mz[scheme] new nore on[ly] pc[lose] pp[op] promptf[ind] ptj[ump] pu[t] py[thon] pyxdo rec[over] reg[isters] rightb[elow] rv[iminfo] sIn san[dbox] sbl[ast] scI scr[iptnames] setf[iletype] sgI sgp sig sir smenu so[urce] spellr[are] sr srl startg[replace] substituterepeat sw[apname] t tabd[o] tabn[ext] tags te[aroff] tlm tm[enu] tp[revious] type unl ve[rsion] vim9s[cript] wN[ext] windo wqa[ll] xmapc[lear] xprop y[ank]
|
||||
syn keyword vimCommand contained addd argdo au bd[elete] bo[tright] breakl[ist] cN[ext] cad[dbuffer] cb[uffer] cd cfir[st] che[ckpath] cle[arjumps] cnor comp[iler] cpf[ile] cun def deletep delp diffp[atch] disa[ssemble] doaut ea echon endf[unction] ex files fini[sh] folddoc[losed] gr[ep] helpc[lose] his[tory] il[ist] interface ju[mps] keepp[atterns] lad[dexpr] later lch[dir] lefta[bove] lg[etfile] lhi[story] lmapc[lear] loadkeymap lpf[ile] luafile mak[e] mks[ession] mzf[ile] nmapc[lear] nos[wapfile] opt[ions] pe[rl] pre[serve] promptr[epl] ptl[ast] pw[d] pydo pyxfile red[o] res[ize] ru[ntime] sI sIp sav[eas] sbm[odified] sce scripte[ncoding] setg[lobal] sgc sgr sign sl[eep] smile sor[t] spellr[epall] srI srn startr[eplace] sun[hide] sy tN[ext] tabe[dit] tabnew tc[d] ter[minal] tlmenu tma[p] tr[ewind] u[ndo] unlo[ckvar] verb[ose] vim[grep] w[rite] winp[os] wundo xme xr[estore] z[^.=]
|
||||
syn keyword vimCommand contained al[l] arge[dit] bN[ext] bel[owright] bp[revious] bro[wse] cNf[ile] cadde[xpr] cbe[fore] cdo cg[etfile] checkt[ime] clo[se] co[py] con[tinue] cq[uit] cuna[bbrev] defc[ompile] deletl dep diffpu[t] dj[ump] dp earlier el[se] endfo[r] exi[t] filet fir[st] foldo[pen] grepa[dd] helpf[ind] i imapc[lear] intro k lN[ext] laddb[uffer] lb[uffer] lcl[ose] leg[acy] lgetb[uffer] ll lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks mksp[ell] n[ext] noa nu[mber] ownsyntax ped[it] prev[ious] ps[earch] ptn[ext] py3 pyf[ile] q[uit] redi[r] ret[ab] rub[y] sIc sIr sbN[ext] sbn[ext] scg scriptv[ersion] setl[ocal] sge sh[ell] sil[ent] sla[st] sn[ext] sp[lit] spellr[rare] src srp stj[ump] sunme syn ta[g] tabf[ind] tabo[nly] tch[dir] tf[irst] tln tmapc[lear] try una[bbreviate] uns[ilent] vert[ical] vimgrepa[dd] wa[ll]
|
||||
syn keyword vimCommand contained a ar[gs] argg[lobal] b[uffer] bf[irst] br[ewind] bufdo c[hange] caddf[ile] cbel[ow] ce[nter] cgetb[uffer] chi[story] cmapc[lear] col[der] conf[irm] cr[ewind] cw[indow] delc[ommand] deletp di[splay] diffs[plit] dl dr[op] ec elsei[f] endf[unction] enum exu[sage] fin[d] foldc[lose] g h[elp] hi if in iuna[bbrev] keepalt la[st] lan[guage] lbo[ttom] ld[o] lfdo lgrepa[dd] lma lo[adview] lop[en] lua m[ove] mes[sages] mod[e] nbs[tart] nor omapc[lear] packl[oadall] popu[p] profd[el] ptf[irst] pts[elect] py3f[ile] pyx r[ead] redrawt[abline] ri[ght] rundo sIl sal[l] sbf[irst] sc scp se[t] sg sgn sie sip sme snoremenu spelli[nfo] spr[evious] sri star[tinsert] sts[elect] sus[pend] syncbind tabN[ext] tabl[ast] tabr[ewind] tcld[o] tj[ump] tlu tno[remap] tu[nmenu] undol[ist] v vie[w] vne[w] win[size] wq xmapc[lear] xr[estore]
|
||||
syn keyword vimCommand contained ab arga[dd] argl[ocal] ba[ll] bl[ast] brea[k] buffers ca caf[ter] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cn[ext] colo[rscheme] cons[t] cs d[elete] delel delf[unction] dif[fupdate] difft[his] dli[st] ds[earch] echoc[onsole] em[enu] endfo[r] eval f[ile] fina[lly] foldd[oopen] go[to] ha[rdcopy] hid[e] ij[ump] inor j[oin] keepj[umps] lab[ove] lat lc[d] le[ft] lfir[st] lh[elpgrep] lmak[e] loadk lp[revious] luado ma[rk] mk[exrc] mz[scheme] new nore on[ly] pc[lose] pp[op] promptf[ind] ptj[ump] pu[t] py[thon] pyxdo rec[over] reg[isters] rightb[elow] rv[iminfo] sIn san[dbox] sbl[ast] scI scr[iptnames] setf[iletype] sgI sgp sig sir smenu so[urce] spellr[are] sr srl startg[replace] substitutepattern sv[iew] syntime tabc[lose] tabm[ove] tabs tclf[ile] tl[ast] tlunmenu to[pleft] tunma[p] unh[ide] var vim9[cmd] vs[plit] winc[md] wqa[ll] xme xunme
|
||||
syn keyword vimCommand contained abc[lear] argd[elete] argu[ment] bad[d] bm[odified] breaka[dd] bun[load] cabc[lear] cal[l] cc cf[ile] changes cla[st] cnew[er] com cope[n] cscope debug delep dell diffg[et] dig[raphs] do dsp[lit] echoe[rr] en[dif] endinterface ex files fini[sh] folddoc[losed] gr[ep] helpc[lose] his[tory] il[ist] interface ju[mps] keepp[atterns] lad[dexpr] later lch[dir] lefta[bove] lg[etfile] lhi[story] lmapc[lear] loadkeymap lpf[ile] luafile mak[e] mks[ession] mzf[ile] nmapc[lear] nos[wapfile] opt[ions] pe[rl] pre[serve] promptr[epl] ptl[ast] pw[d] pydo pyxfile red[o] res[ize] ru[ntime] sI sIp sav[eas] sbm[odified] sce scripte[ncoding] setg[lobal] sgc sgr sign sl[eep] smile sor[t] spellr[epall] srI srn startr[eplace] substituterepeat sw[apname] t tabd[o] tabn[ext] tags te[aroff] tlm tm[enu] tp[revious] type unl ve[rsion] vim9s[cript] wN[ext] windo wundo xmenu xunmenu
|
||||
syn keyword vimCommand contained abo[veleft] argded[upe] as[cii] balt bn[ext] breakd[el] bw[ipeout] cabo[ve] cat[ch] ccl[ose] cfdo chd[ir] class cnf[ile] comc[lear] cp[revious] cstag debugg[reedy] deletel delm[arks] diffo[ff] dir doau e[dit] echom[sg] endclass endt[ry] exi[t] filet fir[st] foldo[pen] grepa[dd] helpf[ind] i imapc[lear] intro k lN[ext] laddb[uffer] lb[uffer] lcl[ose] leg[acy] lgetb[uffer] ll lne[xt] loc[kmarks] lr[ewind] lv[imgrep] marks mksp[ell] n[ext] noa nu[mber] ownsyntax ped[it] prev[ious] ps[earch] ptn[ext] py3 pyf[ile] q[uit] redi[r] ret[ab] rub[y] sIc sIr sbN[ext] sbn[ext] scg scriptv[ersion] setl[ocal] sge sh[ell] sil[ent] sla[st] sn[ext] sp[lit] spellr[rare] src srp static sun[hide] sy tN[ext] tabe[dit] tabnew tc[d] ter[minal] tlmenu tma[p] tr[ewind] u[ndo] unlo[ckvar] verb[ose] vim[grep] w[rite] winp[os] wv[iminfo] xnoreme xwininfo
|
||||
syn keyword vimCommand contained abstract argdo au bd[elete] bo[tright] breakl[ist] cN[ext] cad[dbuffer] cb[uffer] cd cfir[st] che[ckpath] cle[arjumps] cnor comp[iler] cpf[ile] cun def deletep delp diffp[atch] disa[ssemble] doaut ea echon enddef endw[hile] exp filetype fix[del] for gui helpg[rep] ia imp is[earch] kee[pmarks] lNf[ile] laddf[ile] lbe[fore] lcs lex[pr] lgete[xpr] lla[st] lnew[er] lockv[ar] ls lvimgrepa[dd] mat[ch] mkv[imrc] nb[key] noautocmd o[pen] p[rint] perld[o] pro ptN[ext] ptp[revious] py3do python3 qa[ll] redr[aw] retu[rn] rubyd[o] sIe sN[ext] sb[uffer] sbp[revious] sci scs sf[ind] sgi si sim[alt] sm[agic] sno[magic] spe[llgood] spellu[ndo] sre[wind] st[op] stj[ump] sunme syn ta[g] tabf[ind] tabo[nly] tch[dir] tf[irst] tln tmapc[lear] try una[bbreviate] uns[ilent] vert[ical] vimgrepa[dd] wa[ll] wn[ext] x[it] xnoremenu y[ank]
|
||||
syn keyword vimCommand contained addd arge[dit] bN[ext] bel[owright] bp[revious] bro[wse] cNf[ile] cadde[xpr] cbe[fore] cdo cg[etfile] checkt[ime] clo[se] co[py] con[tinue] cq[uit] cuna[bbrev] defc[ompile] deletl dep diffpu[t] dj[ump] dp earlier el[se] endenum ene[w] export filt[er] fo[ld] fu[nction] gvim helpt[ags] iabc[lear] import isp[lit] keepa l[ist] laf[ter] lbel[ow] lcscope lf[ile] lgr[ep] lli[st] lnf[ile] lol[der] lt[ag] lw[indow] menut[ranslate] mkvie[w] nbc[lose] noh[lsearch] ol[dfiles] pa[ckadd] po[p] prof[ile] pta[g] ptr[ewind] py3f[ile] pythonx quita[ll] redraws[tatus] rew[ind] rubyf[ile] sIg sa[rgument] sba[ll] sbr[ewind] scl scscope sfir[st] sgl sic sin sm[ap] snoreme spelld[ump] spellw[rong] srg sta[g] stopi[nsert] sunmenu sync tab tabfir[st] tabp[revious] tcl th[row] tlnoremenu tn[ext] ts[elect] undoj[oin] up[date] vi[sual] viu[sage] wh[ile] wp[revious] xa[ll] xprop z[^.=]
|
||||
syn keyword vimCommand contained al[l]
|
||||
syn match vimCommand contained "\<z[-+^.=]\=\>"
|
||||
syn keyword vimStdPlugin contained Arguments Asm Break Cfilter Clear Continue DiffOrig Evaluate Finish Gdb Lfilter Man N[ext] Over P[rint] Program Run S Source Step Stop Termdebug TermdebugCommand TOhtml Winbar XMLent XMLns
|
||||
|
||||
|
||||
@@ -44,9 +44,6 @@ class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
|
||||
except socket.error:
|
||||
print("=== socket error ===")
|
||||
break
|
||||
except IOError:
|
||||
print("=== socket closed ===")
|
||||
break
|
||||
if data == '':
|
||||
print("=== socket closed ===")
|
||||
break
|
||||
|
||||
+4
-1
@@ -2,6 +2,7 @@
|
||||
# Edit the src/po/vim.desktop.in file instead.
|
||||
[Desktop Entry]
|
||||
# Translators: This is the Application Name used in the Vim desktop file
|
||||
Name[ca]=Vim
|
||||
Name[de]=Vim
|
||||
Name[eo]=Vim
|
||||
Name[fi]=Vim
|
||||
@@ -13,6 +14,7 @@ Name[sr]=Vim
|
||||
Name[tr]=Vim
|
||||
Name=Vim
|
||||
# Translators: This is the Generic Application Name used in the Vim desktop file
|
||||
GenericName[ca]=Editor de text
|
||||
GenericName[de]=Texteditor
|
||||
GenericName[eo]=Tekstoredaktilo
|
||||
GenericName[fi]=Tekstinmuokkain
|
||||
@@ -25,6 +27,7 @@ GenericName[sr]=Едитор текст
|
||||
GenericName[tr]=Metin Düzenleyici
|
||||
GenericName=Text Editor
|
||||
# Translators: This is the comment used in the Vim desktop file
|
||||
Comment[ca]=Edita fitxers de text
|
||||
Comment[de]=Textdateien bearbeiten
|
||||
Comment[eo]=Redakti tekstajn dosierojn
|
||||
Comment[fi]=Muokkaa tekstitiedostoja
|
||||
@@ -49,7 +52,6 @@ Comment[be]=Рэдагаваньне тэкставых файлаў
|
||||
Comment[bg]=Редактиране на текстови файлове
|
||||
Comment[bn]=টেক্স্ট ফাইল এডিট করুন
|
||||
Comment[bs]=Izmijeni tekstualne datoteke
|
||||
Comment[ca]=Edita fitxers de text
|
||||
Comment[cs]=Úprava textových souborů
|
||||
Comment[cy]=Golygu ffeiliau testun
|
||||
Comment[da]=Rediger tekstfiler
|
||||
@@ -105,6 +107,7 @@ Exec=vim %F
|
||||
Terminal=true
|
||||
Type=Application
|
||||
# Translators: Search terms to find this application. Do NOT change the semicolons! The list MUST also end with a semicolon!
|
||||
Keywords[ca]=Text;editor;
|
||||
Keywords[de]=Text;Editor;
|
||||
Keywords[eo]=Teksto;redaktilo;
|
||||
Keywords[fi]=Teksti;muokkain;editori;
|
||||
|
||||
+2
-2
@@ -2501,11 +2501,11 @@ installpack: $(DEST_VIM) $(DEST_RT) $(DEST_PACK)
|
||||
chmod $(FILEMOD) `find $(DEST_PACK) -type f -print`
|
||||
|
||||
# install the tutor files
|
||||
installtutorbin: $(DEST_VIM)
|
||||
installtutorbin: $(DEST_BIN)
|
||||
$(INSTALL_DATA) vimtutor $(DEST_BIN)/$(VIMNAME)tutor
|
||||
chmod $(SCRIPTMOD) $(DEST_BIN)/$(VIMNAME)tutor
|
||||
|
||||
installgtutorbin: $(DEST_VIM)
|
||||
installgtutorbin: $(DEST_BIN)
|
||||
$(INSTALL_DATA) gvimtutor $(DEST_BIN)/$(GVIMNAME)tutor
|
||||
chmod $(SCRIPTMOD) $(DEST_BIN)/$(GVIMNAME)tutor
|
||||
|
||||
|
||||
+1
-1
@@ -845,7 +845,7 @@ ga_concat(garray_T *gap, char_u *s)
|
||||
void
|
||||
ga_concat_len(garray_T *gap, char_u *s, size_t len)
|
||||
{
|
||||
if (s == NULL || *s == NUL)
|
||||
if (s == NULL || *s == NUL || len == 0)
|
||||
return;
|
||||
if (ga_grow(gap, (int)len) == OK)
|
||||
{
|
||||
|
||||
+1
-1
@@ -2507,7 +2507,7 @@ ex_loadkeymap(exarg_T *eap)
|
||||
int i;
|
||||
char_u *save_cpo = p_cpo;
|
||||
|
||||
if (!getline_equal(eap->getline, eap->cookie, getsourceline))
|
||||
if (!sourcing_a_script(eap))
|
||||
{
|
||||
emsg(_(e_using_loadkeymap_not_in_sourced_file));
|
||||
return;
|
||||
|
||||
+28
-4
@@ -1463,11 +1463,14 @@ win_update(win_T *wp)
|
||||
#ifdef FEAT_SYN_HL
|
||||
// remember what happened to the previous line, to know if
|
||||
// check_visual_highlight() can be used
|
||||
#define DID_NONE 1 // didn't update a line
|
||||
#define DID_LINE 2 // updated a normal line
|
||||
#define DID_FOLD 3 // updated a folded line
|
||||
# define DID_NONE 1 // didn't update a line
|
||||
# define DID_LINE 2 // updated a normal line
|
||||
# define DID_FOLD 3 // updated a folded line
|
||||
int did_update = DID_NONE;
|
||||
linenr_T syntax_last_parsed = 0; // last parsed text line
|
||||
// remember the current w_last_cursorline, it changes when drawing the new
|
||||
// cursor line
|
||||
linenr_T last_cursorline = wp->w_last_cursorline;
|
||||
#endif
|
||||
linenr_T mod_top = 0;
|
||||
linenr_T mod_bot = 0;
|
||||
@@ -2244,7 +2247,7 @@ win_update(win_T *wp)
|
||||
))))
|
||||
#ifdef FEAT_SYN_HL
|
||||
|| (wp->w_p_cul && (lnum == wp->w_cursor.lnum
|
||||
|| lnum == wp->w_last_cursorline))
|
||||
|| lnum == last_cursorline))
|
||||
#endif
|
||||
)
|
||||
{
|
||||
@@ -3027,6 +3030,23 @@ redraw_asap(int type)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_SYN_HL) || defined(PROTO)
|
||||
/*
|
||||
* Check if the cursor moved and 'cursorline' is set. Mark for a VALID redraw
|
||||
* if needed.
|
||||
*/
|
||||
void
|
||||
check_redraw_cursorline(void)
|
||||
{
|
||||
// When 'cursorlineopt' is "screenline" need to redraw always.
|
||||
if (curwin->w_p_cul
|
||||
&& (curwin->w_last_cursorline != curwin->w_cursor.lnum
|
||||
|| (curwin->w_p_culopt_flags & CULOPT_SCRLINE))
|
||||
&& !char_avail())
|
||||
redraw_later(VALID);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Invoked after an asynchronous callback is called.
|
||||
* If an echo command was used the cursor needs to be put back where
|
||||
@@ -3071,6 +3091,10 @@ redraw_after_callback(int call_update_screen, int do_message)
|
||||
}
|
||||
else if (State & (NORMAL | INSERT | TERMINAL))
|
||||
{
|
||||
#ifdef FEAT_SYN_HL
|
||||
// might need to update for 'cursorline'
|
||||
check_redraw_cursorline();
|
||||
#endif
|
||||
// keep the command line if possible
|
||||
update_screen(VALID_NO_UPDATE);
|
||||
setcursor();
|
||||
|
||||
+1
-1
@@ -140,7 +140,7 @@ fill_evalarg_from_eap(evalarg_T *evalarg, exarg_T *eap, int skip)
|
||||
if (eap != NULL)
|
||||
{
|
||||
evalarg->eval_cstack = eap->cstack;
|
||||
if (getline_equal(eap->getline, eap->cookie, getsourceline))
|
||||
if (sourcing_a_script(eap))
|
||||
{
|
||||
evalarg->eval_getline = eap->getline;
|
||||
evalarg->eval_cookie = eap->cookie;
|
||||
|
||||
+8
-24
@@ -1806,20 +1806,14 @@ do_unlet_var(
|
||||
&& value_check_lock(lp->ll_dict->dv_lock, lp->ll_name, FALSE)))
|
||||
return FAIL;
|
||||
else if (lp->ll_range)
|
||||
{
|
||||
if (list_unlet_range(lp->ll_list, lp->ll_li, lp->ll_name, lp->ll_n1,
|
||||
!lp->ll_empty2, lp->ll_n2) == FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
list_unlet_range(lp->ll_list, lp->ll_li, lp->ll_n1,
|
||||
!lp->ll_empty2, lp->ll_n2);
|
||||
else if (lp->ll_list != NULL)
|
||||
// unlet a List item.
|
||||
listitem_remove(lp->ll_list, lp->ll_li);
|
||||
else
|
||||
{
|
||||
if (lp->ll_list != NULL)
|
||||
// unlet a List item.
|
||||
listitem_remove(lp->ll_list, lp->ll_li);
|
||||
else
|
||||
// unlet a Dictionary item.
|
||||
dictitem_remove(lp->ll_dict, lp->ll_di);
|
||||
}
|
||||
// unlet a Dictionary item.
|
||||
dictitem_remove(lp->ll_dict, lp->ll_di);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1828,11 +1822,10 @@ do_unlet_var(
|
||||
* Unlet one item or a range of items from a list.
|
||||
* Return OK or FAIL.
|
||||
*/
|
||||
int
|
||||
void
|
||||
list_unlet_range(
|
||||
list_T *l,
|
||||
listitem_T *li_first,
|
||||
char_u *name,
|
||||
long n1_arg,
|
||||
int has_n2,
|
||||
long n2)
|
||||
@@ -1840,14 +1833,6 @@ list_unlet_range(
|
||||
listitem_T *li = li_first;
|
||||
int n1 = n1_arg;
|
||||
|
||||
while (li != NULL && (!has_n2 || n2 >= n1))
|
||||
{
|
||||
if (value_check_lock(li->li_tv.v_lock, name, FALSE))
|
||||
return FAIL;
|
||||
li = li->li_next;
|
||||
++n1;
|
||||
}
|
||||
|
||||
// Delete a range of List items.
|
||||
li = li_first;
|
||||
n1 = n1_arg;
|
||||
@@ -1859,7 +1844,6 @@ list_unlet_range(
|
||||
li = next;
|
||||
++n1;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
/*
|
||||
* "unlet" a variable. Return OK if it existed, FAIL if not.
|
||||
|
||||
+2
-2
@@ -1434,8 +1434,8 @@ EXCMD(CMD_snoremenu, "snoremenu", ex_menu,
|
||||
EX_RANGE|EX_ZEROR|EX_EXTRA|EX_TRLBAR|EX_NOTRLCOM|EX_CTRLV|EX_CMDWIN|EX_LOCK_OK,
|
||||
ADDR_OTHER),
|
||||
EXCMD(CMD_source, "source", ex_source,
|
||||
EX_BANG|EX_FILE1|EX_TRLBAR|EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK,
|
||||
ADDR_NONE),
|
||||
EX_RANGE|EX_DFLALL|EX_BANG|EX_FILE1|EX_TRLBAR|EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK,
|
||||
ADDR_LINES),
|
||||
EXCMD(CMD_sort, "sort", ex_sort,
|
||||
EX_RANGE|EX_DFLALL|EX_WHOLEFOLD|EX_BANG|EX_EXTRA|EX_NOTRLCOM|EX_MODIFY,
|
||||
ADDR_LINES),
|
||||
|
||||
+1
-1
@@ -1107,7 +1107,7 @@ adjustment_value_changed(GtkAdjustment *adjustment, gpointer data)
|
||||
{
|
||||
dragging = TRUE;
|
||||
|
||||
if (sb->wp != NULL)
|
||||
if (sb->wp != NULL && GDK_IS_DRAWABLE(sb->id->window))
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
|
||||
+15
-12
@@ -557,19 +557,16 @@ ServerWait(
|
||||
|
||||
#define UI_MSEC_DELAY 53
|
||||
#define SEND_MSEC_POLL 500
|
||||
#ifndef HAVE_SELECT
|
||||
#ifdef HAVE_SELECT
|
||||
fd_set fds;
|
||||
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(ConnectionNumber(dpy), &fds);
|
||||
#else
|
||||
struct pollfd fds;
|
||||
|
||||
fds.fd = ConnectionNumber(dpy);
|
||||
fds.events = POLLIN;
|
||||
#else
|
||||
fd_set fds;
|
||||
struct timeval tv;
|
||||
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = SEND_MSEC_POLL * 1000;
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(ConnectionNumber(dpy), &fds);
|
||||
#endif
|
||||
|
||||
time(&start);
|
||||
@@ -594,11 +591,17 @@ ServerWait(
|
||||
// Just look out for the answer without calling back into Vim
|
||||
if (localLoop)
|
||||
{
|
||||
#ifndef HAVE_SELECT
|
||||
if (poll(&fds, 1, SEND_MSEC_POLL) < 0)
|
||||
#ifdef HAVE_SELECT
|
||||
struct timeval tv;
|
||||
|
||||
// Set the time every call, select() may change it to the remaining
|
||||
// time.
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = SEND_MSEC_POLL * 1000;
|
||||
if (select(FD_SETSIZE, &fds, NULL, NULL, &tv) < 0)
|
||||
break;
|
||||
#else
|
||||
if (select(FD_SETSIZE, &fds, NULL, NULL, &tv) < 0)
|
||||
if (poll(&fds, 1, SEND_MSEC_POLL) < 0)
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
+1
-6
@@ -1456,12 +1456,7 @@ main_loop(
|
||||
|
||||
#ifdef FEAT_SYN_HL
|
||||
// Might need to update for 'cursorline'.
|
||||
// When 'cursorlineopt' is "screenline" need to redraw always.
|
||||
if (curwin->w_p_cul
|
||||
&& (curwin->w_last_cursorline != curwin->w_cursor.lnum
|
||||
|| (curwin->w_p_culopt_flags & CULOPT_SCRLINE))
|
||||
&& !char_avail())
|
||||
redraw_later(VALID);
|
||||
check_redraw_cursorline();
|
||||
#endif
|
||||
if (VIsual_active)
|
||||
update_curbuf(INVERTED); // update inverted part
|
||||
|
||||
+6983
-3793
File diff suppressed because it is too large
Load Diff
@@ -20,7 +20,6 @@ Comment[be]=Рэдагаваньне тэкставых файлаў
|
||||
Comment[bg]=Редактиране на текстови файлове
|
||||
Comment[bn]=টেক্স্ট ফাইল এডিট করুন
|
||||
Comment[bs]=Izmijeni tekstualne datoteke
|
||||
Comment[ca]=Edita fitxers de text
|
||||
Comment[cs]=Úprava textových souborů
|
||||
Comment[cy]=Golygu ffeiliau testun
|
||||
Comment[da]=Rediger tekstfiler
|
||||
|
||||
@@ -20,7 +20,6 @@ Comment[be]=Рэдагаваньне тэкставых файлаў
|
||||
Comment[bg]=Редактиране на текстови файлове
|
||||
Comment[bn]=টেক্স্ট ফাইল এডিট করুন
|
||||
Comment[bs]=Izmijeni tekstualne datoteke
|
||||
Comment[ca]=Edita fitxers de text
|
||||
Comment[cs]=Úprava textových souborů
|
||||
Comment[cy]=Golygu ffeiliau testun
|
||||
Comment[da]=Rediger tekstfiler
|
||||
|
||||
@@ -8,6 +8,7 @@ void update_curbuf(int type);
|
||||
void update_debug_sign(buf_T *buf, linenr_T lnum);
|
||||
void updateWindow(win_T *wp);
|
||||
int redraw_asap(int type);
|
||||
void check_redraw_cursorline(void);
|
||||
void redraw_after_callback(int call_update_screen, int do_message);
|
||||
void redraw_later(int type);
|
||||
void redraw_win_later(win_T *wp, int type);
|
||||
|
||||
@@ -23,7 +23,7 @@ void list_hashtable_vars(hashtab_T *ht, char *prefix, int empty, int *first);
|
||||
void ex_unlet(exarg_T *eap);
|
||||
void ex_lockvar(exarg_T *eap);
|
||||
void ex_unletlock(exarg_T *eap, char_u *argstart, int deep, int glv_flags, int (*callback)(lval_T *, char_u *, exarg_T *, int, void *), void *cookie);
|
||||
int list_unlet_range(list_T *l, listitem_T *li_first, char_u *name, long n1_arg, int has_n2, long n2);
|
||||
void list_unlet_range(list_T *l, listitem_T *li_first, long n1_arg, int has_n2, long n2);
|
||||
int do_unlet(char_u *name, int forceit);
|
||||
void item_lock(typval_T *tv, int deep, int lock, int check_refcount);
|
||||
void del_menutrans_vars(void);
|
||||
|
||||
@@ -42,4 +42,5 @@ char_u *get_autoload_prefix(scriptitem_T *si);
|
||||
char_u *may_prefix_autoload(char_u *name);
|
||||
char_u *autoload_name(char_u *name);
|
||||
int script_autoload(char_u *name, int reload);
|
||||
int sourcing_a_script(exarg_T *eap);
|
||||
/* vim: set ft=c : */
|
||||
|
||||
@@ -19,8 +19,8 @@ int generate_PUSHBOOL(cctx_T *cctx, varnumber_T number);
|
||||
int generate_PUSHSPEC(cctx_T *cctx, varnumber_T number);
|
||||
int generate_PUSHF(cctx_T *cctx, float_T fnumber);
|
||||
int generate_PUSHS(cctx_T *cctx, char_u **str);
|
||||
int generate_PUSHCHANNEL(cctx_T *cctx, channel_T *channel);
|
||||
int generate_PUSHJOB(cctx_T *cctx, job_T *job);
|
||||
int generate_PUSHCHANNEL(cctx_T *cctx);
|
||||
int generate_PUSHJOB(cctx_T *cctx);
|
||||
int generate_PUSHBLOB(cctx_T *cctx, blob_T *blob);
|
||||
int generate_PUSHFUNC(cctx_T *cctx, char_u *name, type_T *type);
|
||||
int generate_AUTOLOAD(cctx_T *cctx, char_u *name, type_T *type);
|
||||
|
||||
+4
-1
@@ -1653,8 +1653,11 @@ nfa_regatom(void)
|
||||
long_u tmp;
|
||||
|
||||
if (cur)
|
||||
{
|
||||
semsg(_(e_regexp_number_after_dot_pos_search),
|
||||
no_Magic(c));
|
||||
no_Magic(c));
|
||||
return FAIL;
|
||||
}
|
||||
tmp = n * 10 + (c - '0');
|
||||
|
||||
if (tmp < n)
|
||||
|
||||
+1
-2
@@ -1330,8 +1330,7 @@ op_yank(oparg_T *oap, int deleting, int mess)
|
||||
vim_free(y_current->y_array);
|
||||
y_current = curr;
|
||||
}
|
||||
if (curwin->w_p_rnu)
|
||||
redraw_later(SOME_VALID); // cursor moved to start
|
||||
|
||||
if (mess) // Display message about yank?
|
||||
{
|
||||
if (yanktype == MCHAR
|
||||
|
||||
+279
-6
@@ -18,6 +18,11 @@
|
||||
static garray_T ga_loaded = {0, 0, sizeof(char_u *), 4, NULL};
|
||||
#endif
|
||||
|
||||
// last used sequence number for sourcing scripts (current_sctx.sc_seq)
|
||||
#ifdef FEAT_EVAL
|
||||
static int last_current_SID_seq = 0;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Initialize the execution stack.
|
||||
*/
|
||||
@@ -1074,12 +1079,270 @@ ExpandPackAddDir(
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Cookie used to source Ex commands from a buffer.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
garray_T lines_to_source;
|
||||
int lnum;
|
||||
linenr_T sourcing_lnum;
|
||||
} bufline_cookie_T;
|
||||
|
||||
/*
|
||||
* Concatenate a Vim script line if it starts with a line continuation into a
|
||||
* growarray (excluding the continuation chars and leading whitespace).
|
||||
* Growsize of the growarray may be changed to speed up concatenations!
|
||||
*
|
||||
* Returns TRUE if this line did begin with a continuation (the next line
|
||||
* should also be considered, if it exists); FALSE otherwise.
|
||||
*/
|
||||
static int
|
||||
concat_continued_line(
|
||||
garray_T *ga,
|
||||
int init_growsize,
|
||||
char_u *nextline,
|
||||
int options)
|
||||
{
|
||||
int comment_char = in_vim9script() ? '#' : '"';
|
||||
char_u *p = skipwhite(nextline);
|
||||
int contline;
|
||||
int do_vim9_all = in_vim9script()
|
||||
&& options == GETLINE_CONCAT_ALL;
|
||||
int do_bar_cont = do_vim9_all
|
||||
|| options == GETLINE_CONCAT_CONTBAR;
|
||||
|
||||
if (*p == NUL)
|
||||
return FALSE;
|
||||
|
||||
// Concatenate the next line when it starts with a backslash.
|
||||
/* Also check for a comment in between continuation lines: "\ */
|
||||
// Also check for a Vim9 comment, empty line, line starting with '|',
|
||||
// but not "||".
|
||||
if ((p[0] == comment_char && p[1] == '\\' && p[2] == ' ')
|
||||
|| (do_vim9_all && (*p == NUL
|
||||
|| vim9_comment_start(p))))
|
||||
return TRUE;
|
||||
|
||||
contline = (*p == '\\' || (do_bar_cont && p[0] == '|' && p[1] != '|'));
|
||||
if (!contline)
|
||||
return FALSE;
|
||||
|
||||
// Adjust the growsize to the current length to speed up concatenating many
|
||||
// lines.
|
||||
if (ga->ga_len > init_growsize)
|
||||
ga->ga_growsize = ga->ga_len > 8000 ? 8000 : ga->ga_len;
|
||||
if (*p == '\\')
|
||||
ga_concat(ga, (char_u *)p + 1);
|
||||
else if (*p == '|')
|
||||
{
|
||||
ga_concat(ga, (char_u *)" ");
|
||||
ga_concat(ga, p);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get one full line from a sourced string (in-memory, no file).
|
||||
* Called by do_cmdline() when it's called from source_using_linegetter().
|
||||
*
|
||||
* Returns a pointer to allocated line, or NULL for end-of-file.
|
||||
*/
|
||||
static char_u *
|
||||
source_getbufline(
|
||||
int c UNUSED,
|
||||
void *cookie,
|
||||
int indent UNUSED,
|
||||
getline_opt_T opts)
|
||||
{
|
||||
bufline_cookie_T *p = cookie;
|
||||
char_u *line;
|
||||
garray_T ga;
|
||||
|
||||
SOURCING_LNUM = p->sourcing_lnum + 1;
|
||||
|
||||
if (p->lnum >= p->lines_to_source.ga_len)
|
||||
return NULL;
|
||||
line = ((char_u **)p->lines_to_source.ga_data)[p->lnum];
|
||||
|
||||
ga_init2(&ga, sizeof(char_u), 400);
|
||||
ga_concat(&ga, (char_u *)line);
|
||||
p->lnum++;
|
||||
|
||||
if ((opts != GETLINE_NONE) && vim_strchr(p_cpo, CPO_CONCAT) == NULL)
|
||||
{
|
||||
while (p->lnum < p->lines_to_source.ga_len)
|
||||
{
|
||||
line = ((char_u **)p->lines_to_source.ga_data)[p->lnum];
|
||||
if (!concat_continued_line(&ga, 400, line, opts))
|
||||
break;
|
||||
p->sourcing_lnum++;
|
||||
p->lnum++;
|
||||
}
|
||||
}
|
||||
ga_append(&ga, NUL);
|
||||
p->sourcing_lnum++;
|
||||
|
||||
return ga.ga_data;
|
||||
}
|
||||
|
||||
/*
|
||||
* Source Ex commands from the lines in 'cookie'.
|
||||
*/
|
||||
static int
|
||||
do_sourcebuffer(
|
||||
void *cookie,
|
||||
char_u *scriptname)
|
||||
{
|
||||
char_u *save_sourcing_name = SOURCING_NAME;
|
||||
linenr_T save_sourcing_lnum = SOURCING_LNUM;
|
||||
char_u sourcing_name_buf[256];
|
||||
sctx_T save_current_sctx;
|
||||
#ifdef FEAT_EVAL
|
||||
int sid;
|
||||
funccal_entry_T funccalp_entry;
|
||||
int save_estack_compiling = estack_compiling;
|
||||
scriptitem_T *si = NULL;
|
||||
#endif
|
||||
int save_sticky_cmdmod_flags = sticky_cmdmod_flags;
|
||||
int retval = FAIL;
|
||||
ESTACK_CHECK_DECLARATION
|
||||
|
||||
if (save_sourcing_name == NULL)
|
||||
SOURCING_NAME = (char_u *)scriptname;
|
||||
else
|
||||
{
|
||||
vim_snprintf((char *)sourcing_name_buf, sizeof(sourcing_name_buf),
|
||||
"%s called at %s:%ld", scriptname, save_sourcing_name,
|
||||
save_sourcing_lnum);
|
||||
SOURCING_NAME = sourcing_name_buf;
|
||||
}
|
||||
SOURCING_LNUM = 0;
|
||||
|
||||
// Keep the sourcing name/lnum, for recursive calls.
|
||||
estack_push(ETYPE_SCRIPT, scriptname, 0);
|
||||
ESTACK_CHECK_SETUP
|
||||
|
||||
// "legacy" does not apply to commands in the script
|
||||
sticky_cmdmod_flags = 0;
|
||||
|
||||
save_current_sctx = current_sctx;
|
||||
current_sctx.sc_version = 1; // default script version
|
||||
#ifdef FEAT_EVAL
|
||||
estack_compiling = FALSE;
|
||||
// Always use a new sequence number.
|
||||
current_sctx.sc_seq = ++last_current_SID_seq;
|
||||
current_sctx.sc_lnum = save_sourcing_lnum;
|
||||
save_funccal(&funccalp_entry);
|
||||
|
||||
sid = find_script_by_name(scriptname);
|
||||
if (sid < 0)
|
||||
{
|
||||
int error = OK;
|
||||
|
||||
// First time sourcing this buffer, create a new script item.
|
||||
|
||||
sid = get_new_scriptitem(&error);
|
||||
if (error == FAIL)
|
||||
goto theend;
|
||||
current_sctx.sc_sid = sid;
|
||||
si = SCRIPT_ITEM(current_sctx.sc_sid);
|
||||
si->sn_name = vim_strsave(scriptname);
|
||||
si->sn_state = SN_STATE_NEW;
|
||||
}
|
||||
else
|
||||
{
|
||||
// the buffer was sourced previously, reuse the script ID.
|
||||
current_sctx.sc_sid = sid;
|
||||
si = SCRIPT_ITEM(current_sctx.sc_sid);
|
||||
si->sn_state = SN_STATE_RELOAD;
|
||||
}
|
||||
#endif
|
||||
|
||||
retval = do_cmdline(NULL, source_getbufline, cookie,
|
||||
DOCMD_VERBOSE | DOCMD_NOWAIT | DOCMD_REPEAT);
|
||||
|
||||
if (got_int)
|
||||
emsg(_(e_interrupted));
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
theend:
|
||||
#endif
|
||||
ESTACK_CHECK_NOW
|
||||
estack_pop();
|
||||
current_sctx = save_current_sctx;
|
||||
SOURCING_LNUM = save_sourcing_lnum;
|
||||
SOURCING_NAME = save_sourcing_name;
|
||||
sticky_cmdmod_flags = save_sticky_cmdmod_flags;
|
||||
#ifdef FEAT_EVAL
|
||||
restore_funccal();
|
||||
estack_compiling = save_estack_compiling;
|
||||
#endif
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* :source Ex commands from the current buffer
|
||||
*/
|
||||
static void
|
||||
cmd_source_buffer(exarg_T *eap)
|
||||
{
|
||||
char_u *line = NULL;
|
||||
linenr_T curr_lnum;
|
||||
bufline_cookie_T cp;
|
||||
char_u sname[32];
|
||||
|
||||
if (curbuf == NULL)
|
||||
return;
|
||||
|
||||
// Use ":source buffer=<num>" as the script name
|
||||
vim_snprintf((char *)sname, sizeof(sname), ":source buffer=%d",
|
||||
curbuf->b_fnum);
|
||||
|
||||
ga_init2(&cp.lines_to_source, sizeof(char_u *), 100);
|
||||
|
||||
// Copy the lines from the buffer into a grow array
|
||||
for (curr_lnum = eap->line1; curr_lnum <= eap->line2; curr_lnum++)
|
||||
{
|
||||
line = vim_strsave(ml_get(curr_lnum));
|
||||
if (line == NULL)
|
||||
goto errret;
|
||||
if (ga_add_string(&cp.lines_to_source, line) == FAIL)
|
||||
goto errret;
|
||||
line = NULL;
|
||||
}
|
||||
cp.sourcing_lnum = 0;
|
||||
cp.lnum = 0;
|
||||
|
||||
// Execute the Ex commands
|
||||
do_sourcebuffer((void *)&cp, (char_u *)sname);
|
||||
|
||||
errret:
|
||||
vim_free(line);
|
||||
ga_clear_strings(&cp.lines_to_source);
|
||||
}
|
||||
|
||||
static void
|
||||
cmd_source(char_u *fname, exarg_T *eap)
|
||||
{
|
||||
if (*fname == NUL)
|
||||
emsg(_(e_argument_required));
|
||||
if (*fname != NUL && eap != NULL && eap->addr_count > 0)
|
||||
{
|
||||
// if a filename is specified to :source, then a range is not allowed
|
||||
emsg(_(e_no_range_allowed));
|
||||
return;
|
||||
}
|
||||
|
||||
if (eap != NULL && *fname == NUL)
|
||||
{
|
||||
if (eap->forceit)
|
||||
// a file name is needed to source normal mode commands
|
||||
emsg(_(e_argument_required));
|
||||
else
|
||||
// source ex commands from the current buffer
|
||||
cmd_source_buffer(eap);
|
||||
}
|
||||
else if (eap != NULL && eap->forceit)
|
||||
// ":source!": read Normal mode commands
|
||||
// Need to execute the commands directly. This is required at least
|
||||
@@ -1240,7 +1503,6 @@ do_source(
|
||||
int retval = FAIL;
|
||||
sctx_T save_current_sctx;
|
||||
#ifdef FEAT_EVAL
|
||||
static int last_current_SID_seq = 0;
|
||||
funccal_entry_T funccalp_entry;
|
||||
int save_debug_break_level = debug_break_level;
|
||||
int sid;
|
||||
@@ -2015,6 +2277,17 @@ getsourceline(
|
||||
return line;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns TRUE if sourcing a script either from a file or a buffer.
|
||||
* Otherwise returns FALSE.
|
||||
*/
|
||||
int
|
||||
sourcing_a_script(exarg_T *eap)
|
||||
{
|
||||
return (getline_equal(eap->getline, eap->cookie, getsourceline)
|
||||
|| getline_equal(eap->getline, eap->cookie, source_getbufline));
|
||||
}
|
||||
|
||||
/*
|
||||
* ":scriptencoding": Set encoding conversion for a sourced script.
|
||||
*/
|
||||
@@ -2024,7 +2297,7 @@ ex_scriptencoding(exarg_T *eap)
|
||||
source_cookie_T *sp;
|
||||
char_u *name;
|
||||
|
||||
if (!getline_equal(eap->getline, eap->cookie, getsourceline))
|
||||
if (!sourcing_a_script(eap))
|
||||
{
|
||||
emsg(_(e_scriptencoding_used_outside_of_sourced_file));
|
||||
return;
|
||||
@@ -2055,7 +2328,7 @@ ex_scriptversion(exarg_T *eap UNUSED)
|
||||
{
|
||||
int nr;
|
||||
|
||||
if (!getline_equal(eap->getline, eap->cookie, getsourceline))
|
||||
if (!sourcing_a_script(eap))
|
||||
{
|
||||
emsg(_(e_scriptversion_used_outside_of_sourced_file));
|
||||
return;
|
||||
@@ -2087,7 +2360,7 @@ ex_scriptversion(exarg_T *eap UNUSED)
|
||||
void
|
||||
ex_finish(exarg_T *eap)
|
||||
{
|
||||
if (getline_equal(eap->getline, eap->cookie, getsourceline))
|
||||
if (sourcing_a_script(eap))
|
||||
do_finish(eap, FALSE);
|
||||
else
|
||||
emsg(_(e_finish_used_outside_of_sourced_file));
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
|a+0&#ffffff0@4| @69
|
||||
>b+8&&@4| @69
|
||||
|c+0&&@4| @69
|
||||
|d@4| @69
|
||||
|~+0#4040ff13&| @73
|
||||
|~| @73
|
||||
|~| @73
|
||||
| +0#0000000&@56|4|,|1| @10|A|l@1|
|
||||
@@ -428,6 +428,9 @@ else
|
||||
endtry
|
||||
endif
|
||||
|
||||
" Delete the .res file, it may change behavior for completion
|
||||
call delete(fnamemodify(g:testname, ':r') .. '.res')
|
||||
|
||||
" Locate Test_ functions and execute them.
|
||||
redir @q
|
||||
silent function /^Test_
|
||||
|
||||
@@ -247,4 +247,30 @@ END
|
||||
call delete('Xtextfile')
|
||||
endfunc
|
||||
|
||||
func Test_cursorline_callback()
|
||||
CheckScreendump
|
||||
CheckFeature timers
|
||||
|
||||
let lines =<< trim END
|
||||
call setline(1, ['aaaaa', 'bbbbb', 'ccccc', 'ddddd'])
|
||||
set cursorline
|
||||
call cursor(4, 1)
|
||||
|
||||
func Func(timer)
|
||||
call cursor(2, 1)
|
||||
endfunc
|
||||
|
||||
call timer_start(300, 'Func')
|
||||
END
|
||||
call writefile(lines, 'Xcul_timer')
|
||||
|
||||
let buf = RunVimInTerminal('-S Xcul_timer', #{rows: 8})
|
||||
call TermWait(buf, 310)
|
||||
call VerifyScreenDump(buf, 'Test_cursorline_callback_1', {})
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
call delete('Xcul_timer')
|
||||
endfunc
|
||||
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
@@ -721,10 +721,13 @@ func Test_list_locked_var_unlet()
|
||||
endfor
|
||||
endfor
|
||||
|
||||
" Deleting a list range should fail if the range is locked
|
||||
" Deleting a list range with locked items works, but changing the items
|
||||
" fails.
|
||||
let l = [1, 2, 3, 4]
|
||||
lockvar l[1:2]
|
||||
call assert_fails('unlet l[1:2]', 'E741:')
|
||||
call assert_fails('let l[1:2] = [8, 9]', 'E741:')
|
||||
unlet l[1:2]
|
||||
call assert_equal([1, 4], l)
|
||||
unlet l
|
||||
endfunc
|
||||
|
||||
|
||||
@@ -1192,4 +1192,27 @@ func Test_lua_multiple_commands()
|
||||
augroup! Luagroup
|
||||
endfunc
|
||||
|
||||
func Test_lua_debug()
|
||||
CheckRunVimInTerminal
|
||||
|
||||
let buf = RunVimInTerminal('', {'rows': 10})
|
||||
call term_sendkeys(buf, ":lua debug.debug()\n")
|
||||
call WaitForAssert({-> assert_equal('lua_debug> ', term_getline(buf, 10))})
|
||||
|
||||
call term_sendkeys(buf, "foo = 42\n")
|
||||
call WaitForAssert({-> assert_equal('lua_debug> foo = 42', term_getline(buf, 9))})
|
||||
call WaitForAssert({-> assert_equal('lua_debug> ', term_getline(buf, 10))})
|
||||
|
||||
call term_sendkeys(buf, "print(foo)\n")
|
||||
call WaitForAssert({-> assert_equal('lua_debug> print(foo)', term_getline(buf, 8))})
|
||||
call WaitForAssert({-> assert_equal('42', term_getline(buf, 9))})
|
||||
call WaitForAssert({-> assert_equal('lua_debug> ', term_getline(buf, 10))})
|
||||
|
||||
call term_sendkeys(buf, "cont\n")
|
||||
call WaitForAssert({-> assert_match(' All$', term_getline(buf, 10))})
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
call delete('XtestLuaDebug.vim')
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
@@ -94,6 +94,12 @@ func Test_source_error()
|
||||
call assert_fails('scriptencoding utf-8', 'E167:')
|
||||
call assert_fails('finish', 'E168:')
|
||||
call assert_fails('scriptversion 2', 'E984:')
|
||||
call assert_fails('source!', 'E471:')
|
||||
new
|
||||
call setline(1, ['', '', '', ''])
|
||||
call assert_fails('1,3source Xscript.vim', 'E481:')
|
||||
call assert_fails('1,3source! Xscript.vim', 'E481:')
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
" Test for sourcing a script recursively
|
||||
@@ -110,4 +116,233 @@ func Test_nested_script()
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
" Test for sourcing a script from the current buffer
|
||||
func Test_source_buffer()
|
||||
new
|
||||
" Source a simple script
|
||||
let lines =<< trim END
|
||||
let a = "Test"
|
||||
let b = 20
|
||||
|
||||
let c = [1.1]
|
||||
END
|
||||
call setline(1, lines)
|
||||
source
|
||||
call assert_equal(['Test', 20, [1.1]], [g:a, g:b, g:c])
|
||||
|
||||
" Source a range of lines in the current buffer
|
||||
%d _
|
||||
let lines =<< trim END
|
||||
let a = 10
|
||||
let a += 20
|
||||
let a += 30
|
||||
let a += 40
|
||||
END
|
||||
call setline(1, lines)
|
||||
.source
|
||||
call assert_equal(10, g:a)
|
||||
3source
|
||||
call assert_equal(40, g:a)
|
||||
2,3source
|
||||
call assert_equal(90, g:a)
|
||||
|
||||
" Source a script with line continuation lines
|
||||
%d _
|
||||
let lines =<< trim END
|
||||
let m = [
|
||||
\ 1,
|
||||
\ 2,
|
||||
\ ]
|
||||
call add(m, 3)
|
||||
END
|
||||
call setline(1, lines)
|
||||
source
|
||||
call assert_equal([1, 2, 3], g:m)
|
||||
" Source a script with line continuation lines and a comment
|
||||
%d _
|
||||
let lines =<< trim END
|
||||
let m = [
|
||||
"\ first entry
|
||||
\ 'a',
|
||||
"\ second entry
|
||||
\ 'b',
|
||||
\ ]
|
||||
" third entry
|
||||
call add(m, 'c')
|
||||
END
|
||||
call setline(1, lines)
|
||||
source
|
||||
call assert_equal(['a', 'b', 'c'], g:m)
|
||||
" Source an incomplete line continuation line
|
||||
%d _
|
||||
let lines =<< trim END
|
||||
let k = [
|
||||
\
|
||||
END
|
||||
call setline(1, lines)
|
||||
call assert_fails('source', 'E697:')
|
||||
" Source a function with a for loop
|
||||
%d _
|
||||
let lines =<< trim END
|
||||
let m = []
|
||||
" test function
|
||||
func! Xtest()
|
||||
for i in range(5, 7)
|
||||
call add(g:m, i)
|
||||
endfor
|
||||
endfunc
|
||||
call Xtest()
|
||||
END
|
||||
call setline(1, lines)
|
||||
source
|
||||
call assert_equal([5, 6, 7], g:m)
|
||||
" Source an empty buffer
|
||||
%d _
|
||||
source
|
||||
|
||||
" test for script local functions and variables
|
||||
let lines =<< trim END
|
||||
let s:var1 = 10
|
||||
func s:F1()
|
||||
let s:var1 += 1
|
||||
return s:var1
|
||||
endfunc
|
||||
func s:F2()
|
||||
endfunc
|
||||
let g:ScriptID = expand("<SID>")
|
||||
END
|
||||
call setline(1, lines)
|
||||
source
|
||||
call assert_true(g:ScriptID != '')
|
||||
call assert_true(exists('*' .. g:ScriptID .. 'F1'))
|
||||
call assert_true(exists('*' .. g:ScriptID .. 'F2'))
|
||||
call assert_equal(11, call(g:ScriptID .. 'F1', []))
|
||||
|
||||
" the same script ID should be used even if the buffer is sourced more than
|
||||
" once
|
||||
%d _
|
||||
let lines =<< trim END
|
||||
let g:ScriptID = expand("<SID>")
|
||||
let g:Count += 1
|
||||
END
|
||||
call setline(1, lines)
|
||||
let g:Count = 0
|
||||
source
|
||||
call assert_true(g:ScriptID != '')
|
||||
let scid = g:ScriptID
|
||||
source
|
||||
call assert_equal(scid, g:ScriptID)
|
||||
call assert_equal(2, g:Count)
|
||||
source
|
||||
call assert_equal(scid, g:ScriptID)
|
||||
call assert_equal(3, g:Count)
|
||||
|
||||
" test for the script line number
|
||||
%d _
|
||||
let lines =<< trim END
|
||||
" comment
|
||||
let g:Slnum1 = expand("<slnum>")
|
||||
let i = 1 +
|
||||
\ 2 +
|
||||
"\ comment
|
||||
\ 3
|
||||
let g:Slnum2 = expand("<slnum>")
|
||||
END
|
||||
call setline(1, lines)
|
||||
source
|
||||
call assert_equal('2', g:Slnum1)
|
||||
call assert_equal('7', g:Slnum2)
|
||||
|
||||
" test for retaining the same script number across source calls
|
||||
let lines =<< trim END
|
||||
let g:ScriptID1 = expand("<SID>")
|
||||
let g:Slnum1 = expand("<slnum>")
|
||||
let l =<< trim END
|
||||
let g:Slnum2 = expand("<slnum>")
|
||||
let g:ScriptID2 = expand("<SID>")
|
||||
END
|
||||
new
|
||||
call setline(1, l)
|
||||
source
|
||||
bw!
|
||||
let g:ScriptID3 = expand("<SID>")
|
||||
let g:Slnum3 = expand("<slnum>")
|
||||
END
|
||||
call writefile(lines, 'Xscript')
|
||||
source Xscript
|
||||
call assert_true(g:ScriptID1 != g:ScriptID2)
|
||||
call assert_equal(g:ScriptID1, g:ScriptID3)
|
||||
call assert_equal('2', g:Slnum1)
|
||||
call assert_equal('1', g:Slnum2)
|
||||
call assert_equal('12', g:Slnum3)
|
||||
call delete('Xscript')
|
||||
|
||||
" test for sourcing a heredoc
|
||||
%d _
|
||||
let lines =<< trim END
|
||||
let a = 1
|
||||
let heredoc =<< trim DATA
|
||||
red
|
||||
green
|
||||
blue
|
||||
DATA
|
||||
let b = 2
|
||||
END
|
||||
call setline(1, lines)
|
||||
source
|
||||
call assert_equal(['red', ' green', 'blue'], g:heredoc)
|
||||
|
||||
" test for a while and for statement
|
||||
%d _
|
||||
let lines =<< trim END
|
||||
let a = 0
|
||||
let b = 1
|
||||
while b <= 10
|
||||
let a += 10
|
||||
let b += 1
|
||||
endwhile
|
||||
for i in range(5)
|
||||
let a += 10
|
||||
endfor
|
||||
END
|
||||
call setline(1, lines)
|
||||
source
|
||||
call assert_equal(150, g:a)
|
||||
|
||||
" test for sourcing the same buffer multiple times after changing a function
|
||||
%d _
|
||||
let lines =<< trim END
|
||||
func Xtestfunc()
|
||||
return "one"
|
||||
endfunc
|
||||
END
|
||||
call setline(1, lines)
|
||||
source
|
||||
call assert_equal("one", Xtestfunc())
|
||||
call setline(2, ' return "two"')
|
||||
source
|
||||
call assert_equal("two", Xtestfunc())
|
||||
call setline(2, ' return "three"')
|
||||
source
|
||||
call assert_equal("three", Xtestfunc())
|
||||
delfunc Xtestfunc
|
||||
|
||||
" test for sourcing a Vim9 script
|
||||
%d _
|
||||
let lines =<< trim END
|
||||
vim9script
|
||||
|
||||
# check dict
|
||||
var x: number = 10
|
||||
def g:Xtestfunc(): number
|
||||
return x
|
||||
enddef
|
||||
END
|
||||
call setline(1, lines)
|
||||
source
|
||||
call assert_equal(10, Xtestfunc())
|
||||
|
||||
%bw!
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
@@ -2209,6 +2209,11 @@ def Test_unlet()
|
||||
unlet dd[4]
|
||||
assert_equal({b: 2}, dd)
|
||||
|
||||
# null key works like empty string
|
||||
dd = {'': 1, x: 9}
|
||||
unlet dd[null_string]
|
||||
assert_equal({x: 9}, dd)
|
||||
|
||||
# list unlet
|
||||
var ll = [1, 2, 3, 4]
|
||||
unlet ll[1]
|
||||
|
||||
@@ -1573,6 +1573,36 @@ def Test_lockvar()
|
||||
END
|
||||
v9.CheckScriptFailure(lines, 'E741', 2)
|
||||
|
||||
# can unlet a locked list item but not change it
|
||||
lines =<< trim END
|
||||
var ll = [1, 2, 3]
|
||||
lockvar ll[1]
|
||||
unlet ll[1]
|
||||
assert_equal([1, 3], ll)
|
||||
END
|
||||
v9.CheckDefAndScriptSuccess(lines)
|
||||
lines =<< trim END
|
||||
var ll = [1, 2, 3]
|
||||
lockvar ll[1]
|
||||
ll[1] = 9
|
||||
END
|
||||
v9.CheckDefExecAndScriptFailure(lines, ['E1119:', 'E741'], 3)
|
||||
|
||||
# can unlet a locked dict item but not change it
|
||||
lines =<< trim END
|
||||
var dd = {a: 1, b: 2}
|
||||
lockvar dd.a
|
||||
unlet dd.a
|
||||
assert_equal({b: 2}, dd)
|
||||
END
|
||||
v9.CheckDefAndScriptSuccess(lines)
|
||||
lines =<< trim END
|
||||
var dd = {a: 1, b: 2}
|
||||
lockvar dd.a
|
||||
dd.a = 3
|
||||
END
|
||||
v9.CheckDefExecAndScriptFailure(lines, ['E1121:', 'E741'], 3)
|
||||
|
||||
lines =<< trim END
|
||||
var theList = [1, 2, 3]
|
||||
lockvar theList
|
||||
@@ -1630,6 +1660,8 @@ def Test_substitute_expr()
|
||||
v9.CheckDefFailure(['s/from/\="x")/'], 'E488:')
|
||||
v9.CheckDefFailure(['s/from/\="x"/9'], 'E488:')
|
||||
|
||||
v9.CheckDefExecFailure(['s/this/\="that"/'], 'E486:')
|
||||
|
||||
# When calling a function the right instruction list needs to be restored.
|
||||
g:cond = true
|
||||
var lines =<< trim END
|
||||
|
||||
@@ -3312,6 +3312,29 @@ def Test_expr8_call_global()
|
||||
v9.CheckDefAndScriptFailure(lines, 'E117: Unknown function: ExistingGlobal')
|
||||
enddef
|
||||
|
||||
def Test_expr8_autoload_var()
|
||||
var auto_lines =<< trim END
|
||||
let autofile#var = 'found'
|
||||
END
|
||||
mkdir('Xruntime/autoload', 'p')
|
||||
writefile(auto_lines, 'Xruntime/autoload/autofile.vim')
|
||||
var save_rtp = &rtp
|
||||
&rtp = getcwd() .. '/Xruntime,' .. &rtp
|
||||
|
||||
var lines =<< trim END
|
||||
assert_equal('found', autofile#var)
|
||||
END
|
||||
v9.CheckDefAndScriptSuccess(lines)
|
||||
|
||||
lines =<< trim END
|
||||
echo autofile#other
|
||||
END
|
||||
v9.CheckDefExecAndScriptFailure(lines, 'E121: Undefined variable: autofile#other')
|
||||
|
||||
&rtp = save_rtp
|
||||
delete('Xruntime', 'rf')
|
||||
enddef
|
||||
|
||||
def Test_expr8_call_autoload()
|
||||
var auto_lines =<< trim END
|
||||
def g:some#func(): string
|
||||
|
||||
@@ -4085,6 +4085,19 @@ if has('lua')
|
||||
EOF
|
||||
assert_equal('val', g:d.key)
|
||||
enddef
|
||||
|
||||
def Test_lua_heredoc_fails()
|
||||
var lines = [
|
||||
'vim9script',
|
||||
'def ExeLua()',
|
||||
'lua << trim EOLUA',
|
||||
"x = vim.eval('g:nodict')",
|
||||
'EOLUA',
|
||||
'enddef',
|
||||
'ExeLua()',
|
||||
]
|
||||
v9.CheckScriptFailure(lines, 'E121: Undefined variable: g:nodict')
|
||||
enddef
|
||||
endif
|
||||
|
||||
|
||||
|
||||
@@ -1246,6 +1246,37 @@ def Test_cexpr_vimscript()
|
||||
assert_equal(19, getqflist()[0].lnum)
|
||||
END
|
||||
v9.CheckScriptSuccess(lines)
|
||||
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
def CexprFail()
|
||||
au QuickfixCmdPre * echo g:doesnotexist
|
||||
cexpr 'File otherFile line 99'
|
||||
g:didContinue = 'yes'
|
||||
enddef
|
||||
CexprFail()
|
||||
g:didContinue = 'also'
|
||||
END
|
||||
g:didContinue = 'no'
|
||||
v9.CheckScriptFailure(lines, 'E121: Undefined variable: g:doesnotexist')
|
||||
assert_equal('no', g:didContinue)
|
||||
au! QuickfixCmdPre
|
||||
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
def CexprFail()
|
||||
cexpr g:aNumber
|
||||
g:didContinue = 'yes'
|
||||
enddef
|
||||
CexprFail()
|
||||
g:didContinue = 'also'
|
||||
END
|
||||
g:aNumber = 123
|
||||
g:didContinue = 'no'
|
||||
v9.CheckScriptFailure(lines, 'E777: String or List expected')
|
||||
assert_equal('no', g:didContinue)
|
||||
unlet g:didContinue
|
||||
|
||||
set errorformat&
|
||||
enddef
|
||||
|
||||
@@ -1813,6 +1844,10 @@ def Test_echo_cmd()
|
||||
echo str1 str2
|
||||
assert_match('^some more$', g:Screenline(&lines))
|
||||
|
||||
echo "one\ntwo"
|
||||
assert_match('^one$', g:Screenline(&lines - 1))
|
||||
assert_match('^two$', g:Screenline(&lines))
|
||||
|
||||
v9.CheckDefFailure(['echo "xxx"# comment'], 'E488:')
|
||||
enddef
|
||||
|
||||
@@ -2003,6 +2038,12 @@ def Test_for_loop()
|
||||
endfor
|
||||
assert_equal(6, total)
|
||||
|
||||
total = 0
|
||||
for b in 0z010203
|
||||
total += b
|
||||
endfor
|
||||
assert_equal(6, total)
|
||||
|
||||
var chars = ''
|
||||
for s: string in 'foobar'
|
||||
chars ..= s
|
||||
|
||||
@@ -765,6 +765,30 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
4602,
|
||||
/**/
|
||||
4601,
|
||||
/**/
|
||||
4600,
|
||||
/**/
|
||||
4599,
|
||||
/**/
|
||||
4598,
|
||||
/**/
|
||||
4597,
|
||||
/**/
|
||||
4596,
|
||||
/**/
|
||||
4595,
|
||||
/**/
|
||||
4594,
|
||||
/**/
|
||||
4593,
|
||||
/**/
|
||||
4592,
|
||||
/**/
|
||||
4591,
|
||||
/**/
|
||||
4590,
|
||||
/**/
|
||||
|
||||
+2
-2
@@ -87,8 +87,8 @@ typedef enum {
|
||||
ISN_PUSHS, // push string isn_arg.string
|
||||
ISN_PUSHBLOB, // push blob isn_arg.blob
|
||||
ISN_PUSHFUNC, // push func isn_arg.string
|
||||
ISN_PUSHCHANNEL, // push channel isn_arg.channel
|
||||
ISN_PUSHJOB, // push channel isn_arg.job
|
||||
ISN_PUSHCHANNEL, // push NULL channel
|
||||
ISN_PUSHJOB, // push NULL job
|
||||
ISN_NEWLIST, // push list from stack items, size is isn_arg.number
|
||||
ISN_NEWDICT, // push dict from stack items, size is isn_arg.number
|
||||
ISN_NEWPARTIAL, // push NULL partial
|
||||
|
||||
+2
-2
@@ -2238,10 +2238,10 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
|
||||
generate_NEWDICT(cctx, 0);
|
||||
break;
|
||||
case VAR_JOB:
|
||||
generate_PUSHJOB(cctx, NULL);
|
||||
generate_PUSHJOB(cctx);
|
||||
break;
|
||||
case VAR_CHANNEL:
|
||||
generate_PUSHCHANNEL(cctx, NULL);
|
||||
generate_PUSHCHANNEL(cctx);
|
||||
break;
|
||||
case VAR_NUMBER:
|
||||
case VAR_UNKNOWN:
|
||||
|
||||
+11
-30
@@ -2048,9 +2048,6 @@ execute_unletindex(isn_T *iptr, ectx_T *ectx)
|
||||
semsg(_(e_list_index_out_of_range_nr), n);
|
||||
status = FAIL;
|
||||
}
|
||||
else if (value_check_lock(li->li_tv.v_lock,
|
||||
NULL, FALSE))
|
||||
status = FAIL;
|
||||
else
|
||||
listitem_remove(l, li);
|
||||
}
|
||||
@@ -2133,11 +2130,9 @@ execute_unletrange(isn_T *iptr, ectx_T *ectx)
|
||||
semsg(_(e_list_index_out_of_range_nr), n2);
|
||||
status = FAIL;
|
||||
}
|
||||
if (status != FAIL
|
||||
&& list_unlet_range(l, li, NULL, n1,
|
||||
tv_idx2->v_type != VAR_SPECIAL, n2)
|
||||
== FAIL)
|
||||
status = FAIL;
|
||||
if (status != FAIL)
|
||||
list_unlet_range(l, li, n1,
|
||||
tv_idx2->v_type != VAR_SPECIAL, n2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2616,8 +2611,10 @@ exec_instructions(ectx_T *ectx)
|
||||
|
||||
case ISN_CEXPR_AUCMD:
|
||||
#ifdef FEAT_QUICKFIX
|
||||
force_abort = TRUE;
|
||||
if (trigger_cexpr_autocmd(iptr->isn_arg.number) == FAIL)
|
||||
goto on_error;
|
||||
force_abort = FALSE;
|
||||
#endif
|
||||
break;
|
||||
|
||||
@@ -3045,7 +3042,9 @@ exec_instructions(ectx_T *ectx)
|
||||
s = tv2string(tv, &tofree, numbuf, 0);
|
||||
if (s == NULL || *s == NUL)
|
||||
{
|
||||
// cannot happen?
|
||||
clear_tv(tv);
|
||||
vim_free(tofree);
|
||||
goto on_error;
|
||||
}
|
||||
}
|
||||
@@ -3275,17 +3274,13 @@ exec_instructions(ectx_T *ectx)
|
||||
case ISN_PUSHCHANNEL:
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
tv->v_type = VAR_CHANNEL;
|
||||
tv->vval.v_channel = iptr->isn_arg.channel;
|
||||
if (tv->vval.v_channel != NULL)
|
||||
++tv->vval.v_channel->ch_refcount;
|
||||
tv->vval.v_channel = NULL;
|
||||
#endif
|
||||
break;
|
||||
case ISN_PUSHJOB:
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
tv->v_type = VAR_JOB;
|
||||
tv->vval.v_job = iptr->isn_arg.job;
|
||||
if (tv->vval.v_job != NULL)
|
||||
++tv->vval.v_job->jv_refcount;
|
||||
tv->vval.v_job = NULL;
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
@@ -5649,26 +5644,12 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc)
|
||||
break;
|
||||
case ISN_PUSHCHANNEL:
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
{
|
||||
channel_T *channel = iptr->isn_arg.channel;
|
||||
|
||||
smsg("%s%4d PUSHCHANNEL %d", pfx, current,
|
||||
channel == NULL ? 0 : channel->ch_id);
|
||||
}
|
||||
smsg("%s%4d PUSHCHANNEL 0", pfx, current);
|
||||
#endif
|
||||
break;
|
||||
case ISN_PUSHJOB:
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
{
|
||||
typval_T tv;
|
||||
char_u *name;
|
||||
char_u buf[NUMBUFLEN];
|
||||
|
||||
tv.v_type = VAR_JOB;
|
||||
tv.vval.v_job = iptr->isn_arg.job;
|
||||
name = job_to_string_buf(&tv, buf);
|
||||
smsg("%s%4d PUSHJOB \"%s\"", pfx, current, name);
|
||||
}
|
||||
smsg("%s%4d PUSHJOB \"no process\"", pfx, current);
|
||||
#endif
|
||||
break;
|
||||
case ISN_PUSHEXC:
|
||||
|
||||
+8
-24
@@ -592,12 +592,12 @@ generate_tv_PUSH(cctx_T *cctx, typval_T *tv)
|
||||
case VAR_JOB:
|
||||
if (tv->vval.v_job != NULL)
|
||||
iemsg("non-null job constant not supported");
|
||||
generate_PUSHJOB(cctx, NULL);
|
||||
generate_PUSHJOB(cctx);
|
||||
break;
|
||||
case VAR_CHANNEL:
|
||||
if (tv->vval.v_channel != NULL)
|
||||
iemsg("non-null channel constant not supported");
|
||||
generate_PUSHCHANNEL(cctx, NULL);
|
||||
generate_PUSHCHANNEL(cctx);
|
||||
break;
|
||||
#endif
|
||||
case VAR_FUNC:
|
||||
@@ -723,36 +723,30 @@ generate_PUSHS(cctx_T *cctx, char_u **str)
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate an ISN_PUSHCHANNEL instruction.
|
||||
* Consumes "channel".
|
||||
* Generate an ISN_PUSHCHANNEL instruction. Channel is always NULL.
|
||||
*/
|
||||
int
|
||||
generate_PUSHCHANNEL(cctx_T *cctx, channel_T *channel)
|
||||
generate_PUSHCHANNEL(cctx_T *cctx)
|
||||
{
|
||||
isn_T *isn;
|
||||
|
||||
RETURN_OK_IF_SKIP(cctx);
|
||||
if ((isn = generate_instr_type(cctx, ISN_PUSHCHANNEL, &t_channel)) == NULL)
|
||||
return FAIL;
|
||||
isn->isn_arg.channel = channel;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate an ISN_PUSHJOB instruction.
|
||||
* Consumes "job".
|
||||
* Generate an ISN_PUSHJOB instruction. Job is always NULL.
|
||||
*/
|
||||
int
|
||||
generate_PUSHJOB(cctx_T *cctx, job_T *job)
|
||||
generate_PUSHJOB(cctx_T *cctx)
|
||||
{
|
||||
isn_T *isn;
|
||||
|
||||
RETURN_OK_IF_SKIP(cctx);
|
||||
if ((isn = generate_instr_type(cctx, ISN_PUSHJOB, &t_job)) == NULL)
|
||||
return FAIL;
|
||||
isn->isn_arg.job = job;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -2081,18 +2075,6 @@ delete_instr(isn_T *isn)
|
||||
blob_unref(isn->isn_arg.blob);
|
||||
break;
|
||||
|
||||
case ISN_PUSHJOB:
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
job_unref(isn->isn_arg.job);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case ISN_PUSHCHANNEL:
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
channel_unref(isn->isn_arg.channel);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case ISN_UCALL:
|
||||
vim_free(isn->isn_arg.ufunc.cuf_name);
|
||||
break;
|
||||
@@ -2241,7 +2223,9 @@ delete_instr(isn_T *isn)
|
||||
case ISN_PROF_END:
|
||||
case ISN_PROF_START:
|
||||
case ISN_PUSHBOOL:
|
||||
case ISN_PUSHCHANNEL:
|
||||
case ISN_PUSHF:
|
||||
case ISN_PUSHJOB:
|
||||
case ISN_PUSHNR:
|
||||
case ISN_PUSHSPEC:
|
||||
case ISN_PUT:
|
||||
|
||||
+2
-2
@@ -71,7 +71,7 @@ ex_vim9script(exarg_T *eap UNUSED)
|
||||
int found_noclear = FALSE;
|
||||
char_u *p;
|
||||
|
||||
if (!getline_equal(eap->getline, eap->cookie, getsourceline))
|
||||
if (!sourcing_a_script(eap))
|
||||
{
|
||||
emsg(_(e_vim9script_can_only_be_used_in_script));
|
||||
return;
|
||||
@@ -633,7 +633,7 @@ ex_import(exarg_T *eap)
|
||||
char_u *cmd_end;
|
||||
evalarg_T evalarg;
|
||||
|
||||
if (!getline_equal(eap->getline, eap->cookie, getsourceline))
|
||||
if (!sourcing_a_script(eap))
|
||||
{
|
||||
emsg(_(e_import_can_only_be_used_in_script));
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user