Merge remote-tracking branch 'vim/master'

This commit is contained in:
ichizok
2021-06-28 11:25:30 +09:00
101 changed files with 5216 additions and 1953 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ Unpack the images:
cd nsis
unzip icons.zip
To build then, enter:
Then build gvim.exe:
cd nsis
makensis gvim.nsi
+11
View File
@@ -172,6 +172,17 @@ func dist#ft#FTent()
setf dtd
endfunc
func dist#ft#ExCheck()
let lines = getline(1, min([line("$"), 100]))
if exists('g:filetype_euphoria')
exe 'setf ' . g:filetype_euphoria
elseif match(lines, '^--\|^ifdef\>\|^include\>') > -1
setf euphoria3
else
setf elixir
endif
endfunc
func dist#ft#EuphoriaCheck()
if exists('g:filetype_euphoria')
exe 'setf ' . g:filetype_euphoria
+3 -8
View File
@@ -3,7 +3,7 @@
" Maintainer: Mark Guzman <segfault@hasno.info>
" URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 Feb 25
" Last Change: 2020 Apr 12
" ----------------------------------------------------------------------------
"
" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
@@ -501,13 +501,8 @@ class VimRubyCompletion
return if rails_base == nil
$:.push rails_base unless $:.index( rails_base )
rails_config = rails_base + "config/"
rails_lib = rails_base + "lib/"
$:.push rails_config unless $:.index( rails_config )
$:.push rails_lib unless $:.index( rails_lib )
bootfile = rails_config + "boot.rb"
envfile = rails_config + "environment.rb"
bootfile = rails_base + "config/boot.rb"
envfile = rails_base + "config/environment.rb"
if File.exists?( bootfile ) && File.exists?( envfile )
begin
require bootfile
+8 -1
View File
@@ -1,4 +1,4 @@
*arabic.txt* For Vim version 8.2. Last change: 2019 May 05
*arabic.txt* For Vim version 8.2. Last change: 2021 Jun 22
VIM REFERENCE MANUAL by Nadim Shaikli
@@ -176,6 +176,13 @@ o Enable Arabic settings [short-cut]
and its support is preferred due to its level of offerings.
'arabic' when 'termbidi' is enabled only sets the keymap.
For vertical window isolation while setting 'termbidi' an LTR
vertical separator like "l" or "𝖨" may be used. It may also be
hidden by changing its color to the foreground color: >
:set fillchars=vert:l
:hi VertSplit ctermbg=White
< Note that this is a workaround, not a proper solution.
If, on the other hand, you'd like to be verbose and explicit and
are opting not to use the 'arabic' short-cut command, here's what
is needed (i.e. if you use ':set arabic' you can skip this section) -
+8 -5
View File
@@ -1,4 +1,4 @@
*change.txt* For Vim version 8.2. Last change: 2021 Jun 10
*change.txt* For Vim version 8.2. Last change: 2021 Jun 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -780,12 +780,15 @@ For compatibility with Vi these two exceptions are allowed:
"\/{string}/" and "\?{string}?" do the same as "//{string}/r".
"\&{string}&" does the same as "//{string}/".
*pattern-delimiter* *E146*
Instead of the '/' which surrounds the pattern and replacement string, you
can use any other single-byte character, but not an alphanumeric character,
'\', '"' or '|'. This is useful if you want to include a '/' in the search
pattern or replacement string. Example: >
Instead of the '/' which surrounds the pattern and replacement string, you can
use another single-byte character. This is useful if you want to include a
'/' in the search pattern or replacement string. Example: >
:s+/+//+
You can use most characters, but not an alphanumeric character, '\', '"' or
'|'. In Vim9 script you should not use '#' because it may be recognized as
the start of a comment.
For the definition of a pattern, see |pattern|. In Visual block mode, use
|/\%V| in the pattern to have the substitute work in the block only.
Otherwise it works on whole lines anyway.
+26 -14
View File
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.2. Last change: 2021 Jun 07
*eval.txt* For Vim version 8.2. Last change: 2021 Jun 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -3034,6 +3034,8 @@ test_feedinput({string}) none add key sequence to input buffer
test_garbagecollect_now() none free memory right now for testing
test_garbagecollect_soon() none free memory soon for testing
test_getvalue({string}) any get value of an internal variable
test_gui_drop_files({list}, {row}, {col}, {mods})
none drop a list of files in a window
test_gui_mouse_event({button}, {row}, {col}, {repeated}, {mods})
none add a mouse event to the input buffer
test_ignore_error({expr}) none ignore a specific error
@@ -4872,6 +4874,8 @@ foldclosed({lnum}) *foldclosed()*
The result is a Number. If the line {lnum} is in a closed
fold, the result is the number of the first line in that fold.
If the line {lnum} is not in a closed fold, -1 is returned.
{lnum} is used like with |getline()|. Thus "." is the current
line, "'m" mark m, etc.
Can also be used as a |method|: >
GetLnum()->foldclosed()
@@ -4880,6 +4884,8 @@ foldclosedend({lnum}) *foldclosedend()*
The result is a Number. If the line {lnum} is in a closed
fold, the result is the number of the last line in that fold.
If the line {lnum} is not in a closed fold, -1 is returned.
{lnum} is used like with |getline()|. Thus "." is the current
line, "'m" mark m, etc.
Can also be used as a |method|: >
GetLnum()->foldclosedend()
@@ -4893,6 +4899,8 @@ foldlevel({lnum}) *foldlevel()*
returned for lines where folds are still to be updated and the
foldlevel is unknown. As a special case the level of the
previous line is usually available.
{lnum} is used like with |getline()|. Thus "." is the current
line, "'m" mark m, etc.
Can also be used as a |method|: >
GetLnum()->foldlevel()
@@ -5768,6 +5776,8 @@ getmatches([{win}]) *getmatches()*
|getmatches()| is useful in combination with |setmatches()|,
as |setmatches()| can restore a list of matches saved by
|getmatches()|.
If {win} is specified, use the window with this number or
window ID instead of the current window.
Example: >
:echo getmatches()
< [{'group': 'MyGroup1', 'pattern': 'TODO',
@@ -5868,8 +5878,10 @@ getqflist([{what}]) *getqflist()*
valid |TRUE|: recognized error message
When there is no error list or it's empty, an empty list is
returned. Quickfix list entries with non-existing buffer
number are returned with "bufnr" set to zero.
returned. Quickfix list entries with a non-existing buffer
number are returned with "bufnr" set to zero (Note: some
functions accept buffer number zero for the alternate buffer,
you may need to explicitly check for zero).
Useful application: Find pattern matches in multiple files and
do something with them: >
@@ -6013,12 +6025,12 @@ getregtype([{regname}]) *getregtype()*
Can also be used as a |method|: >
GetRegname()->getregtype()
gettabinfo([{arg}]) *gettabinfo()*
If {arg} is not specified, then information about all the tab
pages is returned as a |List|. Each List item is a |Dictionary|.
Otherwise, {arg} specifies the tab page number and information
about that one is returned. If the tab page does not exist an
empty List is returned.
gettabinfo([{tabnr}]) *gettabinfo()*
If {tabnr} is not specified, then information about all the
tab pages is returned as a |List|. Each List item is a
|Dictionary|. Otherwise, {tabnr} specifies the tab page
number and information about that one is returned. If the tab
page does not exist an empty List is returned.
Each List item is a |Dictionary| with the following entries:
tabnr tab page number.
@@ -6071,11 +6083,11 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()*
< Can also be used as a |method|: >
GetTabnr()->gettabwinvar(winnr, varname)
gettagstack([{nr}]) *gettagstack()*
The result is a Dict, which is the tag stack of window {nr}.
{nr} can be the window number or the |window-ID|.
When {nr} is not specified, the current window is used.
When window {nr} doesn't exist, an empty Dict is returned.
gettagstack([{winnr}]) *gettagstack()*
The result is a Dict, which is the tag stack of window {winnr}.
{winnr} can be the window number or the |window-ID|.
When {winnr} is not specified, the current window is used.
When window {winnr} doesn't exist, an empty Dict is returned.
The returned dictionary contains the following entries:
curidx Current index in the stack. When at
+1 -1
View File
@@ -1,4 +1,4 @@
*ps1.txt* A Windows PowerShell syntax plugin for Vim
*ft_ps1.txt* A Windows PowerShell syntax plugin for Vim
Author: Peter Provost <https://www.github.com/PProvost>
License: Apache 2.0
+1 -1
View File
@@ -1,4 +1,4 @@
*vim-raku.txt* The Raku programming language filetype
*ft_raku.txt* The Raku programming language filetype
*vim-raku*
+2 -1
View File
@@ -1,4 +1,4 @@
*index.txt* For Vim version 8.2. Last change: 2021 May 27
*index.txt* For Vim version 8.2. Last change: 2021 Jun 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1312,6 +1312,7 @@ tag command action ~
|:endtry| :endt[ry] end previous :try
|:endwhile| :endw[hile] end previous :while
|:enew| :ene[w] edit a new, unnamed buffer
|:eval| :ev[al] evaluate an expression and discard the result
|:ex| :ex same as ":edit"
|:execute| :exe[cute] execute result of expressions
|:exit| :exi[t] same as ":xit"
+2 -2
View File
@@ -200,9 +200,9 @@ l or *l*
*$* *<End>* *<kEnd>*
$ or <End> To the end of the line. When a count is given also go
[count - 1] lines downward, or as far is possible.
|inclusive| motion. If a count of 2 of larger is
|inclusive| motion. If a count of 2 or larger is
given and the cursor is on the last line, that is an
error an the cursor doesn't move.
error and the cursor doesn't move.
In Visual mode the cursor goes to just after the last
character in the line.
When 'virtualedit' is active, "$" may move the cursor
+5 -3
View File
@@ -1,4 +1,4 @@
*options.txt* For Vim version 8.2. Last change: 2021 May 31
*options.txt* For Vim version 8.2. Last change: 2021 Jun 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -5744,19 +5744,21 @@ A jump table for the options with a short description can be found at |Q_op|.
- abbreviations are disabled
- 'autoindent' is reset
- 'expandtab' is reset
- 'formatoptions' is used like it is empty
- 'hkmap' is reset
- 'revins' is reset
- 'ruler' is reset
- 'showmatch' is reset
- 'smartindent' is reset
- 'smarttab' is reset
- 'softtabstop' is set to 0
- 'textwidth' is set to 0
- 'wrapmargin' is set to 0
- 'varsofttabstop' is made empty
These options keep their value, but their effect is disabled:
- 'cindent'
- 'formatoptions' is used like it is empty
- 'indentexpr'
- 'lisp'
- 'smartindent'
NOTE: When you start editing another file while the 'paste' option is
on, settings from the modelines or autocommands may change the
settings again, causing trouble when pasting text. You might want to
+11 -1
View File
@@ -1,4 +1,4 @@
*repeat.txt* For Vim version 8.2. Last change: 2021 Jun 11
*repeat.txt* For Vim version 8.2. Last change: 2021 Jun 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -844,6 +844,16 @@ About the additional commands in debug mode:
is reset (because it's not clear what you want to repeat).
- When you want to use the Ex command with the same name, prepend a colon:
":cont", ":next", ":finish" (or shorter).
*vim9-debug*
When debugging a compiled :def function, "step" will stop before every
executed line, not every ingle nstruction. Thus it works mostly like a not
compiled function. Access to local variables is limited you can use: >
echo varname
But not much else.
When executing a command that is not a specific bytecode instruction but
executed like a normal Ex command, "step" will stop once in the compiled
context, where local variables can be inspected, and once just before
executing the command.
The backtrace shows the hierarchy of function calls, e.g.:
>bt ~
+2 -2
View File
@@ -1,4 +1,4 @@
*rileft.txt* For Vim version 8.2. Last change: 2019 May 05
*rileft.txt* For Vim version 8.2. Last change: 2021 Jun 13
VIM REFERENCE MANUAL by Avner Lottem
@@ -75,7 +75,7 @@ o Invocations
o Typing backwards *ins-reverse*
----------------
In lieu of using full-fledged the 'rightleft' option, one can opt for
In lieu of using the full-fledged 'rightleft' option, one can opt for
reverse insertion. When the 'revins' (reverse insert) option is set,
inserting happens backwards. This can be used to type right-to-left
text. When inserting characters the cursor is not moved and the text
+4 -4
View File
@@ -1,4 +1,4 @@
*syntax.txt* For Vim version 8.2. Last change: 2021 May 30
*syntax.txt* For Vim version 8.2. Last change: 2021 Jun 22
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1420,11 +1420,11 @@ To select syntax highlighting file for Euphoria, as well as for
auto-detecting the *.e and *.E file extensions as Euphoria file type,
add the following line to your startup file: >
:let filetype_euphoria="euphoria3"
:let filetype_euphoria = "euphoria3"
or
< or >
:let filetype_euphoria="euphoria4"
:let filetype_euphoria = "euphoria4"
ERLANG *erlang.vim* *ft-erlang-syntax*
+17 -2
View File
@@ -1406,6 +1406,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
+scrollbind various.txt /*+scrollbind*
+signs various.txt /*+signs*
+smartindent various.txt /*+smartindent*
+sodium various.txt /*+sodium*
+sound various.txt /*+sound*
+spell various.txt /*+spell*
+startuptime various.txt /*+startuptime*
@@ -1982,7 +1983,9 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:& change.txt /*:&*
:&& change.txt /*:&&*
:' cmdline.txt /*:'*
:++ vim9.txt /*:++*
:, cmdline.txt /*:,*
:-- vim9.txt /*:--*
:. cmdline.txt /*:.*
:/ cmdline.txt /*:\/*
:0file editing.txt /*:0file*
@@ -4018,8 +4021,17 @@ E118 eval.txt /*E118*
E1187 starting.txt /*E1187*
E1188 cmdline.txt /*E1188*
E119 eval.txt /*E119*
E1193 options.txt /*E1193*
E1194 options.txt /*E1194*
E1195 options.txt /*E1195*
E1196 options.txt /*E1196*
E1197 options.txt /*E1197*
E1198 options.txt /*E1198*
E1199 options.txt /*E1199*
E12 message.txt /*E12*
E120 eval.txt /*E120*
E1200 options.txt /*E1200*
E1201 options.txt /*E1201*
E121 eval.txt /*E121*
E122 eval.txt /*E122*
E123 eval.txt /*E123*
@@ -6763,6 +6775,8 @@ ft-yaml-syntax syntax.txt /*ft-yaml-syntax*
ft-zimbu-plugin filetype.txt /*ft-zimbu-plugin*
ft-zsh-syntax syntax.txt /*ft-zsh-syntax*
ft_ada.txt ft_ada.txt /*ft_ada.txt*
ft_ps1.txt ft_ps1.txt /*ft_ps1.txt*
ft_raku.txt ft_raku.txt /*ft_raku.txt*
ft_rust.txt ft_rust.txt /*ft_rust.txt*
ft_sql.txt ft_sql.txt /*ft_sql.txt*
ftdetect filetype.txt /*ftdetect*
@@ -8749,7 +8763,6 @@ ps1-compiler ft_ps1.txt /*ps1-compiler*
ps1-folding ft_ps1.txt /*ps1-folding*
ps1-keyword ft_ps1.txt /*ps1-keyword*
ps1-syntax ft_ps1.txt /*ps1-syntax*
ps1.txt ft_ps1.txt /*ps1.txt*
psql ft_sql.txt /*psql*
ptcap.vim syntax.txt /*ptcap.vim*
pterm-mouse options.txt /*pterm-mouse*
@@ -9824,6 +9837,8 @@ test_feedinput() testing.txt /*test_feedinput()*
test_garbagecollect_now() testing.txt /*test_garbagecollect_now()*
test_garbagecollect_soon() testing.txt /*test_garbagecollect_soon()*
test_getvalue() testing.txt /*test_getvalue()*
test_gui_drop_files() testing.txt /*test_gui_drop_files()*
test_gui_mouse_event() testing.txt /*test_gui_mouse_event()*
test_ignore_error() testing.txt /*test_ignore_error()*
test_null_blob() testing.txt /*test_null_blob()*
test_null_channel() testing.txt /*test_null_channel()*
@@ -10294,7 +10309,6 @@ vim-mac intro.txt /*vim-mac*
vim-modes intro.txt /*vim-modes*
vim-modes-intro intro.txt /*vim-modes-intro*
vim-raku ft_raku.txt /*vim-raku*
vim-raku.txt ft_raku.txt /*vim-raku.txt*
vim-script-intro usr_41.txt /*vim-script-intro*
vim-use intro.txt /*vim-use*
vim-variable eval.txt /*vim-variable*
@@ -10305,6 +10319,7 @@ vim9 vim9.txt /*vim9*
vim9-classes vim9.txt /*vim9-classes*
vim9-const vim9.txt /*vim9-const*
vim9-curly vim9.txt /*vim9-curly*
vim9-debug repeat.txt /*vim9-debug*
vim9-declaration vim9.txt /*vim9-declaration*
vim9-declarations usr_46.txt /*vim9-declarations*
vim9-differences vim9.txt /*vim9-differences*
+19 -4
View File
@@ -1,4 +1,4 @@
*testing.txt* For Vim version 8.2. Last change: 2021 Jun 21
*testing.txt* For Vim version 8.2. Last change: 2021 Jun 23
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -79,10 +79,23 @@ test_getvalue({name}) *test_getvalue()*
Can also be used as a |method|: >
GetName()->test_getvalue()
<
*test_gui_drop_files()*
test_gui_drop_files({list}, {row}, {col}, {mods})
Drop one or more files in {list} in the window at {row}, {col}.
This function only works when the GUI is running.
The supported values for {mods} are:
0x4 Shift
0x8 Alt
0x10 Ctrl
The files are added to the argument list and the first file in
{list} is edited in the window. See |drag-n-drop| for more
information.
*test_gui_mouse_event()*
test_gui_mouse_event({button}, {row}, {col}, {multiclick}, {modifiers})
Inject a mouse button click event. This function works only
when GUI is running.
Inject a mouse button click event. This function only works
when the GUI is running.
The supported values for {button} are:
0 right mouse button
1 middle mouse button
@@ -92,7 +105,9 @@ test_gui_mouse_event({button}, {row}, {col}, {multiclick}, {modifiers})
5 scroll wheel up
6 scroll wheel left
7 scroll wheel right
{row} and {col} specify the location of the mouse click.
{row} and {col} specify the location of the mouse click. The
first row of the Vim window is 1 and the last row is 'lines'.
The maximum value of {col} is 'columns'.
To inject a multiclick event, set {multiclick} to 1.
The supported values for {modifiers} are:
4 shift is pressed
+16 -6
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.2. Last change: 2021 Jun 13
*todo.txt* For Vim version 8.2. Last change: 2021 Jun 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,10 +38,13 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs*
-------------------- Known bugs and current work -----------------------
Memory eaten up by function returning a closure. #8439
Circular reference. Should garbage collector find unused local variables?
Vim9 - Make everything work:
- Make debugging work - at least per function.
- How to evaluate the stack and variables on the stack?
- FIXME in test_debugger.vim
- possible leak in test_vim9_builtin ?
- use CheckLegacyAndVim9Success(lines) in many more places
- compile get_lambda_tv() in popup_add_timeout()
- For builtin functions using tv_get_string*() use check_for_string() to be
more strict about the argument type (not a bool).
done: balloon_()
@@ -49,13 +52,13 @@ Vim9 - Make everything work:
map() could check that the return type of the function argument matches
the type of the list or dict member. (#8092)
Same for other functions, such as searchpair().
- use CheckLegacyAndVim9Success(lines) in many more places
- Test try/catch and throw better, also nested.
Test that return inside try/finally jumps to finally and then returns.
- Test that a function defined inside a :def function is local to that
function, g: functions can be defined and script-local functions cannot be
defined.
- compile get_lambda_tv() in popup_add_timeout()
- Unexpected error message when using "var x: any | x.key = 9", because "x" is
given the type number. Can we use VAR_ANY?
Once Vim9 is stable:
- Add the "vim9script" feature, can use has('vim9script')
@@ -287,6 +290,9 @@ Missing filetype test for bashrc, PKGBUILD, etc.
Add an option to not fetch terminal codes in xterm, to avoid flicker when t_Co
changes.
MS-Windows: instead of "edit with multiple Vims" use "Edit with Vim in
multiple tabs". #8404
When using ":bwipe!" also get rid of references to be buffer, e.g. in the
jumplist and alternate file.
@@ -322,6 +328,9 @@ Should also work without any group:
Should add a match/str/list/pos method that also returns the test and position
of submatches. #8355
Syntax highlight for a region does not work with a "nextgroup" if the start
match is empty. #8449
Check out PR #543 (Roland Puntaier).
Patch for multibyte characters in langmap and applying a mapping on them.
(Christian Brabandt, 2015 Jun 12, update July 25)
@@ -346,6 +355,7 @@ The buffer list and windows are locked, no changes possible
Add a ModeChanged autocommand that has an argument indicating the old and new
mode, as what's returned from mode(). Also used for switching Terminal mode.
#8360, #7863, #7363
Matchparen doesn't remove highlight after undo. (#7054)
Is OK when syntax HL is active.
+1
View File
@@ -1021,6 +1021,7 @@ Testing: *test-functions*
test_garbagecollect_now() free memory right now
test_garbagecollect_soon() set a flag to free memory soon
test_getvalue() get value of an internal variable
test_gui_drop_files() drop file(s) in a window
test_gui_mouse_event() add a GUI mouse event to the input buffer
test_ignore_error() ignore a specific error message
test_null_blob() return a null Blob
+12 -2
View File
@@ -1,4 +1,4 @@
*vim9.txt* For Vim version 8.2. Last change: 2021 Jun 12
*vim9.txt* For Vim version 8.2. Last change: 2021 Jun 25
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -457,7 +457,7 @@ which is similar to JavaScript: >
var Lambda = (arg) => expression
No line break is allowed in the arguments of a lambda up to and including the
"=>" (so that Vim can tell the difference between an expression in parenthesis
"=>" (so that Vim can tell the difference between an expression in parentheses
and lambda arguments). This is OK: >
filter(list, (k, v) =>
v > 0)
@@ -937,6 +937,16 @@ The 'gdefault' option value is not used.
You may also find this wiki useful. It was written by an early adopter of
Vim9 script: https://github.com/lacygoill/wiki/blob/master/vim/vim9.md
*:++* *:--*
The ++ and -- commands have been added. They are very similar to adding or
subtracting one: >
++var
var += 1
--var
var -= 1
Using ++var or --var in an expression is not supported yet.
==============================================================================
3. New style functions *fast-functions*
+12 -2
View File
@@ -393,7 +393,7 @@ au BufNewFile,BufRead *.cfm,*.cfi,*.cfc setf cf
" Configure scripts
au BufNewFile,BufRead configure.in,configure.ac setf config
" CUDA Cumpute Unified Device Architecture
" CUDA Compute Unified Device Architecture
au BufNewFile,BufRead *.cu,*.cuh setf cuda
" Dockerfile; Podman uses the same syntax with name Containerfile
@@ -408,8 +408,15 @@ au BufNewFile,BufRead *enlightenment/*.cfg setf c
" Eterm
au BufNewFile,BufRead *Eterm/*.cfg setf eterm
" Elixir or Euphoria
au BufNewFile,BufRead *.ex call dist#ft#ExCheck()
" Elixir
au BufRead,BufNewFile mix.lock,*.exs setf elixir
au BufRead,BufNewFile *.eex,*.leex setf eelixir
" Euphoria 3 or 4
au BufNewFile,BufRead *.eu,*.ew,*.ex,*.exu,*.exw call dist#ft#EuphoriaCheck()
au BufNewFile,BufRead *.eu,*.ew,*.exu,*.exw call dist#ft#EuphoriaCheck()
if has("fname_case")
au BufNewFile,BufRead *.EU,*.EW,*.EX,*.EXU,*.EXW call dist#ft#EuphoriaCheck()
endif
@@ -855,6 +862,9 @@ au BufNewFile,BufRead *.jov,*.j73,*.jovial setf jovial
" JSON
au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest setf json
" JSON Patch (RFC 6902)
au BufNewFile,BufRead *.json-patch setf json
" Jupyter Notebook is also json
au BufNewFile,BufRead *.ipynb setf json
+2 -2
View File
@@ -3,7 +3,7 @@
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 Jan 06
" Last Change: 2020 Jun 28
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -118,7 +118,7 @@ endif
" TODO: comments=
setlocal commentstring=<%#%s%>
let b:undo_ftplugin = "setl cms< "
let b:undo_ftplugin = "setl cms< " .
\ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
let &cpo = s:save_cpo
+2 -2
View File
@@ -3,7 +3,7 @@
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 Nov 06
" Last Change: 2020 Feb 13
if (exists("b:did_ftplugin"))
finish
@@ -112,7 +112,7 @@ else
if !exists('g:ruby_default_path')
if has("ruby") && has("win32")
ruby ::VIM::command( 'let g:ruby_default_path = split("%s",",")' % $:.join(%q{,}) )
elseif executable('ruby')
elseif executable('ruby') && !empty($HOME)
let g:ruby_default_path = s:query_path($HOME)
else
let g:ruby_default_path = map(split($RUBYLIB,':'), 'v:val ==# "." ? "" : v:val')
+5 -1
View File
@@ -5,6 +5,7 @@
Name[de]=GVim
Name[eo]=GVim
Name[fr]=GVim
Name[it]=GVim
Name[ru]=GVim
Name[sr]=GVim
Name[tr]=GVim
@@ -13,6 +14,7 @@ Name=GVim
GenericName[de]=Texteditor
GenericName[eo]=Tekstoredaktilo
GenericName[fr]=Éditeur de texte
GenericName[it]=Editor di testi
GenericName[ja]=
GenericName[ru]=Текстовый редактор
GenericName[sr]=Едитор текст
@@ -22,6 +24,7 @@ GenericName=Text Editor
Comment[de]=Textdateien bearbeiten
Comment[eo]=Redakti tekstajn dosierojn
Comment[fr]=Éditer des fichiers texte
Comment[it]=Edita file di testo
Comment[ja]=
Comment[ru]=Редактирование текстовых файлов
Comment[sr]=Уређујте текст фајлове
@@ -60,7 +63,6 @@ Comment[hr]=Uređivanje tekstualne datoteke
Comment[hu]=Szövegfájlok szerkesztése
Comment[id]=Edit file teks
Comment[is]=Vinna með textaskrár
Comment[it]=Modifica file di testo
Comment[kn]= ಿ
Comment[ko]=
Comment[lt]=Redaguoti tekstines bylas
@@ -102,6 +104,7 @@ Type=Application
Keywords[de]=Text;Editor;
Keywords[eo]=Teksto;redaktilo;
Keywords[fr]=Texte;éditeur;
Keywords[it]=Testo;editor;
Keywords[ja]=;;
Keywords[ru]=текст;текстовый редактор;
Keywords[sr]=Текст;едитор;
@@ -111,6 +114,7 @@ Keywords=Text;editor;
Icon[de]=gvim
Icon[eo]=gvim
Icon[fr]=gvim
Icon[it]=gvim
Icon[ru]=gvim
Icon[sr]=gvim
Icon=gvim
+1
View File
@@ -4,6 +4,7 @@
" Previous Maintainer: Nikolai Weibull <now at bitwi.se>
" URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2021 Feb 03
" 0. Initialization {{{1
" =================
+1 -1
View File
@@ -293,7 +293,7 @@ syn region eighthComment start="\zs\\" end="$" contains=eighthTodo
" Define the default highlighting.
if !exists("did_eighth_syntax_inits")
let did_eighth_syntax_inits=1
" The default methods for highlighting. Can be overriden later.
" The default methods for highlighting. Can be overridden later.
hi def link eighthTodo Todo
hi def link eighthOperators Operator
hi def link eighthMath Number
+2 -1
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Vim help file
" Maintainer: Bram Moolenaar (Bram@vim.org)
" Last Change: 2020 Jul 28
" Last Change: 2021 Jun 13
" Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax")
@@ -76,6 +76,7 @@ syn match helpSpecial "\[line]"
syn match helpSpecial "\[count]"
syn match helpSpecial "\[offset]"
syn match helpSpecial "\[cmd]"
syn match helpNormal "vim9\[cmd]"
syn match helpSpecial "\[num]"
syn match helpSpecial "\[+num]"
syn match helpSpecial "\[-num]"
+2 -2
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: ReDIF
" Maintainer: Axel Castellane <axel.castellane@polytechnique.edu>
" Last Change: 2013 April 17
" Last Change: 2021 Jun 17
" Original Author: Axel Castellane
" Source: http://openlib.org/acmes/root/docu/redif_1.html
" File Extension: rdf
@@ -932,7 +932,7 @@ highlight redifFieldDeprecated term=undercurl cterm=undercurl gui=undercurl guis
" Sync: The template-type (ReDIF-Paper, ReDIF-Archive, etc.) influences which
" fields can follow. Thus sync must search backwards for it.
"
" I would like to simply ask VIM to search backward for the first occurence of
" I would like to simply ask VIM to search backward for the first occurrence of
" /^Template-Type:/, but it does not seem to be possible, so I have to start
" from the beginning of the file... This might slow down a lot for files that
" contain a lot of Template-Type statements.
+10 -10
View File
@@ -3,7 +3,7 @@
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2019 Jul 13
" Last Change: 2021 Jun 06
" ----------------------------------------------------------------------------
"
" Previous Maintainer: Mirko Nasato
@@ -66,7 +66,7 @@ endfunction
com! -nargs=* SynFold call s:run_syntax_fold(<q-args>)
" Not-Top Cluster {{{1
syn cluster rubyNotTop contains=@rubyCommentNotTop,@rubyStringNotTop,@rubyRegexpSpecial,@rubyDeclaration,@rubyExceptionHandler,@rubyClassOperator,rubyConditional,rubyModuleName,rubyClassName,rubySymbolDelimiter,rubyParentheses
syn cluster rubyNotTop contains=@rubyCommentNotTop,@rubyStringNotTop,@rubyRegexpSpecial,@rubyDeclaration,@rubyExceptionHandler,@rubyClassOperator,rubyConditional,rubyModuleName,rubyClassName,rubySymbolDelimiter,rubyParentheses,@Spell
" Whitespace Errors {{{1
if exists("ruby_space_errors")
@@ -92,7 +92,7 @@ if exists("ruby_operators") || exists("ruby_pseudo_operators")
syn match rubyBooleanOperator "\%(\w\|[^\x00-\x7F]\)\@1<!!\|&&\|||"
syn match rubyRangeOperator "\.\.\.\="
syn match rubyAssignmentOperator "=>\@!\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|||=\||=\|%=\|+=\|>>=\|<<=\|\^="
syn match rubyAssignmentOperator "=>\@!" containedin=rubyBlockParameterList " TODO: this is inelegant
syn match rubyAssignmentOperator "=>\@!" contained containedin=rubyBlockParameterList " TODO: this is inelegant
syn match rubyEqualityOperator "===\|==\|!=\|!\~\|=\~"
syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\%(\w\|[^\x00-\x7F]\)[?!]\=\|[]})]\)\@2<=\[" end="]" contains=ALLBUT,@rubyNotTop
@@ -134,10 +134,10 @@ syn match rubyCurlyBraceEscape "\\[{}]" contained display
syn match rubyAngleBracketEscape "\\[<>]" contained display
syn match rubySquareBracketEscape "\\[[\]]" contained display
syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" matchgroup=rubyString end=")" transparent contained
syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=rubyString end="}" transparent contained
syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=rubyString end=">" transparent contained
syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]" transparent contained
syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" end=")" transparent contained
syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" end="}" transparent contained
syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" end=">" transparent contained
syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" end="\]" transparent contained
syn cluster rubySingleCharEscape contains=rubyBackslashEscape,rubyQuoteEscape,rubySpaceEscape,rubyParenthesisEscape,rubyCurlyBraceEscape,rubyAngleBracketEscape,rubySquareBracketEscape
syn cluster rubyNestedBrackets contains=rubyNested.\+
@@ -193,7 +193,7 @@ SynFold ':' syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':
syn match rubyCapitalizedMethod "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@="
syn region rubyParentheses start="(" end=")" contains=ALLBUT,@rubyNotTop containedin=rubyBlockParameterList
syn region rubyParentheses start="(" end=")" contains=ALLBUT,@rubyNotTop contained containedin=rubyBlockParameterList
syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\_s*\)\@32<=|" end="|" contains=ALLBUT,@rubyNotTop,@rubyProperOperator
if exists('ruby_global_variable_error')
@@ -332,7 +332,7 @@ SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([
syn match rubyAliasDeclaration "[^[:space:];#.()]\+" contained contains=rubySymbol,@rubyGlobalVariable nextgroup=rubyAliasDeclaration2 skipwhite
syn match rubyAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=rubySymbol,@rubyGlobalVariable
syn match rubyMethodDeclaration "[^[:space:];#(]\+" contained contains=rubyConstant,rubyBoolean,rubyPseudoVariable,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable
syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyClassName,rubyScopeOperator nextgroup=rubySuperClassOperator skipwhite skipnl
syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyClassName,rubyScopeOperator nextgroup=rubySuperClassOperator skipwhite
syn match rubyModuleDeclaration "[^[:space:];#<]\+" contained contains=rubyModuleName,rubyScopeOperator
syn match rubyMethodName "\<\%([_[:alpha:]]\|[^\x00-\x7F]\)\%([_[:alnum:]]\|[^\x00-\x7F]\)*[?!=]\=\%([[:alnum:]_.:?!=]\|[^\x00-\x7F]\)\@!" contained containedin=rubyMethodDeclaration
@@ -462,7 +462,7 @@ endif
syn match rubyDefinedOperator "\%#=1\<defined?" display
" 1.9-style Hash Keys and Keyword Parameters {{{1
syn match rubySymbol "\%([{(|,]\_s*\)\@<=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[?!]\=::\@!"he=e-1
syn match rubySymbol "\%(\w\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[?!]\=::\@!"he=e-1 contained containedin=rubyBlockParameterList,rubyCurlyBlock
syn match rubySymbol "[]})\"':]\@1<!\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],;]\@="he=e-1
syn match rubySymbol "[[:space:],{(]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],;]\@="hs=s+1,he=e-1
+22 -17
View File
@@ -1,8 +1,8 @@
" Vim syntax file
" Language: Vim 8.2 script
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
" Last Change: May 20, 2021
" Version: 8.2-03
" Last Change: June 20, 2021
" Version: 8.2-06
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
" Automatically generated keyword lists: {{{1
@@ -19,12 +19,12 @@ 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] 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] vmapc[lear] wa[ll] winp[os] wundo xme xr[estore]
syn keyword vimCommand contained a ar[gs] 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] viu[sage] wa[ll] winp[os] wundo xme xr[estore]
syn keyword vimCommand contained ab arga[dd] 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] vne[w] wh[ile] wn[ext] wv[iminfo] xmenu xunme
syn keyword vimCommand contained abc[lear] argd[elete] 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] vs[plit] win[size] wp[revious] x[it] xnoreme xunmenu
syn keyword vimCommand contained abo[veleft] 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[l] ter[minal] tlmenu tma[p] tr[ewind] u[ndo] unlo[ckvar] verb[ose] vim[grep] wN[ext] winc[md] wq xa[ll] xnoremenu xwininfo
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] 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] tcd tf[irst] tln tmapc[lear] try una[bbreviate] uns[ilent] vert[ical] vimgrepa[dd] w[rite] windo wqa[ll] xmapc[lear] xprop y[ank]
syn keyword vimCommand contained al[l] 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] tch[dir] th[row] tlnoremenu tn[ext] ts[elect] undoj[oin] up[date] vi[sual] viu[sage]
syn keyword vimCommand contained abo[veleft] 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] wN[ext] winc[md] wq xa[ll] xnoremenu xwininfo
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] 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] w[rite] windo wqa[ll] xmapc[lear] xprop y[ank]
syn keyword vimCommand contained al[l] 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]
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
@@ -78,12 +78,12 @@ syn match vimHLGroup contained "Conceal"
syn case match
" Function Names {{{2
syn keyword vimFuncName contained abs argc assert_equal assert_match atan browsedir bufname byteidxcomp charcol ch_evalexpr ch_logfile ch_sendraw complete cos deepcopy echoraw eventhandler exp feedkeys findfile fmod foldlevel funcref getbufline getcharpos getcmdwintype getenv getftype getmarklist getqflist gettabvar getwinpos glob2regpat hasmapto hlexists index inputsave isdirectory job_getchannel job_stop json_encode line listener_flush luaeval mapset matchdelete matchstr mkdir or popup_clear popup_filter_yesno popup_hide popup_notification prevnonblank prompt_setprompt prop_remove prop_type_list pyxeval readdirex reltime remote_peek rename rubyeval screenpos searchdecl serverlist setcharsearch setline setreg sha256 sign_getplaced sign_unplace slice sound_playfile sqrt str2nr strftime strpart submatch synID systemlist taglist term_dumpload term_getcursor term_getstatus term_scrape term_setrestore test_autochdir test_ignore_error test_null_job test_override test_srand_seed timer_start tr undofile visualmode win_execute winheight winnr win_splitmove
syn keyword vimFuncName contained acos argidx assert_equalfile assert_nobeep atan2 bufadd bufnr call charidx ch_evalraw ch_open ch_setoptions complete_add cosh delete empty executable expand filereadable flatten fnameescape foldtext function getbufvar getcharsearch getcompletion getfontname getimstatus getmatches getreg gettabwinvar getwinposx globpath histadd hlID input inputsecret isinf job_info join keys line2byte listener_remove map match matchend matchstrpos mode pathshorten popup_close popup_findinfo popup_list popup_setoptions printf prop_add prop_type_add pum_getpos rand readfile reltimefloat remote_read repeat screenattr screenrow searchpair setbufline setcmdpos setloclist settabvar shellescape sign_jump sign_unplacelist sort sound_stop srand strcharlen strgetchar strptime substitute synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_sendkeys term_setsize test_feedinput test_null_blob test_null_list test_refcount test_unknown timer_stop trim undotree wildmenumode win_findbuf win_id2tabwin winrestcmd winwidth
syn keyword vimFuncName contained add arglistid assert_exception assert_notequal balloon_gettext bufexists bufwinid ceil ch_canread ch_getbufnr ch_read ch_status complete_check count deletebufline environ execute expandcmd filewritable flattennew fnamemodify foldtextresult garbagecollect getchangelist getcmdline getcurpos getfperm getjumplist getmousepos getreginfo gettagstack getwinposy has histdel hostname inputdialog insert islocked job_setoptions js_decode len lispindent localtime maparg matchadd matchfuzzy max mzeval perleval popup_create popup_findpreview popup_locate popup_settext prompt_getprompt prop_clear prop_type_change pumvisible range reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setcursorcharpos setmatches settabwinvar shiftwidth sign_place simplify sound_clear spellbadword state strcharpart stridx strridx swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setansicolors term_start test_garbagecollect_now test_null_channel test_null_partial test_scrollbar test_void timer_stopall trunc uniq winbufnr win_getid win_id2win winrestview wordcount
syn keyword vimFuncName contained and argv assert_fails assert_notmatch balloon_show buflisted bufwinnr changenr ch_close ch_getjob ch_readblob cindent complete_info cscope_connection did_filetype escape exepath extend filter float2nr foldclosed foreground get getchar getcmdpos getcursorcharpos getfsize getline getpid getregtype gettext getwinvar has_key histget iconv inputlist interrupt isnan job_start js_encode libcall list2str log mapcheck matchaddpos matchfuzzypos menu_info nextnonblank popup_atcursor popup_dialog popup_getoptions popup_menu popup_show prompt_setcallback prop_find prop_type_delete py3eval readblob reg_executing remote_expr remote_startserver reverse screenchars search searchpos setcellwidths setenv setpos settagstack sign_define sign_placelist sin soundfold spellsuggest str2float strchars string strtrans swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled terminalprops term_setapi term_wait test_garbagecollect_soon test_null_dict test_null_string test_setmouse timer_info tolower type values wincol win_gettype winlayout winsaveview writefile
syn keyword vimFuncName contained append asin assert_false assert_report balloon_split bufload byte2line char2nr ch_close_in ch_info ch_readraw clearmatches confirm cursor diff_filler eval exists extendnew finddir floor foldclosedend fullcommand getbufinfo getcharmod getcmdtype getcwd getftime getloclist getpos gettabinfo getwininfo glob haslocaldir histnr indent inputrestore invert items job_status json_decode libcallnr listener_add log10 mapnew matcharg matchlist min nr2char popup_beval popup_filter_menu popup_getpos popup_move pow prompt_setinterrupt prop_list prop_type_get pyeval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcharpos setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playevent split str2list strdisplaywidth strlen strwidth synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_list term_setkill test_alloc_fail test_getvalue test_null_function test_option_not_set test_settime timer_pause toupper typename virtcol windowsversion win_gotoid winline win_screenpos xor
syn keyword vimFuncName contained appendbufline assert_beeps assert_inrange assert_true browse bufloaded byteidx charclass chdir ch_log ch_sendexpr col copy debugbreak diff_hlID
syn keyword vimFuncName contained abs argc assert_equal assert_match atan browsedir bufname byteidxcomp charcol ch_evalexpr ch_logfile ch_sendraw complete cos deepcopy echoraw executable expand filereadable flatten fnameescape foldtext function getbufvar getcharsearch getcmdwintype getenv getftype getmarklist getqflist gettabvar getwinpos glob2regpat hasmapto hlexists index inputsave isdirectory job_getchannel job_stop json_encode line listener_flush luaeval mapset matchdelete matchstr mkdir or popup_clear popup_filter_yesno popup_hide popup_notification prevnonblank prompt_setprompt prop_remove prop_type_list pyxeval readdirex reltime remote_peek rename rubyeval screenpos searchdecl serverlist setcharsearch setline setreg sha256 sign_getplaced sign_unplace slice sound_playfile sqrt str2nr strftime strpart submatch synID systemlist taglist term_dumpload term_getcursor term_getstatus term_scrape term_setrestore test_autochdir test_ignore_error test_null_job test_override test_srand_seed timer_start tr undofile visualmode win_execute winheight winnr win_splitmove
syn keyword vimFuncName contained acos argidx assert_equalfile assert_nobeep atan2 bufadd bufnr call charidx ch_evalraw ch_open ch_setoptions complete_add cosh delete empty execute expandcmd filewritable flattennew fnamemodify foldtextresult garbagecollect getchangelist getcharstr getcompletion getfontname getimstatus getmatches getreg gettabwinvar getwinposx globpath histadd hlID input inputsecret isinf job_info join keys line2byte listener_remove map match matchend matchstrpos mode pathshorten popup_close popup_findinfo popup_list popup_setoptions printf prop_add prop_type_add pum_getpos rand readfile reltimefloat remote_read repeat screenattr screenrow searchpair setbufline setcmdpos setloclist settabvar shellescape sign_jump sign_unplacelist sort sound_stop srand strcharlen strgetchar strptime substitute synIDattr tabpagebuflist tan term_dumpwrite term_getjob term_gettitle term_sendkeys term_setsize test_feedinput test_null_blob test_null_list test_refcount test_unknown timer_stop trim undotree wildmenumode win_findbuf win_id2tabwin winrestcmd winwidth
syn keyword vimFuncName contained add arglistid assert_exception assert_notequal balloon_gettext bufexists bufwinid ceil ch_canread ch_getbufnr ch_read ch_status complete_check count deletebufline environ exepath extend filter float2nr foldclosed foreground get getchar getcmdline getcurpos getfperm getjumplist getmousepos getreginfo gettagstack getwinposy has histdel hostname inputdialog insert islocked job_setoptions js_decode len lispindent localtime maparg matchadd matchfuzzy max mzeval perleval popup_create popup_findpreview popup_locate popup_settext prompt_getprompt prop_clear prop_type_change pumvisible range reduce reltimestr remote_send resolve screenchar screenstring searchpairpos setbufvar setcursorcharpos setmatches settabwinvar shiftwidth sign_place simplify sound_clear spellbadword state strcharpart stridx strridx swapinfo synIDtrans tabpagenr tanh term_getaltscreen term_getline term_gettty term_setansicolors term_start test_garbagecollect_now test_null_channel test_null_partial test_scrollbar test_void timer_stopall trunc uniq winbufnr win_getid win_id2win winrestview wordcount
syn keyword vimFuncName contained and argv assert_fails assert_notmatch balloon_show buflisted bufwinnr changenr ch_close ch_getjob ch_readblob cindent complete_info cscope_connection did_filetype escape exists extendnew finddir floor foldclosedend fullcommand getbufinfo getcharmod getcmdpos getcursorcharpos getfsize getline getpid getregtype gettext getwinvar has_key histget iconv inputlist interrupt isnan job_start js_encode libcall list2str log mapcheck matchaddpos matchfuzzypos menu_info nextnonblank popup_atcursor popup_dialog popup_getoptions popup_menu popup_show prompt_setcallback prop_find prop_type_delete py3eval readblob reg_executing remote_expr remote_startserver reverse screenchars search searchpos setcellwidths setenv setpos settagstack sign_define sign_placelist sin soundfold spellsuggest str2float strchars string strtrans swapname synstack tabpagewinnr tempname term_getansicolors term_getscrolled terminalprops term_setapi term_wait test_garbagecollect_soon test_null_dict test_null_string test_setmouse timer_info tolower type values wincol win_gettype winlayout winsaveview writefile
syn keyword vimFuncName contained append asin assert_false assert_report balloon_split bufload byte2line char2nr ch_close_in ch_info ch_readraw clearmatches confirm cursor diff_filler eval exp feedkeys findfile fmod foldlevel funcref getbufline getcharpos getcmdtype getcwd getftime getloclist getpos gettabinfo getwininfo glob haslocaldir histnr indent inputrestore invert items job_status json_decode libcallnr listener_add log10 mapnew matcharg matchlist min nr2char popup_beval popup_filter_menu popup_getpos popup_move pow prompt_setinterrupt prop_list prop_type_get pyeval readdir reg_recording remote_foreground remove round screencol searchcount server2client setcharpos setfperm setqflist setwinvar sign_getdefined sign_undefine sinh sound_playevent split str2list strdisplaywidth strlen strwidth synconcealed system tagfiles term_dumpdiff term_getattr term_getsize term_list term_setkill test_alloc_fail test_getvalue test_null_function test_option_not_set test_settime timer_pause toupper typename virtcol windowsversion win_gotoid winline win_screenpos xor
syn keyword vimFuncName contained appendbufline assert_beeps assert_inrange assert_true browse bufloaded byteidx charclass chdir ch_log ch_sendexpr col copy debugbreak diff_hlID eventhandler
"--- syntax here and above generated by mkvimvim ---
" Special Vim Highlighting (not automatic) {{{1
@@ -227,7 +227,7 @@ syn keyword vimAugroupKey contained aug[roup]
" Operators: {{{2
" =========
syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,vimContinue,vim9Comment
syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimType,vimRegister,vimContinue,vim9Comment
syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile
syn match vimOper "\(\<is\|\<isnot\)[?#]\{0,2}\>" skipwhite nextgroup=vimString,vimSpecFile
syn match vimOper "||\|&&\|[-+.!]" skipwhite nextgroup=vimString,vimSpecFile
@@ -241,12 +241,13 @@ endif
" =========
syn cluster vimFuncList contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID
syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vim9Comment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimEnvvar,vimExecute,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLetHereDoc,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand
syn match vimFunction "\<\(fu\%[nction]\|def\)!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody
syn match vimFunction "\<\(fu\%[nction]\)!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody
syn match vimFunction "\<def!\=\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody
if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
syn region vimFuncBody contained fold start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\|enddef\>\)" contains=@vimFuncBodyList
else
syn region vimFuncBody contained start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\|enddef\>\)" contains=@vimFuncBodyList
syn region vimFuncBody contained start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\|enddef\>\)" contains=@vimFuncBodyList
endif
syn match vimFuncVar contained "a:\(\K\k*\|\d\+\)"
syn match vimFuncSID contained "\c<sid>\|\<s:"
@@ -256,6 +257,9 @@ syn match vimFuncBlank contained "\s\+"
syn keyword vimPattern contained start skip end
" vimTypes : new for vim9
syn match vimType ":\s*\zs\<\(bool\|number\|float\|string\|blob\|list<\|dict<\|job\|channel\|func\)\>"
" Special Filenames, Modifiers, Extension Removal: {{{2
" ===============================================
syn match vimSpecFile "<c\(word\|WORD\)>" nextgroup=vimSpecFileMod,vimSubst
@@ -384,7 +388,7 @@ syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1
syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
" Set command and associated set-options (vimOptions) with comment {{{2
syn region vimSet matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\." end="$" end="|" matchgroup=vimNotation end="<[cC][rR]>" oneline keepend contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vim9Comment,vimSetString,vimSetMod
syn region vimSet matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\.\n\@!" end="$" end="|" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vim9Comment,vimSetString,vimSetMod
syn region vimSetEqual contained start="[=:]\|[-+^]=" skip="\\\\\|\\\s" end="[| \t]"me=e-1 end="$" contains=vimCtrlChar,vimSetSep,vimNotation,vimEnvvar
syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar
syn match vimSetSep contained "[,:]"
@@ -419,7 +423,7 @@ syn case match
" Maps: {{{2
" ====
syn match vimMap "\<map\>!\=\ze\s*[^(]" skipwhite nextgroup=vimMapMod,vimMapLhs
syn keyword vimMap cm[ap] cno[remap] im[ap] ino[remap] lm[ap] ln[oremap] nm[ap] nn[oremap] no[remap] om[ap] ono[remap] smap snor[emap] tno[remap] tm[ap] vm[ap] vn[oremap] xm[ap] xn[oremap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
syn keyword vimMap cm[ap] cno[remap] im[ap] ino[remap] lm[ap] ln[oremap] nm[ap] nn[oremap] no[remap] om[ap] ono[remap] smap snor[emap] tno[remap] tm[ap] vm[ap] vmapc[lear] vn[oremap] xm[ap] xn[oremap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
syn keyword vimMap mapc[lear] smapc[lear]
syn keyword vimUnmap cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] tunma[p] unm[ap] unm[ap] vu[nmap] xu[nmap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
syn match vimMapLhs contained "\S\+" contains=vimNotation,vimCtrlChar skipwhite nextgroup=vimMapRhs
@@ -1002,6 +1006,7 @@ if !exists("skip_vim_syntax_inits")
hi def link vimSyntax vimCommand
hi def link vimSynType vimSpecial
hi def link vimTodo Todo
hi def link vimType Type
hi def link vimUnmap vimMap
hi def link vimUserAttrbCmpltFunc Special
hi def link vimUserAttrbCmplt vimSpecial
+21 -5
View File
@@ -195,6 +195,13 @@ func! BuildWidthTable(pattern, tableName)
let end = -1
let ranges = []
let dataidx = 0
" Account for indentation differences between ambiguous and doublewidth
" table in mbyte.c
if a:pattern == 'A'
let spc = ' '
else
let spc = "\t"
endif
for p in s:widthprops
if p[1][0] =~ a:pattern
if p[0] =~ '\.\.'
@@ -229,7 +236,7 @@ func! BuildWidthTable(pattern, tableName)
else
if start >= 0
" produce previous range
call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end))
call add(ranges, printf("%s{0x%04x, 0x%04x},", spc, start, end))
if a:pattern == 'A'
call add(s:ambitable, [start, end])
else
@@ -243,7 +250,7 @@ func! BuildWidthTable(pattern, tableName)
endif
endfor
if start >= 0
call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end))
call add(ranges, printf("%s{0x%04x, 0x%04x},", spc, start, end))
if a:pattern == 'A'
call add(s:ambitable, [start, end])
else
@@ -254,11 +261,20 @@ func! BuildWidthTable(pattern, tableName)
" New buffer to put the result in.
new
exe "file " . a:tableName
call setline(1, " static struct interval " . a:tableName . "[] =")
call setline(2, " {")
if a:pattern == 'A'
call setline(1, "static struct interval " . a:tableName . "[] =")
call setline(2, "{")
else
call setline(1, " static struct interval " . a:tableName . "[] =")
call setline(2, " {")
endif
call append('$', ranges)
call setline('$', getline('$')[:-2]) " remove last comma
call setline(line('$') + 1, " };")
if a:pattern == 'A'
call setline(line('$') + 1, "};")
else
call setline(line('$') + 1, " };")
endif
wincmd p
endfunc
+5 -1
View File
@@ -5,6 +5,7 @@
Name[de]=Vim
Name[eo]=Vim
Name[fr]=Vim
Name[it]=Vim
Name[ru]=Vim
Name[sr]=Vim
Name[tr]=Vim
@@ -13,6 +14,7 @@ Name=Vim
GenericName[de]=Texteditor
GenericName[eo]=Tekstoredaktilo
GenericName[fr]=Éditeur de texte
GenericName[it]=Editor di testi
GenericName[ja]=
GenericName[ru]=Текстовый редактор
GenericName[sr]=Едитор текст
@@ -22,6 +24,7 @@ GenericName=Text Editor
Comment[de]=Textdateien bearbeiten
Comment[eo]=Redakti tekstajn dosierojn
Comment[fr]=Éditer des fichiers texte
Comment[it]=Edita file di testo
Comment[ja]=
Comment[ru]=Редактирование текстовых файлов
Comment[sr]=Уређујте текст фајлове
@@ -60,7 +63,6 @@ Comment[hr]=Uređivanje tekstualne datoteke
Comment[hu]=Szövegfájlok szerkesztése
Comment[id]=Edit file teks
Comment[is]=Vinna með textaskrár
Comment[it]=Modifica file di testo
Comment[kn]= ಿ
Comment[ko]=
Comment[lt]=Redaguoti tekstines bylas
@@ -102,6 +104,7 @@ Type=Application
Keywords[de]=Text;Editor;
Keywords[eo]=Teksto;redaktilo;
Keywords[fr]=Texte;éditeur;
Keywords[it]=Testo;editor;
Keywords[ja]=;;
Keywords[ru]=текст;текстовый редактор;
Keywords[sr]=Текст;едитор;
@@ -111,6 +114,7 @@ Keywords=Text;editor;
Icon[de]=gvim
Icon[eo]=gvim
Icon[fr]=gvim
Icon[it]=gvim
Icon[ru]=gvim
Icon[sr]=gvim
Icon=gvim
+1 -1
View File
@@ -213,7 +213,7 @@ Troubleshooting
Cause: You can't delete an item you once added to the add-ins
list box.
Explanation: M$ just didn't put a 'delete' button in the dialog box.
Unfortunately there is no DEL key accellerator as well...
Unfortunately there is no DEL key accelerator as well...
Workaround: You can't kill it, but you can knock it out:
1. Uncheck the check box in front of 'Vim Developer Studio
Add-in'.
+2 -2
View File
@@ -832,7 +832,7 @@ ex_argdelete(exarg_T *eap)
{
// Don't give an error for ":%argdel" if the list is empty.
if (eap->line1 != 1 || eap->line2 != 0)
emsg(_(e_invrange));
emsg(_(e_invalid_range));
}
else
{
@@ -920,7 +920,7 @@ do_arg_all(
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
{
emsg(_(e_cmdwin));
emsg(_(e_invalid_in_cmdline_window));
return;
}
#endif
+2 -2
View File
@@ -13270,8 +13270,8 @@ if test "$enable_libsodium" = "yes"; then
libsodium_lib=-lsodium
libsodium_cflags=
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcanberra" >&5
$as_echo_n "checking for libcanberra... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsodium" >&5
$as_echo_n "checking for libsodium... " >&6; }
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $libsodium_cflags"
+2 -2
View File
@@ -2411,7 +2411,7 @@ buflist_getfile(
if (buf == NULL)
{
if ((options & GETF_ALT) && n == 0)
emsg(_(e_noalt));
emsg(_(e_no_alternate_file));
else
semsg(_("E92: Buffer %d not found"), n);
return FAIL;
@@ -3520,7 +3520,7 @@ getaltfname(
if (buflist_name_nr(0, &fname, &dummy) == FAIL)
{
if (errmsg)
emsg(_(e_noalt));
emsg(_(e_no_alternate_file));
return NULL;
}
return fname;
+12 -2
View File
@@ -494,14 +494,16 @@ buf_write_bytes(struct bw_info *ip)
if (crypt_works_inplace(ip->bw_buffer->b_cryptstate))
{
# endif
crypt_encode_inplace(ip->bw_buffer->b_cryptstate, buf, len, ip->bw_finish);
crypt_encode_inplace(ip->bw_buffer->b_cryptstate, buf, len,
ip->bw_finish);
# ifdef CRYPT_NOT_INPLACE
}
else
{
char_u *outbuf;
len = crypt_encode_alloc(curbuf->b_cryptstate, buf, len, &outbuf, ip->bw_finish);
len = crypt_encode_alloc(curbuf->b_cryptstate, buf, len, &outbuf,
ip->bw_finish);
if (len == 0)
return OK; // Crypt layer is buffering, will flush later.
wlen = write_eintr(ip->bw_fd, outbuf, len);
@@ -1980,10 +1982,18 @@ restore_backup:
write_info.bw_start_lnum = start;
#ifdef FEAT_PERSISTENT_UNDO
// TODO: if the selected crypt method prevents the undo file from being
// written, and existing undo file should be deleted.
write_undo_file = (buf->b_p_udf
&& overwriting
&& !append
&& !filtering
# ifdef CRYPT_NOT_INPLACE
// writing undo file requires
// crypt_encode_inplace()
&& (curbuf->b_cryptstate == NULL
|| crypt_works_inplace(curbuf->b_cryptstate))
# endif
&& reset_changed
&& !checking_conversion);
if (write_undo_file)
+2 -2
View File
@@ -1251,7 +1251,7 @@ channel_set_options(channel_T *channel, jobopt_T *opt)
if (!buf->b_p_ma && !channel->ch_part[PART_OUT].ch_nomodifiable)
{
emsg(_(e_modifiable));
emsg(_(e_cannot_make_changes_modifiable_is_off));
}
else
{
@@ -1297,7 +1297,7 @@ channel_set_options(channel_T *channel, jobopt_T *opt)
!opt->jo_modifiable[PART_ERR];
if (!buf->b_p_ma && !channel->ch_part[PART_ERR].ch_nomodifiable)
{
emsg(_(e_modifiable));
emsg(_(e_cannot_make_changes_modifiable_is_off));
}
else
{
+1 -1
View File
@@ -3977,7 +3977,7 @@ if test "$enable_libsodium" = "yes"; then
libsodium_lib=-lsodium
libsodium_cflags=
fi
AC_MSG_CHECKING(for libcanberra)
AC_MSG_CHECKING(for libsodium)
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $libsodium_cflags"
+43 -1
View File
@@ -10,6 +10,44 @@
* Definition of error messages, sorted on error number.
*/
EXTERN char e_backslash_should_be_followed_by[]
INIT(= N_("E10: \\ should be followed by /, ? or &"));
#ifdef FEAT_CMDWIN
EXTERN char e_invalid_in_cmdline_window[]
INIT(= N_("E11: Invalid in command-line window; <CR> executes, CTRL-C quits"));
#endif
EXTERN char e_command_not_allowed_from_vimrc_in_current_dir_or_tag_search[]
INIT(= N_("E12: Command not allowed from exrc/vimrc in current dir or tag search"));
EXTERN char e_file_exists[]
INIT(= N_("E13: File exists (add ! to override)"));
#ifdef FEAT_EVAL
EXTERN char e_invalid_expression_str[]
INIT(= N_("E15: Invalid expression: \"%s\""));
#endif
EXTERN char e_invalid_range[]
INIT(= N_("E16: Invalid range"));
#if defined(UNIX) || defined(FEAT_SYN_HL) || defined(FEAT_SPELL)
EXTERN char e_src_is_directory[]
INIT(= N_("E17: \"%s\" is a directory"));
#endif
#ifdef FEAT_EVAL
EXTERN char e_unexpected_characters_in_let[]
INIT(= N_("E18: Unexpected characters in :let"));
EXTERN char e_unexpected_characters_in_assignment[]
INIT(= N_("E18: Unexpected characters in assignment"));
#endif
EXTERN char e_mark_has_invalid_line_number[]
INIT(= N_("E19: Mark has invalid line number"));
EXTERN char e_mark_not_set[]
INIT(= N_("E20: Mark not set"));
EXTERN char e_cannot_make_changes_modifiable_is_off[]
INIT(= N_("E21: Cannot make changes, 'modifiable' is off"));
EXTERN char e_scripts_nested_too_deep[]
INIT(= N_("E22: Scripts nested too deep"));
EXTERN char e_no_alternate_file[]
INIT(= N_("E23: No alternate file"));
EXTERN char e_no_such_abbreviation[]
INIT(= N_("E24: No such abbreviation"));
#ifdef FEAT_EVAL
EXTERN char e_undefined_variable_str[]
INIT(= N_("E121: Undefined variable: %s"));
@@ -318,7 +356,7 @@ EXTERN char e_using_bool_as_number[]
EXTERN char e_missing_matching_bracket_after_dict_key[]
INIT(= N_("E1139: Missing matching bracket after dict key"));
EXTERN char e_for_argument_must_be_sequence_of_lists[]
INIT(= N_("E1140: For argument must be a sequence of lists"));
INIT(= N_("E1140: :for argument must be a sequence of lists"));
EXTERN char e_indexable_type_required[]
INIT(= N_("E1141: Indexable type required"));
EXTERN char e_non_empty_string_required[]
@@ -446,3 +484,7 @@ EXTERN char e_libsodium_decryption_failed[]
INIT(= N_("E1200: Decryption failed!"));
EXTERN char e_libsodium_decryption_failed_premature[]
INIT(= N_("E1201: Decryption failed: pre-mature end of file!"));
EXTERN char e_no_white_space_allowed_after_str_str[]
INIT(= N_("E1202: No white space allowed after '%s': %s"));
EXTERN char e_dot_can_only_be_used_on_dictionary_str[]
INIT(= N_("E1203: Dot can only be used on a dictionary: %s"));
+40 -17
View File
@@ -216,7 +216,7 @@ eval1_emsg(char_u **arg, typval_T *rettv, exarg_T *eap)
// Also check called_emsg for when using assert_fails().
if (!aborting() && did_emsg == did_emsg_before
&& called_emsg == called_emsg_before)
semsg(_(e_invexpr2), start);
semsg(_(e_invalid_expression_str), start);
}
clear_evalarg(&evalarg, eap);
return ret;
@@ -297,7 +297,7 @@ eval_expr_typval(typval_T *expr, typval_T *argv, int argc, typval_T *rettv)
if (*skipwhite(s) != NUL) // check for trailing chars after expr
{
clear_tv(rettv);
semsg(_(e_invexpr2), s);
semsg(_(e_invalid_expression_str), s);
return FAIL;
}
}
@@ -924,17 +924,30 @@ get_lval(
lp->ll_tv = &v->di_tv;
var1.v_type = VAR_UNKNOWN;
var2.v_type = VAR_UNKNOWN;
while (*p == '[' || (*p == '.' && lp->ll_tv->v_type == VAR_DICT))
while (*p == '[' || (*p == '.' && p[1] != '=' && p[1] != '.'))
{
if (!(lp->ll_tv->v_type == VAR_LIST && lp->ll_tv->vval.v_list != NULL)
&& !(lp->ll_tv->v_type == VAR_DICT)
&& !(lp->ll_tv->v_type == VAR_BLOB
&& lp->ll_tv->vval.v_blob != NULL))
if (*p == '.' && lp->ll_tv->v_type != VAR_DICT)
{
if (!quiet)
semsg(_(e_dot_can_only_be_used_on_dictionary_str), name);
return NULL;
}
if (lp->ll_tv->v_type != VAR_LIST
&& lp->ll_tv->v_type != VAR_DICT
&& lp->ll_tv->v_type != VAR_BLOB)
{
if (!quiet)
emsg(_("E689: Can only index a List, Dictionary or Blob"));
return NULL;
}
// a NULL list/blob works like an empty list/blob, allocate one now.
if (lp->ll_tv->v_type == VAR_LIST && lp->ll_tv->vval.v_list == NULL)
rettv_list_alloc(lp->ll_tv);
else if (lp->ll_tv->v_type == VAR_BLOB
&& lp->ll_tv->vval.v_blob == NULL)
rettv_blob_alloc(lp->ll_tv);
if (lp->ll_range)
{
if (!quiet)
@@ -1195,10 +1208,20 @@ get_lval(
lp->ll_li = list_find_index(lp->ll_list, &lp->ll_n1);
if (lp->ll_li == NULL)
{
clear_tv(&var2);
if (!quiet)
semsg(_(e_listidx), lp->ll_n1);
return NULL;
// Vim9: Allow for adding an item at the end.
if (in_vim9script() && lp->ll_n1 == lp->ll_list->lv_len
&& lp->ll_list->lv_lock == 0)
{
list_append_number(lp->ll_list, 0);
lp->ll_li = list_find_index(lp->ll_list, &lp->ll_n1);
}
if (lp->ll_li == NULL)
{
clear_tv(&var2);
if (!quiet)
semsg(_(e_listidx), lp->ll_n1);
return NULL;
}
}
if (lp->ll_valtype != NULL)
@@ -2245,7 +2268,7 @@ eval0(
if (end_error)
semsg(_(e_trailing_arg), p);
else
semsg(_(e_invexpr2), arg);
semsg(_(e_invalid_expression_str), arg);
}
// Some of the expression may not have been consumed. Do not check for
@@ -2735,7 +2758,7 @@ eval4(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
if (vim9script && type_is && (p[len] == '?' || p[len] == '#'))
{
semsg(_(e_invexpr2), p);
semsg(_(e_invalid_expression_str), p);
clear_tv(rettv);
return FAIL;
}
@@ -3344,7 +3367,7 @@ eval_leader(char_u **arg, int vim9)
// ++, --, -+ and +- are not accepted in Vim9 script
if (vim9 && (*p == '-' || *p == '+') && (*n == '-' || *n == '+'))
{
semsg(_(e_invexpr2), s);
semsg(_(e_invalid_expression_str), s);
return FAIL;
}
p = n;
@@ -3418,7 +3441,7 @@ eval7(
#endif
))
{
semsg(_(e_invexpr2), *arg);
semsg(_(e_invalid_expression_str), *arg);
++*arg;
return FAIL;
}
@@ -5584,7 +5607,7 @@ get_name_len(
// Only give an error when there is something, otherwise it will be
// reported at a higher level.
if (len == 0 && verbose && **arg != NUL)
semsg(_(e_invexpr2), *arg);
semsg(_(e_invalid_expression_str), *arg);
return len;
}
@@ -6130,7 +6153,7 @@ ex_echo(exarg_T *eap)
*/
if (!aborting() && did_emsg == did_emsg_before
&& called_emsg == called_emsg_before)
semsg(_(e_invexpr2), arg_start);
semsg(_(e_invalid_expression_str), arg_start);
need_clr_eos = FALSE;
break;
}
+11 -2
View File
@@ -1700,6 +1700,8 @@ static funcentry_T global_functions[] =
ret_void, f_test_garbagecollect_soon},
{"test_getvalue", 1, 1, FEARG_1, NULL,
ret_number, f_test_getvalue},
{"test_gui_drop_files", 4, 4, 0, NULL,
ret_void, f_test_gui_drop_files},
{"test_gui_mouse_event", 5, 5, 0, NULL,
ret_void, f_test_gui_mouse_event},
{"test_ignore_error", 1, 1, FEARG_1, NULL,
@@ -2921,7 +2923,7 @@ f_eval(typval_T *argvars, typval_T *rettv)
if (s == NULL || eval1(&s, rettv, &EVALARG_EVALUATE) == FAIL)
{
if (p != NULL && !aborting())
semsg(_(e_invexpr2), p);
semsg(_(e_invalid_expression_str), p);
need_clr_eos = FALSE;
rettv->v_type = VAR_NUMBER;
rettv->vval.v_number = 0;
@@ -4574,6 +4576,13 @@ f_has(typval_T *argvars, typval_T *rettv)
1
#else
0
#endif
},
{"drop_file",
#ifdef HAVE_DROP_FILE
1
#else
0
#endif
},
{"emacs_tags",
@@ -8006,7 +8015,7 @@ f_searchpos(typval_T *argvars, typval_T *rettv)
/*
* Set the cursor or mark position.
* If 'charpos' is TRUE, then use the column number as a character offet.
* If 'charpos' is TRUE, then use the column number as a character offset.
* Otherwise use the column number as a byte offset.
*/
static void
+4 -4
View File
@@ -1336,7 +1336,7 @@ ex_let_one(
semsg(_(e_letwrong), op);
else if (endchars != NULL
&& vim_strchr(endchars, *skipwhite(arg)) == NULL)
emsg(_(e_letunexp));
emsg(_(e_unexpected_characters_in_let));
else if (!check_secure())
{
c1 = name[len];
@@ -1381,7 +1381,7 @@ ex_let_one(
p = find_option_end(&arg, &opt_flags);
if (p == NULL || (endchars != NULL
&& vim_strchr(endchars, *skipwhite(p)) == NULL))
emsg(_(e_letunexp));
emsg(_(e_unexpected_characters_in_let));
else
{
long n = 0;
@@ -1483,7 +1483,7 @@ ex_let_one(
semsg(_(e_letwrong), op);
else if (endchars != NULL
&& vim_strchr(endchars, *skipwhite(arg + 1)) == NULL)
emsg(_(e_letunexp));
emsg(_(e_unexpected_characters_in_let));
else
{
char_u *ptofree = NULL;
@@ -1522,7 +1522,7 @@ ex_let_one(
{
if (endchars != NULL && vim_strchr(endchars,
*skipwhite(lv.ll_name_end)) == NULL)
emsg(_(e_letunexp));
emsg(_(e_unexpected_characters_in_let));
else
{
set_var_lval(&lv, p, tv, copy, flags, op, var_idx);
+3 -3
View File
@@ -363,7 +363,7 @@ get_winnr(tabpage_T *tp, typval_T *argvar)
if (invalid_arg)
{
semsg(_(e_invexpr2), arg);
semsg(_(e_invalid_expression_str), arg);
nr = 0;
}
}
@@ -636,7 +636,7 @@ f_tabpagenr(typval_T *argvars UNUSED, typval_T *rettv)
nr = valid_tabpage(lastused_tabpage) ?
tabpage_index(lastused_tabpage) : 0;
else
semsg(_(e_invexpr2), arg);
semsg(_(e_invalid_expression_str), arg);
}
}
else
@@ -726,7 +726,7 @@ f_win_gotoid(typval_T *argvars, typval_T *rettv)
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
{
emsg(_(e_cmdwin));
emsg(_(e_invalid_in_cmdline_window));
return;
}
#endif
+6 -6
View File
@@ -2120,7 +2120,7 @@ check_overwrite(
// with UNIX it is possible to open a directory
if (mch_isdir(ffname))
{
semsg(_(e_isadir2), ffname);
semsg(_(e_src_is_directory), ffname);
return FAIL;
}
#endif
@@ -2137,7 +2137,7 @@ check_overwrite(
else
#endif
{
emsg(_(e_exists));
emsg(_(e_file_exists));
return FAIL;
}
}
@@ -3586,7 +3586,7 @@ check_secure(void)
if (secure)
{
secure = 2;
emsg(_(e_curdir));
emsg(_(e_command_not_allowed_from_vimrc_in_current_dir_or_tag_search));
return TRUE;
}
#ifdef HAVE_SANDBOX
@@ -3729,7 +3729,7 @@ ex_substitute(exarg_T *eap)
++cmd;
if (vim_strchr((char_u *)"/?&", *cmd) == NULL)
{
emsg(_(e_backslash));
emsg(_(e_backslash_should_be_followed_by));
return;
}
if (*cmd != '&')
@@ -3944,7 +3944,7 @@ ex_substitute(exarg_T *eap)
if (!subflags.do_count && !curbuf->b_p_ma)
{
// Substitution is not allowed in non-'modifiable' buffer
emsg(_(e_modifiable));
emsg(_(e_cannot_make_changes_modifiable_is_off));
return;
}
@@ -4903,7 +4903,7 @@ ex_global(exarg_T *eap)
++cmd;
if (vim_strchr((char_u *)"/?&", *cmd) == NULL)
{
emsg(_(e_backslash));
emsg(_(e_backslash_should_be_followed_by));
return;
}
if (*cmd == '&')
+2 -2
View File
@@ -1881,10 +1881,10 @@ EXCMD(CMD_X, "X", ex_X,
// Commands that are recognized only in find_ex_command().
EXCMD(CMD_increment, "++", ex_incdec,
EX_EXTRA|EX_NOTRLCOM|EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK,
EX_EXTRA|EX_TRLBAR|EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK,
ADDR_NONE),
EXCMD(CMD_decrement, "--", ex_incdec,
EX_EXTRA|EX_NOTRLCOM|EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK,
EX_EXTRA|EX_TRLBAR|EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK,
ADDR_NONE),
#undef EXCMD
+29 -28
View File
@@ -2003,7 +2003,7 @@ do_one_cmd(
}
if (ea.line2 < 0)
errormsg = _(e_invrange);
errormsg = _(e_invalid_range);
else
{
if (ea.line2 == 0)
@@ -2130,7 +2130,7 @@ do_one_cmd(
if (!curbuf->b_p_ma && (ea.argt & EX_MODIFY))
{
// Command not allowed in non-'modifiable' buffer
errormsg = _(e_modifiable);
errormsg = _(e_cannot_make_changes_modifiable_is_off);
goto doend;
}
@@ -2140,7 +2140,7 @@ do_one_cmd(
if (cmdwin_type != 0 && !(ea.argt & EX_CMDWIN))
{
// Command not allowed in the command line window
errormsg = _(e_cmdwin);
errormsg = _(e_invalid_in_cmdline_window);
goto doend;
}
#endif
@@ -3002,7 +3002,7 @@ parse_command_modifiers(
{
if (tabnr < 0 || tabnr > LAST_TAB_NR)
{
*errormsg = _(e_invrange);
*errormsg = _(e_invalid_range);
return FAIL;
}
cmod->cmod_tab = tabnr + 1;
@@ -3245,14 +3245,14 @@ parse_cmd_address(exarg_T *eap, char **errormsg, int silent)
{
// there is no Vim command which uses '%' and
// ADDR_WINDOWS or ADDR_TABS
*errormsg = _(e_invrange);
*errormsg = _(e_invalid_range);
return FAIL;
}
break;
case ADDR_TABS_RELATIVE:
case ADDR_UNSIGNED:
case ADDR_QUICKFIX:
*errormsg = _(e_invrange);
*errormsg = _(e_invalid_range);
return FAIL;
case ADDR_ARGUMENTS:
if (ARGCOUNT == 0)
@@ -3284,7 +3284,7 @@ parse_cmd_address(exarg_T *eap, char **errormsg, int silent)
// '*' - visual area
if (eap->addr_type != ADDR_LINES)
{
*errormsg = _(e_invrange);
*errormsg = _(e_invalid_range);
return FAIL;
}
@@ -3929,7 +3929,7 @@ addr_error(cmd_addr_T addr_type)
if (addr_type == ADDR_NONE)
emsg(_(e_norange));
else
emsg(_(e_invrange));
emsg(_(e_invalid_range));
}
/*
@@ -4216,7 +4216,7 @@ get_address(
i = RE_SEARCH;
else
{
emsg(_(e_backslash));
emsg(_(e_backslash_should_be_followed_by));
cmd = NULL;
goto error;
}
@@ -4318,7 +4318,7 @@ get_address(
if (addr_type == ADDR_TABS_RELATIVE)
{
emsg(_(e_invrange));
emsg(_(e_invalid_range));
cmd = NULL;
goto error;
}
@@ -4466,7 +4466,7 @@ invalid_range(exarg_T *eap)
if ( eap->line1 < 0
|| eap->line2 < 0
|| eap->line1 > eap->line2)
return _(e_invrange);
return _(e_invalid_range);
if (eap->argt & EX_RANGE)
{
@@ -4478,46 +4478,46 @@ invalid_range(exarg_T *eap)
+ (eap->cmdidx == CMD_diffget)
#endif
)
return _(e_invrange);
return _(e_invalid_range);
break;
case ADDR_ARGUMENTS:
// add 1 if ARGCOUNT is 0
if (eap->line2 > ARGCOUNT + (!ARGCOUNT))
return _(e_invrange);
return _(e_invalid_range);
break;
case ADDR_BUFFERS:
// Only a boundary check, not whether the buffers actually
// exist.
if (eap->line1 < 1 || eap->line2 > get_highest_fnum())
return _(e_invrange);
return _(e_invalid_range);
break;
case ADDR_LOADED_BUFFERS:
buf = firstbuf;
while (buf->b_ml.ml_mfp == NULL)
{
if (buf->b_next == NULL)
return _(e_invrange);
return _(e_invalid_range);
buf = buf->b_next;
}
if (eap->line1 < buf->b_fnum)
return _(e_invrange);
return _(e_invalid_range);
buf = lastbuf;
while (buf->b_ml.ml_mfp == NULL)
{
if (buf->b_prev == NULL)
return _(e_invrange);
return _(e_invalid_range);
buf = buf->b_prev;
}
if (eap->line2 > buf->b_fnum)
return _(e_invrange);
return _(e_invalid_range);
break;
case ADDR_WINDOWS:
if (eap->line2 > LAST_WIN_NR)
return _(e_invrange);
return _(e_invalid_range);
break;
case ADDR_TABS:
if (eap->line2 > LAST_TAB_NR)
return _(e_invrange);
return _(e_invalid_range);
break;
case ADDR_TABS_RELATIVE:
case ADDR_OTHER:
@@ -4527,14 +4527,14 @@ invalid_range(exarg_T *eap)
#ifdef FEAT_QUICKFIX
// No error for value that is too big, will use the last entry.
if (eap->line2 <= 0)
return _(e_invrange);
return _(e_invalid_range);
#endif
break;
case ADDR_QUICKFIX_VALID:
#ifdef FEAT_QUICKFIX
if ((eap->line2 != 1 && eap->line2 > qf_get_valid_size(eap))
|| eap->line2 < 0)
return _(e_invrange);
return _(e_invalid_range);
#endif
break;
case ADDR_UNSIGNED:
@@ -5193,7 +5193,8 @@ ex_autocmd(exarg_T *eap)
if (secure)
{
secure = 2;
eap->errmsg = _(e_curdir);
eap->errmsg =
_(e_command_not_allowed_from_vimrc_in_current_dir_or_tag_search);
}
else if (eap->cmdidx == CMD_autocmd)
do_autocmd(eap->arg, eap->forceit);
@@ -5848,7 +5849,7 @@ get_tabpage_arg(exarg_T *eap)
{
if (unaccept_arg0 && eap->line2 == 0)
{
eap->errmsg = _(e_invrange);
eap->errmsg = _(e_invalid_range);
tab_number = 0;
}
else
@@ -5858,7 +5859,7 @@ get_tabpage_arg(exarg_T *eap)
{
--tab_number;
if (tab_number < unaccept_arg0)
eap->errmsg = _(e_invrange);
eap->errmsg = _(e_invalid_range);
}
}
}
@@ -6570,7 +6571,7 @@ ex_tabnext(exarg_T *eap)
tab_number = eap->line2;
if (tab_number < 1)
{
eap->errmsg = _(e_invrange);
eap->errmsg = _(e_invalid_range);
return;
}
}
@@ -7723,7 +7724,7 @@ ex_copymove(exarg_T *eap)
*/
if (n == MAXLNUM || n < 0 || n > curbuf->b_ml.ml_line_count)
{
emsg(_(e_invrange));
emsg(_(e_invalid_range));
return;
}
@@ -8179,7 +8180,7 @@ open_exfile(
// with Unix it is possible to open a directory
if (mch_isdir(fname))
{
semsg(_(e_isadir2), fname);
semsg(_(e_src_is_directory), fname);
return NULL;
}
#endif
+1 -1
View File
@@ -2631,7 +2631,7 @@ get_text_locked_msg(void)
{
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
return e_cmdwin;
return e_invalid_in_cmdline_window;
#endif
if (textwinlock != 0)
return e_textwinlock;
+8
View File
@@ -1298,9 +1298,17 @@ retry:
* At start of file: Check for magic number of encryption.
*/
if (filesize == 0 && size > 0)
{
cryptkey = check_for_cryptkey(cryptkey, ptr, &size,
&filesize, newfile, sfname,
&did_ask_for_key);
# ifdef CRYPT_NOT_INPLACE
if (curbuf->b_cryptstate != NULL
&& !crypt_works_inplace(curbuf->b_cryptstate))
// reading undo file requires crypt_decode_inplace()
read_undo_file = FALSE;
# endif
}
/*
* Decrypt the read bytes. This is done before checking for
* EOF because the crypt layer may be buffering.
+2 -2
View File
@@ -856,7 +856,7 @@ f_delete(typval_T *argvars, typval_T *rettv)
// delete a directory recursively
rettv->vval.v_number = delete_recursive(name);
else
semsg(_(e_invexpr2), flags);
semsg(_(e_invalid_expression_str), flags);
}
/*
@@ -1685,7 +1685,7 @@ read_file_or_blob(typval_T *argvars, typval_T *rettv, int always_blob)
if (mch_isdir(fname))
{
semsg(_(e_isadir2), fname);
semsg(_(e_src_is_directory), fname);
return;
}
if (*fname == NUL || (fd = mch_fopen((char *)fname, READBIN)) == NULL)
+1 -1
View File
@@ -1762,7 +1762,7 @@ foldCreateMarkers(linenr_T start, linenr_T end)
{
if (!curbuf->b_p_ma)
{
emsg(_(e_modifiable));
emsg(_(e_cannot_make_changes_modifiable_is_off));
return;
}
parseMarker(curwin);
+1 -1
View File
@@ -1447,7 +1447,7 @@ openscript(
{
if (curscript + 1 == NSCRIPT)
{
emsg(_(e_nesting));
emsg(_(e_scripts_nested_too_deep));
return;
}
-20
View File
@@ -1585,11 +1585,6 @@ EXTERN int netbeansSuppressNoLines INIT(= 0); // skip "No lines in buffer"
*/
EXTERN char e_abort[] INIT(= N_("E470: Command aborted"));
EXTERN char e_argreq[] INIT(= N_("E471: Argument required"));
EXTERN char e_backslash[] INIT(= N_("E10: \\ should be followed by /, ? or &"));
#ifdef FEAT_CMDWIN
EXTERN char e_cmdwin[] INIT(= N_("E11: Invalid in command-line window; <CR> executes, CTRL-C quits"));
#endif
EXTERN char e_curdir[] INIT(= N_("E12: Command not allowed from exrc/vimrc in current dir or tag search"));
#ifdef FEAT_EVAL
EXTERN char e_endif[] INIT(= N_("E171: Missing :endif"));
EXTERN char e_catch[] INIT(= N_("E603: :catch without :try"));
@@ -1602,7 +1597,6 @@ EXTERN char e_endfor[] INIT(= N_("E170: Missing :endfor"));
EXTERN char e_while[] INIT(= N_("E588: :endwhile without :while"));
EXTERN char e_for[] INIT(= N_("E588: :endfor without :for"));
#endif
EXTERN char e_exists[] INIT(= N_("E13: File exists (add ! to override)"));
EXTERN char e_failed[] INIT(= N_("E472: Command failed"));
#if defined(FEAT_GUI) && defined(FEAT_XFONTSET)
EXTERN char e_fontset[] INIT(= N_("E234: Unknown fontset: %s"));
@@ -1623,13 +1617,6 @@ EXTERN char e_invarg2[] INIT(= N_("E475: Invalid argument: %s"));
EXTERN char e_duparg2[] INIT(= N_("E983: Duplicate argument: %s"));
EXTERN char e_invargval[] INIT(= N_("E475: Invalid value for argument %s"));
EXTERN char e_invargNval[] INIT(= N_("E475: Invalid value for argument %s: %s"));
#ifdef FEAT_EVAL
EXTERN char e_invexpr2[] INIT(= N_("E15: Invalid expression: \"%s\""));
#endif
EXTERN char e_invrange[] INIT(= N_("E16: Invalid range"));
#if defined(UNIX) || defined(FEAT_SYN_HL) || defined(FEAT_SPELL)
EXTERN char e_isadir2[] INIT(= N_("E17: \"%s\" is a directory"));
#endif
#ifdef FEAT_SPELL
EXTERN char e_no_spell[] INIT(= N_("E756: Spell checking is not possible"));
#endif
@@ -1651,12 +1638,6 @@ EXTERN char e_fsync[] INIT(= N_("E667: Fsync failed"));
EXTERN char e_loadlib[] INIT(= N_("E370: Could not load library %s"));
EXTERN char e_loadfunc[] INIT(= N_("E448: Could not load library function %s"));
#endif
EXTERN char e_markinval[] INIT(= N_("E19: Mark has invalid line number"));
EXTERN char e_marknotset[] INIT(= N_("E20: Mark not set"));
EXTERN char e_modifiable[] INIT(= N_("E21: Cannot make changes, 'modifiable' is off"));
EXTERN char e_nesting[] INIT(= N_("E22: Scripts nested too deep"));
EXTERN char e_noalt[] INIT(= N_("E23: No alternate file"));
EXTERN char e_noabbr[] INIT(= N_("E24: No such abbreviation"));
EXTERN char e_nobang[] INIT(= N_("E477: No ! allowed"));
#if !defined(FEAT_GUI) || defined(VIMDLL)
EXTERN char e_nogvim[] INIT(= N_("E25: GUI cannot be used: Not enabled at compile time"));
@@ -1738,7 +1719,6 @@ EXTERN char e_listdictblobarg[] INIT(= N_("E896: Argument of %s must be a List,
EXTERN char e_modulus[] INIT(= N_("E804: Cannot use '%' with Float"));
EXTERN char e_const_option[] INIT(= N_("E996: Cannot lock an option"));
EXTERN char e_unknown_option[] INIT(= N_("E113: Unknown option: %s"));
EXTERN char e_letunexp[] INIT(= N_("E18: Unexpected characters in :let"));
EXTERN char e_reduceempty[] INIT(= N_("E998: Reduce of an empty %s with no initial value"));
EXTERN char e_no_dict_key[] INIT(= N_("E857: Dictionary key \"%s\" required"));
#endif
+1
View File
@@ -5619,6 +5619,7 @@ gui_handle_drop(
{
vim_free(fnames[0]);
vim_free(fnames);
vim_free(p);
}
else
handle_drop(count, fnames, (modifiers & MOUSE_CTRL) != 0,
+1 -1
View File
@@ -991,7 +991,7 @@ op_reindent(oparg_T *oap, int (*how)(void))
// Don't even try when 'modifiable' is off.
if (!curbuf->b_p_ma)
{
emsg(_(e_modifiable));
emsg(_(e_cannot_make_changes_modifiable_is_off));
return;
}
+1 -1
View File
@@ -1556,7 +1556,7 @@ list_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg)
break;
}
if (li == NULL) // didn't find "item2" after "item"
emsg(_(e_invrange));
emsg(_(e_invalid_range));
else
{
vimlist_remove(l, item, item2);
+1 -1
View File
@@ -2720,7 +2720,7 @@ do_exmap(exarg_T *eap, int isabbrev)
{
case 1: emsg(_(e_invarg));
break;
case 2: emsg((isabbrev ? _(e_noabbr) : _(e_nomap)));
case 2: emsg((isabbrev ? _(e_no_such_abbreviation) : _(e_nomap)));
break;
}
}
+2 -2
View File
@@ -588,12 +588,12 @@ check_mark(pos_T *pos)
// lnum is negative if mark is in another file can can't get that
// file, error message already give then.
if (pos->lnum == 0)
emsg(_(e_marknotset));
emsg(_(e_mark_not_set));
return FAIL;
}
if (pos->lnum > curbuf->b_ml.ml_line_count)
{
emsg(_(e_markinval));
emsg(_(e_mark_has_invalid_line_number));
return FAIL;
}
return OK;
+55 -30
View File
@@ -1389,7 +1389,8 @@ utf_char2cells(int c)
{0x26ce, 0x26ce},
{0x26d4, 0x26d4},
{0x26ea, 0x26ea},
{0x26f2, 0x26f5},
{0x26f2, 0x26f3},
{0x26f5, 0x26f5},
{0x26fa, 0x26fa},
{0x26fd, 0x26fd},
{0x2705, 0x2705},
@@ -1414,8 +1415,7 @@ utf_char2cells(int c)
{0x3099, 0x30ff},
{0x3105, 0x312f},
{0x3131, 0x318e},
{0x3190, 0x31ba},
{0x31c0, 0x31e3},
{0x3190, 0x31e3},
{0x31f0, 0x321e},
{0x3220, 0x3247},
{0x3250, 0x4dbf},
@@ -1431,8 +1431,10 @@ utf_char2cells(int c)
{0xff01, 0xff60},
{0xffe0, 0xffe6},
{0x16fe0, 0x16fe3},
{0x16ff0, 0x16ff1},
{0x17000, 0x187f7},
{0x18800, 0x18af2},
{0x18800, 0x18cd5},
{0x18d00, 0x18d08},
{0x1b000, 0x1b11e},
{0x1b150, 0x1b152},
{0x1b164, 0x1b167},
@@ -1467,20 +1469,22 @@ utf_char2cells(int c)
{0x1f680, 0x1f6c5},
{0x1f6cc, 0x1f6cc},
{0x1f6d0, 0x1f6d2},
{0x1f6d5, 0x1f6d5},
{0x1f6d5, 0x1f6d7},
{0x1f6eb, 0x1f6ec},
{0x1f6f4, 0x1f6fa},
{0x1f6f4, 0x1f6fc},
{0x1f7e0, 0x1f7eb},
{0x1f90d, 0x1f971},
{0x1f973, 0x1f976},
{0x1f97a, 0x1f9a2},
{0x1f9a5, 0x1f9aa},
{0x1f9ae, 0x1f9ca},
{0x1f90c, 0x1f93a},
{0x1f93c, 0x1f945},
{0x1f947, 0x1f978},
{0x1f97a, 0x1f9cb},
{0x1f9cd, 0x1f9ff},
{0x1fa70, 0x1fa73},
{0x1fa70, 0x1fa74},
{0x1fa78, 0x1fa7a},
{0x1fa80, 0x1fa82},
{0x1fa90, 0x1fa95},
{0x1fa80, 0x1fa86},
{0x1fa90, 0x1faa8},
{0x1fab0, 0x1fab6},
{0x1fac0, 0x1fac2},
{0x1fad0, 0x1fad6},
{0x20000, 0x2fffd},
{0x30000, 0x3fffd}
};
@@ -2350,7 +2354,7 @@ utf_iscomposing(int c)
{0x0b3e, 0x0b44},
{0x0b47, 0x0b48},
{0x0b4b, 0x0b4d},
{0x0b56, 0x0b57},
{0x0b55, 0x0b57},
{0x0b62, 0x0b63},
{0x0b82, 0x0b82},
{0x0bbe, 0x0bc2},
@@ -2377,7 +2381,7 @@ utf_iscomposing(int c)
{0x0d4a, 0x0d4d},
{0x0d57, 0x0d57},
{0x0d62, 0x0d63},
{0x0d82, 0x0d83},
{0x0d81, 0x0d83},
{0x0dca, 0x0dca},
{0x0dcf, 0x0dd4},
{0x0dd6, 0x0dd6},
@@ -2424,7 +2428,7 @@ utf_iscomposing(int c)
{0x1a55, 0x1a5e},
{0x1a60, 0x1a7c},
{0x1a7f, 0x1a7f},
{0x1ab0, 0x1abe},
{0x1ab0, 0x1ac0},
{0x1b00, 0x1b04},
{0x1b34, 0x1b44},
{0x1b6b, 0x1b73},
@@ -2453,6 +2457,7 @@ utf_iscomposing(int c)
{0xa806, 0xa806},
{0xa80b, 0xa80b},
{0xa823, 0xa827},
{0xa82c, 0xa82c},
{0xa880, 0xa881},
{0xa8b4, 0xa8c5},
{0xa8e0, 0xa8f1},
@@ -2488,6 +2493,7 @@ utf_iscomposing(int c)
{0x10a3f, 0x10a3f},
{0x10ae5, 0x10ae6},
{0x10d24, 0x10d27},
{0x10eab, 0x10eac},
{0x10f46, 0x10f50},
{0x11000, 0x11002},
{0x11038, 0x11046},
@@ -2500,6 +2506,7 @@ utf_iscomposing(int c)
{0x11180, 0x11182},
{0x111b3, 0x111c0},
{0x111c9, 0x111cc},
{0x111ce, 0x111cf},
{0x1122c, 0x11237},
{0x1123e, 0x1123e},
{0x112df, 0x112ea},
@@ -2522,6 +2529,11 @@ utf_iscomposing(int c)
{0x116ab, 0x116b7},
{0x1171d, 0x1172b},
{0x1182c, 0x1183a},
{0x11930, 0x11935},
{0x11937, 0x11938},
{0x1193b, 0x1193e},
{0x11940, 0x11940},
{0x11942, 0x11943},
{0x119d1, 0x119d7},
{0x119da, 0x119e0},
{0x119e4, 0x119e4},
@@ -2549,6 +2561,8 @@ utf_iscomposing(int c)
{0x16f4f, 0x16f4f},
{0x16f51, 0x16f87},
{0x16f8f, 0x16f92},
{0x16fe4, 0x16fe4},
{0x16ff0, 0x16ff1},
{0x1bc9d, 0x1bc9e},
{0x1d165, 0x1d169},
{0x1d16d, 0x1d172},
@@ -2650,6 +2664,7 @@ static struct interval emoji_all[] =
{0x2699, 0x2699},
{0x269b, 0x269c},
{0x26a0, 0x26a1},
{0x26a7, 0x26a7},
{0x26aa, 0x26ab},
{0x26b0, 0x26b1},
{0x26bd, 0x26be},
@@ -2695,7 +2710,8 @@ static struct interval emoji_all[] =
{0x3299, 0x3299},
{0x1f004, 0x1f004},
{0x1f0cf, 0x1f0cf},
{0x1f170, 0x1f189},
{0x1f170, 0x1f171},
{0x1f17e, 0x1f17f},
{0x1f18e, 0x1f18e},
{0x1f191, 0x1f19a},
{0x1f1e6, 0x1f1ff},
@@ -2735,21 +2751,25 @@ static struct interval emoji_all[] =
{0x1f5fa, 0x1f64f},
{0x1f680, 0x1f6c5},
{0x1f6cb, 0x1f6d2},
{0x1f6d5, 0x1f6d7},
{0x1f6e0, 0x1f6e5},
{0x1f6e9, 0x1f6e9},
{0x1f6eb, 0x1f6ec},
{0x1f6f0, 0x1f6f0},
{0x1f6f3, 0x1f6f9},
{0x1f910, 0x1f93a},
{0x1f93c, 0x1f93e},
{0x1f940, 0x1f945},
{0x1f947, 0x1f970},
{0x1f973, 0x1f976},
{0x1f97a, 0x1f97a},
{0x1f97c, 0x1f9a2},
{0x1f9b0, 0x1f9b9},
{0x1f9c0, 0x1f9c2},
{0x1f9d0, 0x1f9ff}
{0x1f6f3, 0x1f6fc},
{0x1f7e0, 0x1f7eb},
{0x1f90c, 0x1f93a},
{0x1f93c, 0x1f945},
{0x1f947, 0x1f978},
{0x1f97a, 0x1f9cb},
{0x1f9cd, 0x1f9ff},
{0x1fa70, 0x1fa74},
{0x1fa78, 0x1fa7a},
{0x1fa80, 0x1fa86},
{0x1fa90, 0x1faa8},
{0x1fab0, 0x1fab6},
{0x1fac0, 0x1fac2},
{0x1fad0, 0x1fad6}
};
/*
@@ -3097,6 +3117,8 @@ static convertStruct foldCase[] =
{0xa7c4,0xa7c4,-1,-48},
{0xa7c5,0xa7c5,-1,-42307},
{0xa7c6,0xa7c6,-1,-35384},
{0xa7c7,0xa7c9,2,1},
{0xa7f5,0xa7f5,-1,1},
{0xab70,0xabbf,1,-38864},
{0xff21,0xff3a,1,32},
{0x10400,0x10427,1,40},
@@ -3321,6 +3343,8 @@ static convertStruct toLower[] =
{0xa7c4,0xa7c4,-1,-48},
{0xa7c5,0xa7c5,-1,-42307},
{0xa7c6,0xa7c6,-1,-35384},
{0xa7c7,0xa7c9,2,1},
{0xa7f5,0xa7f5,-1,1},
{0xff21,0xff3a,1,32},
{0x10400,0x10427,1,40},
{0x104b0,0x104d3,1,40},
@@ -3509,7 +3533,8 @@ static convertStruct toUpper[] =
{0xa794,0xa794,-1,48},
{0xa797,0xa7a9,2,-1},
{0xa7b5,0xa7bf,2,-1},
{0xa7c3,0xa7c3,-1,-1},
{0xa7c3,0xa7c8,5,-1},
{0xa7ca,0xa7f6,44,-1},
{0xab53,0xab53,-1,-928},
{0xab70,0xabbf,1,-38864},
{0xff41,0xff5a,1,-32},
+6 -4
View File
@@ -3662,7 +3662,7 @@ ml_delete_int(buf_T *buf, linenr_T lnum, int flags)
#ifdef FEAT_PROP_POPUP
// If there are text properties, make a copy, so that we can update
// properties in preceding and following lines.
if (buf->b_has_textprop && !(flags & ML_DEL_UNDO))
if (buf->b_has_textprop && !(flags & (ML_DEL_UNDO | ML_DEL_NOPROP)))
{
size_t textlen = STRLEN((char_u *)dp + line_start) + 1;
@@ -3765,9 +3765,11 @@ theend:
{
// Adjust text properties in the line above and below.
if (lnum > 1)
adjust_text_props_for_delete(buf, lnum - 1, textprop_save, textprop_save_len, TRUE);
adjust_text_props_for_delete(buf, lnum - 1, textprop_save,
textprop_save_len, TRUE);
if (lnum <= buf->b_ml.ml_line_count)
adjust_text_props_for_delete(buf, lnum, textprop_save, textprop_save_len, FALSE);
adjust_text_props_for_delete(buf, lnum, textprop_save,
textprop_save_len, FALSE);
}
vim_free(textprop_save);
#endif
@@ -4021,7 +4023,7 @@ ml_flush_line(buf_T *buf)
| ML_APPEND_NOPROP
#endif
);
(void)ml_delete_int(buf, lnum, 0);
(void)ml_delete_int(buf, lnum, ML_DEL_NOPROP);
}
}
vim_free(new_line);
+3 -3
View File
@@ -5222,7 +5222,7 @@ nv_Replace(cmdarg_T *cap)
else if (!checkclearopq(cap->oap))
{
if (!curbuf->b_p_ma)
emsg(_(e_modifiable));
emsg(_(e_cannot_make_changes_modifiable_is_off));
else
{
if (virtual_active())
@@ -5247,7 +5247,7 @@ nv_vreplace(cmdarg_T *cap)
else if (!checkclearopq(cap->oap))
{
if (!curbuf->b_p_ma)
emsg(_(e_modifiable));
emsg(_(e_cannot_make_changes_modifiable_is_off));
else
{
if (cap->extra_char == Ctrl_V) // get another character
@@ -7087,7 +7087,7 @@ nv_edit(cmdarg_T *cap)
else if (!curbuf->b_p_ma && !p_im)
{
// Only give this error when 'insertmode' is off.
emsg(_(e_modifiable));
emsg(_(e_cannot_make_changes_modifiable_is_off));
clearop(cap->oap);
if (cap->cmdchar == K_PS)
// drop the pasted text
+1 -1
View File
@@ -621,7 +621,7 @@ op_delete(oparg_T *oap)
if (!curbuf->b_p_ma)
{
emsg(_(e_modifiable));
emsg(_(e_cannot_make_changes_modifiable_is_off));
return FAIL;
}
+2 -2
View File
@@ -977,7 +977,7 @@ ambw_end:
if (gvarp == &p_fenc)
{
if (!curbuf->b_p_ma && opt_flags != OPT_GLOBAL)
errmsg = e_modifiable;
errmsg = e_cannot_make_changes_modifiable_is_off;
else if (vim_strchr(*varp, ',') != NULL)
// No comma allowed in 'fileencoding'; catches confusing it
// with 'fileencodings'.
@@ -1140,7 +1140,7 @@ ambw_end:
else if (gvarp == &p_ff)
{
if (!curbuf->b_p_ma && !(opt_flags & OPT_GLOBAL))
errmsg = e_modifiable;
errmsg = e_cannot_make_changes_modifiable_is_off;
else if (check_opt_strings(*varp, p_ff_values, FALSE) != OK)
errmsg = e_invarg;
else
+59 -9
View File
@@ -115,6 +115,9 @@ static char version[] __attribute__((used)) =
VIM_VERSION_MINOR_STR
# ifdef PATCHLEVEL
"." PATCHLEVEL
# endif
# ifdef BUILDDATE
" (" BUILDDATE ")"
# endif
;
#endif
@@ -443,7 +446,7 @@ mch_check_win(int argc, char **argv)
* we use a pointer to the current task instead. This should be a
* shared structure and thus globally unique.
*/
#ifdef __amigaos4__
#if !defined(__amigaos4__) && !defined(__AROS__) && !defined(__MORPHOS__)
sprintf((char *)buf1, "t:nc%p", FindTask(0));
#else
sprintf((char *)buf1, "t:nc%ld", (long)buf1);
@@ -703,7 +706,7 @@ mch_get_host_name(char_u *s, int len)
long
mch_get_pid(void)
{
#ifdef __amigaos4__
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__)
// This is as close to a pid as we can come. We could use CLI numbers also,
// but then we would have two different types of process identifiers.
return((long)FindTask(0));
@@ -979,7 +982,7 @@ mch_exit(int r)
void
mch_settmode(tmode_T tmode)
{
#if defined(__AROS__) || defined(__amigaos4__)
#if defined(__AROS__) || defined(__amigaos4__) || defined(__MORPHOS__)
if (!SetMode(raw_in, tmode == TMODE_RAW ? 1 : 0))
#else
if (dos_packet(MP(raw_in), (long)ACTION_SCREEN_MODE,
@@ -1005,7 +1008,58 @@ mch_settmode(tmode_T tmode)
#endif
/*
* try to get the real window size
* Get console size in a system friendly way on AROS and MorphOS.
* Return FAIL for failure, OK otherwise
*/
#if defined(__AROS__) || defined(__MORPHOS__)
int
mch_get_shellsize(void)
{
if (!term_console)
return FAIL;
if (raw_in && raw_out)
{
// Save current console mode.
int old_tmode = cur_tmode;
char ctrl[] = "\x9b""0 q";
// Set RAW mode.
mch_settmode(TMODE_RAW);
// Write control sequence to console.
if (Write(raw_out, ctrl, sizeof(ctrl)) == sizeof(ctrl))
{
char scan[] = "\x9b""1;1;%d;%d r",
answ[sizeof(scan) + 8] = { '\0' };
// Read return sequence from input.
if (Read(raw_in, answ, sizeof(answ) - 1) > 0)
{
// Parse result and set Vim globals.
if (sscanf(answ, scan, &Rows, &Columns) == 2)
{
// Restore console mode.
mch_settmode(old_tmode);
return OK;
}
}
}
// Restore console mode.
mch_settmode(old_tmode);
}
// I/O error. Default size fallback.
term_console = FALSE;
Columns = 80;
Rows = 24;
return FAIL;
}
#else
/*
* Try to get the real window size,
* return FAIL for failure, OK otherwise
*/
int
@@ -1037,13 +1091,8 @@ mch_get_shellsize(void)
OUT_STR("\233t\233u"); // CSI t CSI u
out_flush();
#ifdef __AROS__
if (!Info(raw_out, id)
|| (wb_window = (struct Window *) id->id_VolumeNode) == NULL)
#else
if (dos_packet(MP(raw_out), (long)ACTION_DISK_INFO, ((ULONG) id) >> 2) == 0
|| (wb_window = (struct Window *)id->id_VolumeNode) == NULL)
#endif
{
// it's not an amiga window, maybe aux device
// terminal type should be set
@@ -1078,6 +1127,7 @@ out:
return FAIL;
}
#endif
/*
* Try to set the real window size to Rows and Columns.
+11 -2
View File
@@ -2488,8 +2488,17 @@ mch_get_pid(void)
int
mch_process_running(long pid)
{
// EMX kill() not working correctly, it seems
return kill(pid, 0) == 0;
// If there is no error the process must be running.
if (kill(pid, 0) == 0)
return TRUE;
#ifdef ESRCH
// If the error is ESRCH then the process is not running.
if (errno == ESRCH)
return FALSE;
#endif
// If the process is running and owned by another user we get EPERM. With
// other errors the process might be running, assuming it is then.
return TRUE;
}
#if !defined(HAVE_STRERROR) && defined(USE_GETCWD)
-1
View File
@@ -40,7 +40,6 @@ Comment[hr]=Uređivanje tekstualne datoteke
Comment[hu]=Szövegfájlok szerkesztése
Comment[id]=Edit file teks
Comment[is]=Vinna með textaskrár
Comment[it]=Modifica file di testo
Comment[kn]=ಪಠ್ಯ ಕಡತಗಳನ್ನು ಸಂಪಾದಿಸು
Comment[ko]=텍스트 파일을 편집합니다
Comment[lt]=Redaguoti tekstines bylas
+3873 -1469
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -40,7 +40,6 @@ Comment[hr]=Uređivanje tekstualne datoteke
Comment[hu]=Szövegfájlok szerkesztése
Comment[id]=Edit file teks
Comment[is]=Vinna með textaskrár
Comment[it]=Modifica file di testo
Comment[kn]=ಪಠ್ಯ ಕಡತಗಳನ್ನು ಸಂಪಾದಿಸು
Comment[ko]=텍스트 파일을 편집합니다
Comment[lt]=Redaguoti tekstines bylas
+1 -1
View File
@@ -61,7 +61,7 @@ popup_options_one(dict_T *dict, char_u *key)
n = strtol((char *)s, (char **)&endp, 10);
if (endp != NULL && *skipwhite(endp) != NUL)
{
semsg(_(e_invexpr2), val);
semsg(_(e_invalid_expression_str), val);
return 0;
}
}
+1
View File
@@ -36,4 +36,5 @@ void f_test_scrollbar(typval_T *argvars, typval_T *rettv);
void f_test_setmouse(typval_T *argvars, typval_T *rettv);
void f_test_gui_mouse_event(typval_T *argvars, typval_T *rettv);
void f_test_settime(typval_T *argvars, typval_T *rettv);
void f_test_gui_drop_files(typval_T *argvars, typval_T *rettv);
/* vim: set ft=c : */
+3 -3
View File
@@ -3830,7 +3830,7 @@ qf_history(exarg_T *eap)
qf_update_buffer(qi, NULL);
}
else
emsg(_(e_invrange));
emsg(_(e_invalid_range));
return;
}
@@ -5655,7 +5655,7 @@ ex_cbelow(exarg_T *eap)
if (eap->addr_count > 0 && eap->line2 <= 0)
{
emsg(_(e_invrange));
emsg(_(e_invalid_range));
return;
}
@@ -7817,7 +7817,7 @@ cbuffer_process_args(
if (eap->line1 < 1 || eap->line1 > buf->b_ml.ml_line_count
|| eap->line2 < 1 || eap->line2 > buf->b_ml.ml_line_count)
{
emsg(_(e_invrange));
emsg(_(e_invalid_range));
return FAIL;
}
+2 -2
View File
@@ -5972,12 +5972,12 @@ mkspell(
// time.
if (!over_write && mch_stat((char *)wfname, &st) >= 0)
{
emsg(_(e_exists));
emsg(_(e_file_exists));
goto theend;
}
if (mch_isdir(wfname))
{
semsg(_(e_isadir2), wfname);
semsg(_(e_src_is_directory), wfname);
goto theend;
}
+1
View File
@@ -769,6 +769,7 @@ typedef struct memline
// Values for the flags argument of ml_delete_flags().
#define ML_DEL_MESSAGE 1 // may give a "No lines in buffer" message
#define ML_DEL_UNDO 2 // called from undo, do not update textprops
#define ML_DEL_NOPROP 4 // splitting data block, do not update textprops
// Values for the flags argument of ml_append_int().
#define ML_APPEND_NEW 1 // starting to edit a new file
+2
View File
@@ -243,6 +243,7 @@ NEW_TESTS = \
test_selectmode \
test_set \
test_sha256 \
test_shell \
test_shift \
test_shortpathname \
test_signals \
@@ -473,6 +474,7 @@ NEW_TESTS_RES = \
test_search.res \
test_search_stat.res \
test_selectmode.res \
test_shell.res \
test_shortpathname.res \
test_signals.res \
test_signs.res \
+42 -2
View File
@@ -932,7 +932,7 @@ func Test_Backtrace_DefFunction()
call delete('Xtest2.vim')
endfunc
func Test_debug_DefFunction()
func Test_debug_def_and_legacy_function()
CheckCWD
let file =<< trim END
vim9script
@@ -947,7 +947,7 @@ func Test_debug_DefFunction()
def LocalFunc()
echo "first"
echo "second"
breakadd func 1 LegacyFunc
breakadd func LegacyFunc
LegacyFunc()
enddef
@@ -1010,6 +1010,13 @@ func Test_debug_def_function()
eval 1
enddef
enddef
def g:FuncComment()
# comment
echo "first"
.. "one"
# comment
echo "second"
enddef
END
call writefile(file, 'Xtest.vim')
@@ -1049,12 +1056,45 @@ func Test_debug_def_function()
\ ['cmd: call FuncWithDict()'])
call RunDbgCmd(buf, 'step', ['line 1: var d = { a: 1, b: 2, }'])
call RunDbgCmd(buf, 'step', ['line 6: def Inner()'])
call RunDbgCmd(buf, 'cont')
call RunDbgCmd(buf, ':breakadd func 1 FuncComment')
call RunDbgCmd(buf, ':call FuncComment()', ['function FuncComment', 'line 2: echo "first" .. "one"'])
call RunDbgCmd(buf, ':breakadd func 3 FuncComment')
call RunDbgCmd(buf, 'cont', ['function FuncComment', 'line 5: echo "second"'])
call RunDbgCmd(buf, 'cont')
call StopVimInTerminal(buf)
call delete('Xtest.vim')
endfunc
func Test_debug_def_function_with_lambda()
CheckCWD
let lines =<< trim END
vim9script
def g:Func()
var s = 'a'
['b']->map((_, v) => s)
echo "done"
enddef
breakadd func 2 g:Func
END
call writefile(lines, 'XtestLambda.vim')
let buf = RunVimInTerminal('-S XtestLambda.vim', {})
call RunDbgCmd(buf,
\ ':call g:Func()',
\ ['function Func', 'line 2: [''b'']->map((_, v) => s)'])
call RunDbgCmd(buf,
\ 'next',
\ ['function Func', 'line 3: echo "done"'])
call RunDbgCmd(buf, 'cont')
call StopVimInTerminal(buf)
call delete('XtestLambda.vim')
endfunc
func Test_debug_backtrace_level()
CheckCWD
let lines =<< trim END
+39 -1
View File
@@ -161,6 +161,8 @@ let s:filename_checks = {
\ 'ecd': ['file.ecd'],
\ 'edif': ['file.edf', 'file.edif', 'file.edo'],
\ 'elinks': ['elinks.conf'],
\ 'elixir': ['file.ex', 'file.exs', 'mix.lock'],
\ 'eelixir': ['file.eex', 'file.leex'],
\ 'elm': ['file.elm'],
\ 'elmfilt': ['filter-rules'],
\ 'epuppet': ['file.epp'],
@@ -257,7 +259,7 @@ let s:filename_checks = {
\ 'jgraph': ['file.jgr'],
\ 'jovial': ['file.jov', 'file.j73', 'file.jovial'],
\ 'jproperties': ['file.properties', 'file.properties_xx', 'file.properties_xx_xx', 'some.properties_xx_xx_file'],
\ 'json': ['file.json', 'file.jsonp', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb'],
\ 'json': ['file.json', 'file.jsonp', 'file.json-patch', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb'],
\ 'jsp': ['file.jsp'],
\ 'kconfig': ['Kconfig', 'Kconfig.debug', 'Kconfig.file'],
\ 'kivy': ['file.kv'],
@@ -790,5 +792,41 @@ func Test_pp_file()
filetype off
endfunc
func Test_ex_file()
filetype on
call writefile(['arbitrary content'], 'Xfile.ex')
split Xfile.ex
call assert_equal('elixir', &filetype)
bwipe!
let g:filetype_euphoria = 'euphoria4'
split Xfile.ex
call assert_equal('euphoria4', &filetype)
bwipe!
unlet g:filetype_euphoria
call writefile(['-- filetype euphoria comment'], 'Xfile.ex')
split Xfile.ex
call assert_equal('euphoria3', &filetype)
bwipe!
call writefile(['--filetype euphoria comment'], 'Xfile.ex')
split Xfile.ex
call assert_equal('euphoria3', &filetype)
bwipe!
call writefile(['ifdef '], 'Xfile.ex')
split Xfile.ex
call assert_equal('euphoria3', &filetype)
bwipe!
call writefile(['include '], 'Xfile.ex')
split Xfile.ex
call assert_equal('euphoria3', &filetype)
bwipe!
call delete('Xfile.ex')
filetype off
endfunc
" vim: shiftwidth=2 sts=2 expandtab
-25
View File
@@ -1579,31 +1579,6 @@ func Test_redo_in_nested_functions()
delfunc Apply
endfunc
func Test_shellescape()
let save_shell = &shell
set shell=bash
call assert_equal("'text'", shellescape('text'))
call assert_equal("'te\"xt'", 'te"xt'->shellescape())
call assert_equal("'te'\\''xt'", shellescape("te'xt"))
call assert_equal("'te%xt'", shellescape("te%xt"))
call assert_equal("'te\\%xt'", shellescape("te%xt", 1))
call assert_equal("'te#xt'", shellescape("te#xt"))
call assert_equal("'te\\#xt'", shellescape("te#xt", 1))
call assert_equal("'te!xt'", shellescape("te!xt"))
call assert_equal("'te\\!xt'", shellescape("te!xt", 1))
call assert_equal("'te\nxt'", shellescape("te\nxt"))
call assert_equal("'te\\\nxt'", shellescape("te\nxt", 1))
set shell=tcsh
call assert_equal("'te\\!xt'", shellescape("te!xt"))
call assert_equal("'te\\\\!xt'", shellescape("te!xt", 1))
call assert_equal("'te\\\nxt'", shellescape("te\nxt"))
call assert_equal("'te\\\\\nxt'", shellescape("te\nxt", 1))
let &shell = save_shell
endfunc
func Test_trim()
call assert_equal("Testing", trim(" \t\r\r\x0BTesting \t\n\r\n\t\x0B\x0B"))
call assert_equal("Testing", " \t \r\r\n\n\x0BTesting \t\n\r\n\t\x0B\x0B"->trim())
+93
View File
@@ -1163,4 +1163,97 @@ func Test_gui_tablabel_tooltip()
let &lines = save_lines
endfunc
" Test for dropping files into a window in GUI
func DropFilesInCmdLine()
CheckFeature drop_file
call feedkeys(":\"", 'L')
call test_gui_drop_files(['a.c', 'b.c'], &lines, 1, 0)
call feedkeys("\<CR>", 'L')
endfunc
func Test_gui_drop_files()
CheckFeature drop_file
call assert_fails('call test_gui_drop_files(1, 1, 1, 0)', 'E474:')
call assert_fails('call test_gui_drop_files(["x"], "", 1, 0)', 'E474:')
call assert_fails('call test_gui_drop_files(["x"], 1, "", 0)', 'E474:')
call assert_fails('call test_gui_drop_files(["x"], 1, 1, "")', 'E474:')
%bw!
%argdelete
call test_gui_drop_files([], 1, 1, 0)
call assert_equal([], argv())
call test_gui_drop_files([1, 2], 1, 1, 0)
call assert_equal([], argv())
call test_gui_drop_files(['a.c', 'b.c'], 1, 1, 0)
call assert_equal(['a.c', 'b.c'], argv())
%bw!
%argdelete
call test_gui_drop_files([], 1, 1, 0)
call assert_equal([], argv())
%bw!
" if the buffer in the window is modified, then the file should be opened in
" a new window
set modified
call test_gui_drop_files(['x.c', 'y.c'], 1, 1, 0)
call assert_equal(['x.c', 'y.c'], argv())
call assert_equal(2, winnr('$'))
call assert_equal('x.c', bufname(winbufnr(1)))
%bw!
%argdelete
" if Ctrl is pressed, then the file should be opened in a new window
call test_gui_drop_files(['s.py', 't.py'], 1, 1, 0x10)
call assert_equal(['s.py', 't.py'], argv())
call assert_equal(2, winnr('$'))
call assert_equal('s.py', bufname(winbufnr(1)))
%bw!
%argdelete
" drop the files in a non-current window
belowright new
call test_gui_drop_files(['a.py', 'b.py'], 1, 1, 0)
call assert_equal(['a.py', 'b.py'], argv())
call assert_equal(2, winnr('$'))
call assert_equal(1, winnr())
call assert_equal('a.py', bufname(winbufnr(1)))
%bw!
%argdelete
" pressing shift when dropping files should change directory
let save_cwd = getcwd()
call mkdir('Xdir1')
call writefile([], 'Xdir1/Xfile1')
call writefile([], 'Xdir1/Xfile2')
call test_gui_drop_files(['Xdir1/Xfile1', 'Xdir1/Xfile2'], 1, 1, 0x4)
call assert_equal('Xdir1', fnamemodify(getcwd(), ':t'))
call assert_equal('Xfile1', @%)
call chdir(save_cwd)
" pressing shift when dropping directory and files should change directory
call test_gui_drop_files(['Xdir1', 'Xdir1/Xfile2'], 1, 1, 0x4)
call assert_equal('Xdir1', fnamemodify(getcwd(), ':t'))
call assert_equal('Xdir1', fnamemodify(@%, ':t'))
call chdir(save_cwd)
%bw!
%argdelete
" dropping a directory should edit it
call test_gui_drop_files(['Xdir1'], 1, 1, 0)
call assert_equal('Xdir1', @%)
%bw!
%argdelete
" dropping only a directory name with Shift should ignore it
call test_gui_drop_files(['Xdir1'], 1, 1, 0x4)
call assert_equal('', @%)
%bw!
%argdelete
call delete('Xdir1', 'rf')
" drop files in the command line. The GUI drop files adds the file names to
" the low level input buffer. So need to use a cmdline map and feedkeys()
" with 'Lx!' to process it in this function itself.
cnoremap <expr> <buffer> <F4> DropFilesInCmdLine()
call feedkeys(":\"\<F4>\<CR>", 'xt')
call feedkeys('k', 'Lx!')
call assert_equal('"a.c b.c', @:)
cunmap <buffer> <F4>
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+1 -1
View File
@@ -293,7 +293,7 @@ func Test_let_errors()
let s = "var"
let var = 1
call assert_fails('let var += [1,2]', 'E734:')
call assert_fails('let {s}.1 = 2', 'E18:')
call assert_fails('let {s}.1 = 2', 'E1203:')
call assert_fails('let a[1] = 5', 'E121:')
let l = [[1,2]]
call assert_fails('let l[:][0] = [5]', 'E708:')
+3
View File
@@ -294,6 +294,9 @@ func Test_dict_assign()
let d.1 = 1
let d._ = 2
call assert_equal({'1': 1, '_': 2}, d)
let n = 0
call assert_fails('let n.key = 3', 'E1203: Dot can only be used on a dictionary: n.key = 3')
endfunc
" Function in script-local List or Dict
-28
View File
@@ -837,34 +837,6 @@ func Test_buftype()
bwipe!
endfunc
" Test for the 'shell' option
func Test_shell()
CheckUnix
let save_shell = &shell
set shell=
let caught_e91 = 0
try
shell
catch /E91:/
let caught_e91 = 1
endtry
call assert_equal(1, caught_e91)
let &shell = save_shell
endfunc
" Test for the 'shellquote' option
func Test_shellquote()
CheckUnix
set shellquote=#
set verbose=20
redir => v
silent! !echo Hello
redir END
set verbose&
set shellquote&
call assert_match(': "#echo Hello#"', v)
endfunc
" Test for the 'rightleftcmd' option
func Test_rightleftcmd()
CheckFeature rightleft
+196
View File
@@ -0,0 +1,196 @@
" Test for the shell related options ('shell', 'shellcmdflag', 'shellpipe',
" 'shellquote', 'shellredir', 'shellxescape', and 'shellxquote')
source check.vim
source shared.vim
func Test_shell_options()
" The expected value of 'shellcmdflag', 'shellpipe', 'shellquote',
" 'shellredir', 'shellxescape', 'shellxquote' for the supported shells.
let shells = []
if has('unix')
let shells += [['sh', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
\ ['ksh', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
\ ['mksh', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
\ ['zsh', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
\ ['zsh-beta', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
\ ['bash', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
\ ['fish', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
\ ['ash', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
\ ['dash', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
\ ['csh', '-c', '|& tee', '', '>&', '', ''],
\ ['tcsh', '-c', '|& tee', '', '>&', '', '']]
endif
if has('win32')
let shells += [['cmd', '/c', '>%s 2>&1', '', '>%s 2>&1', '"&|<>()@^', ''],
\ ['cmd.exe', '/c', '>%s 2>&1', '', '>%s 2>&1', '"&|<>()@^', '('],
\ ['powershell.exe', '-c', '>', '', '>', '"&|<>()@^', '"'],
\ ['powershell', '-c', '>', '', '>', '"&|<>()@^', '"'],
\ ['sh.exe', '-c', '>%s 2>&1', '', '>%s 2>&1', '"&|<>()@^', '"'],
\ ['ksh.exe', '-c', '>%s 2>&1', '', '>%s 2>&1', '"&|<>()@^', '"'],
\ ['mksh.exe', '-c', '>%s 2>&1', '', '>%s 2>&1', '"&|<>()@^', '"'],
\ ['pdksh.exe', '-c', '>%s 2>&1', '', '>%s 2>&1', '"&|<>()@^', '"'],
\ ['zsh.exe', '-c', '>%s 2>&1', '', '>%s 2>&1', '"&|<>()@^', '"'],
\ ['zsh-beta.exe', '-c', '>%s 2>&1', '', '>%s 2>&1', '"&|<>()@^', '"'],
\ ['bash.exe', '-c', '>%s 2>&1', '', '>%s 2>&1', '"&|<>()@^', '"'],
\ ['dash.exe', '-c', '>%s 2>&1', '', '>%s 2>&1', '"&|<>()@^', '"'],
\ ['csh.exe', '-c', '>&', '', '>&', '"&|<>()@^', '"'],
\ ['tcsh.exe', '-c', '>&', '', '>&', '"&|<>()@^', '"']]
endif
" start a new Vim instance with 'shell' set to each of the supported shells
" and check the default shell option settings
let after =<< trim END
let l = [&shell, &shellcmdflag, &shellpipe, &shellquote]
let l += [&shellredir, &shellxescape, &shellxquote]
call writefile([json_encode(l)], 'Xtestout')
qall!
END
for e in shells
if RunVim([], after, '--cmd "set shell=' .. e[0] .. '"')
call assert_equal(e, json_decode(readfile('Xtestout')[0]))
endif
endfor
" Test shellescape() for each of the shells.
for e in shells
exe 'set shell=' .. e[0]
if e[0] =~# '.*csh$' || e[0] =~# '.*csh.exe$'
let str1 = "'cmd \"arg1\" '\\''arg2'\\'' \\!%#'"
let str2 = "'cmd \"arg1\" '\\''arg2'\\'' \\\\!\\%\\#'"
else
let str1 = "'cmd \"arg1\" '\\''arg2'\\'' !%#'"
let str2 = "'cmd \"arg1\" '\\''arg2'\\'' \\!\\%\\#'"
endif
call assert_equal(str1, shellescape("cmd \"arg1\" 'arg2' !%#"), e[0])
call assert_equal(str2, shellescape("cmd \"arg1\" 'arg2' !%#", 1), e[0])
" Try running an external command with the shell.
if executable(e[0])
" set the shell options for the current 'shell'
let [&shellcmdflag, &shellpipe, &shellquote, &shellredir,
\ &shellxescape, &shellxquote] = e[1:6]
new
r !echo hello
call assert_equal('hello', substitute(getline(2), '\W', '', 'g'), e[0])
bwipe!
endif
endfor
set shell& shellcmdflag& shellpipe& shellquote&
set shellredir& shellxescape& shellxquote&
call delete('Xtestout')
endfunc
" Test for the 'shell' option
func Test_shell()
CheckUnix
let save_shell = &shell
set shell=
let caught_e91 = 0
try
shell
catch /E91:/
let caught_e91 = 1
endtry
call assert_equal(1, caught_e91)
let &shell = save_shell
endfunc
" Test for the 'shellquote' option
func Test_shellquote()
CheckUnix
set shellquote=#
set verbose=20
redir => v
silent! !echo Hello
redir END
set verbose&
set shellquote&
call assert_match(': "#echo Hello#"', v)
endfunc
" Test for the 'shellescape' option
func Test_shellescape()
let save_shell = &shell
set shell=bash
call assert_equal("'text'", shellescape('text'))
call assert_equal("'te\"xt'", 'te"xt'->shellescape())
call assert_equal("'te'\\''xt'", shellescape("te'xt"))
call assert_equal("'te%xt'", shellescape("te%xt"))
call assert_equal("'te\\%xt'", shellescape("te%xt", 1))
call assert_equal("'te#xt'", shellescape("te#xt"))
call assert_equal("'te\\#xt'", shellescape("te#xt", 1))
call assert_equal("'te!xt'", shellescape("te!xt"))
call assert_equal("'te\\!xt'", shellescape("te!xt", 1))
call assert_equal("'te\nxt'", shellescape("te\nxt"))
call assert_equal("'te\\\nxt'", shellescape("te\nxt", 1))
set shell=tcsh
call assert_equal("'te\\!xt'", shellescape("te!xt"))
call assert_equal("'te\\\\!xt'", shellescape("te!xt", 1))
call assert_equal("'te\\\nxt'", shellescape("te\nxt"))
call assert_equal("'te\\\\\nxt'", shellescape("te\nxt", 1))
let &shell = save_shell
endfunc
" Test for 'shellxquote'
func Test_shellxquote()
CheckUnix
let save_shell = &shell
let save_sxq = &shellxquote
let save_sxe = &shellxescape
call writefile(['#!/bin/sh', 'echo "Cmd: [$*]" > Xlog'], 'Xtestshell')
call setfperm('Xtestshell', "r-x------")
set shell=./Xtestshell
set shellxquote=\\"
call feedkeys(":!pwd\<CR>\<CR>", 'xt')
call assert_equal(['Cmd: [-c "pwd"]'], readfile('Xlog'))
set shellxquote=(
call feedkeys(":!pwd\<CR>\<CR>", 'xt')
call assert_equal(['Cmd: [-c (pwd)]'], readfile('Xlog'))
set shellxquote=\\"(
call feedkeys(":!pwd\<CR>\<CR>", 'xt')
call assert_equal(['Cmd: [-c "(pwd)"]'], readfile('Xlog'))
set shellxescape=\"&<<()@^
set shellxquote=(
call feedkeys(":!pwd\"&<<{}@^\<CR>\<CR>", 'xt')
call assert_equal(['Cmd: [-c (pwd^"^&^<^<{}^@^^)]'], readfile('Xlog'))
let &shell = save_shell
let &shellxquote = save_sxq
let &shellxescape = save_sxe
call delete('Xtestshell')
call delete('Xlog')
endfunc
" Test for using the shell set in the $SHELL environment variable
func Test_set_shell()
let after =<< trim [CODE]
call writefile([&shell], "Xtestout")
quit!
[CODE]
if has('win32')
let $SHELL = 'C:\with space\cmd.exe'
let expected = '"C:\with space\cmd.exe"'
else
let $SHELL = '/bin/with space/sh'
let expected = '/bin/with\ space/sh'
endif
if RunVimPiped([], after, '', '')
let lines = readfile('Xtestout')
call assert_equal(expected, lines[0])
endif
call delete('Xtestout')
endfunc
" vim: shiftwidth=2 sts=2 expandtab
-21
View File
@@ -733,27 +733,6 @@ func Test_read_stdin()
call delete('Xtestout')
endfunc
func Test_set_shell()
let after =<< trim [CODE]
call writefile([&shell], "Xtestout")
quit!
[CODE]
if has('win32')
let $SHELL = 'C:\with space\cmd.exe'
let expected = '"C:\with space\cmd.exe"'
else
let $SHELL = '/bin/with space/sh'
let expected = '/bin/with\ space/sh'
endif
if RunVimPiped([], after, '', '')
let lines = readfile('Xtestout')
call assert_equal(expected, lines[0])
endif
call delete('Xtestout')
endfunc
func Test_progpath()
" Tests normally run with "./vim" or "../vim", these must have been expanded
" to a full path.
+2 -2
View File
@@ -201,8 +201,8 @@ func Test_swapfile_delete()
" This test won't work as root because root can successfully run kill(1, 0)
if !IsRoot()
" Write the swapfile with a modified PID, now it will be automatically
" deleted. Process one should never be Vim.
let swapfile_bytes[24:27] = 0z01000000
" deleted. Process 0x3fffffff most likely does not exist.
let swapfile_bytes[24:27] = 0zffffff3f
call writefile(swapfile_bytes, swapfile_name)
let s:swapname = ''
split XswapfileText
-36
View File
@@ -144,40 +144,4 @@ func Test_system_with_shell_quote()
endtry
endfunc
" Test for 'shellxquote'
func Test_Shellxquote()
CheckUnix
let save_shell = &shell
let save_sxq = &shellxquote
let save_sxe = &shellxescape
call writefile(['#!/bin/sh', 'echo "Cmd: [$*]" > Xlog'], 'Xtestshell')
call setfperm('Xtestshell', "r-x------")
set shell=./Xtestshell
set shellxquote=\\"
call feedkeys(":!pwd\<CR>\<CR>", 'xt')
call assert_equal(['Cmd: [-c "pwd"]'], readfile('Xlog'))
set shellxquote=(
call feedkeys(":!pwd\<CR>\<CR>", 'xt')
call assert_equal(['Cmd: [-c (pwd)]'], readfile('Xlog'))
set shellxquote=\\"(
call feedkeys(":!pwd\<CR>\<CR>", 'xt')
call assert_equal(['Cmd: [-c "(pwd)"]'], readfile('Xlog'))
set shellxescape=\"&<<()@^
set shellxquote=(
call feedkeys(":!pwd\"&<<{}@^\<CR>\<CR>", 'xt')
call assert_equal(['Cmd: [-c (pwd^"^&^<^<{}^@^^)]'], readfile('Xlog'))
let &shell = save_shell
let &shellxquote = save_sxq
let &shellxescape = save_sxe
call delete('Xtestshell')
call delete('Xlog')
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+22
View File
@@ -1488,5 +1488,27 @@ def Test_prop_splits_data_block()
prop_type_delete('someprop')
enddef
" This was calling ml_delete_int() and try to change text properties.
def Test_prop_add_delete_line()
new
var a = 10
var b = 20
repeat([''], a)->append('$')
prop_type_add('Test', {highlight: 'ErrorMsg'})
for lnum in range(1, a)
for col in range(1, b)
prop_add(1, 1, {end_lnum: lnum, end_col: col, type: 'Test'})
endfor
endfor
# check deleting lines is OK
:5del
:1del
:$del
prop_type_delete('Test')
bwipe!
enddef
" vim: shiftwidth=2 sts=2 expandtab
+63 -23
View File
@@ -228,16 +228,6 @@ def Test_assignment()
CheckDefFailure(['$SOME_ENV_VAR += "more"'], 'E1051:')
CheckDefFailure(['$SOME_ENV_VAR += 123'], 'E1012:')
lines =<< trim END
@c = 'areg'
@c ..= 'add'
assert_equal('aregadd', @c)
END
CheckDefAndScriptSuccess(lines)
CheckDefFailure(['@a += "more"'], 'E1051:')
CheckDefFailure(['@a += 123'], 'E1012:')
v:errmsg = 'none'
v:errmsg ..= 'again'
assert_equal('noneagain', v:errmsg)
@@ -249,6 +239,21 @@ def Test_assignment()
END
enddef
def Test_assign_register()
var lines =<< trim END
@c = 'areg'
@c ..= 'add'
assert_equal('aregadd', @c)
@@ = 'some text'
assert_equal('some text', getreg('"'))
END
CheckDefAndScriptSuccess(lines)
CheckDefFailure(['@a += "more"'], 'E1051:')
CheckDefFailure(['@a += 123'], 'E1012:')
enddef
def Test_reserved_name()
for name in ['true', 'false', 'null']
CheckDefExecAndScriptFailure(['var ' .. name .. ' = 0'], 'E1034:')
@@ -284,6 +289,16 @@ def Test_assign_unpack()
assert_equal(1, v1)
assert_equal(2, v2)
var reslist = []
for text in ['aaa {bbb} ccc', 'ddd {eee} fff']
var before: string
var middle: string
var after: string
[_, before, middle, after; _] = text->matchlist('\(.\{-\}\){\(.\{-\}\)}\(.*\)')
reslist->add(before)->add(middle)->add(after)
endfor
assert_equal(['aaa ', 'bbb', ' ccc', 'ddd ', 'eee', ' fff'], reslist)
var a = 1
var b = 3
[a, b] += [2, 4]
@@ -772,6 +787,12 @@ def Test_assignment_dict()
d.dd[0] = 0
END
CheckDefExecFailure(lines, 'E1148:', 2)
lines =<< trim END
var n: any
n.key = 5
END
CheckDefExecAndScriptFailure2(lines, 'E1148:', 'E1203: Dot can only be used on a dictionary: n.key = 5', 2)
enddef
def Test_assignment_local()
@@ -1081,21 +1102,30 @@ def Test_assignment_failure()
enddef
def Test_assign_list()
var l: list<string> = []
l[0] = 'value'
assert_equal('value', l[0])
var lines =<< trim END
var l: list<string> = []
l[0] = 'value'
assert_equal('value', l[0])
l[1] = 'asdf'
assert_equal('value', l[0])
assert_equal('asdf', l[1])
assert_equal('asdf', l[-1])
assert_equal('value', l[-2])
l[1] = 'asdf'
assert_equal('value', l[0])
assert_equal('asdf', l[1])
assert_equal('asdf', l[-1])
assert_equal('value', l[-2])
var nrl: list<number> = []
for i in range(5)
nrl[i] = i
endfor
assert_equal([0, 1, 2, 3, 4], nrl)
var nrl: list<number> = []
for i in range(5)
nrl[i] = i
endfor
assert_equal([0, 1, 2, 3, 4], nrl)
var ul: list<any>
ul[0] = 1
ul[1] = 2
ul[2] = 3
assert_equal([1, 2, 3], ul)
END
CheckDefAndScriptSuccess(lines)
CheckDefFailure(["var l: list<number> = ['', true]"], 'E1012: Type mismatch; expected list<number> but got list<any>', 1)
CheckDefFailure(["var l: list<list<number>> = [['', true]]"], 'E1012: Type mismatch; expected list<list<number>> but got list<list<any>>', 1)
@@ -1889,6 +1919,10 @@ def Test_inc_dec()
assert_equal(8, nr)
--nr
assert_equal(7, nr)
++nr | ++nr
assert_equal(9, nr)
++nr # comment
assert_equal(10, nr)
var ll = [1, 2]
--ll[0]
@@ -1902,6 +1936,12 @@ def Test_inc_dec()
unlet g:count
END
CheckDefAndScriptSuccess(lines)
lines =<< trim END
var nr = 7
++ nr
END
CheckDefAndScriptFailure(lines, "E1202: No white space allowed after '++': ++ nr")
enddef
+12 -6
View File
@@ -2176,7 +2176,9 @@ def Test_silent_return()
enddef
def s:Profiled(): string
# comment
echo "profiled"
# comment
var some = "some text"
return "done"
enddef
@@ -2187,18 +2189,20 @@ def Test_profiled()
endif
var res = execute('disass profile s:Profiled')
assert_match('<SNR>\d*_Profiled\_s*' ..
'# comment\_s*' ..
'echo "profiled"\_s*' ..
'\d PROFILE START line 1\_s*' ..
'\d PROFILE START line 2\_s*' ..
'\d PUSHS "profiled"\_s*' ..
'\d ECHO 1\_s*' ..
'# comment\_s*' ..
'var some = "some text"\_s*' ..
'\d PROFILE END\_s*' ..
'\d PROFILE START line 2\_s*' ..
'\d PROFILE START line 4\_s*' ..
'\d PUSHS "some text"\_s*' ..
'\d STORE $0\_s*' ..
'return "done"\_s*' ..
'\d PROFILE END\_s*' ..
'\d PROFILE START line 3\_s*' ..
'\d PROFILE START line 5\_s*' ..
'\d PUSHS "done"\_s*' ..
'\d\+ RETURN\_s*' ..
'\d\+ PROFILE END',
@@ -2208,16 +2212,18 @@ enddef
def Test_debugged()
var res = execute('disass debug s:Profiled')
assert_match('<SNR>\d*_Profiled\_s*' ..
'# comment\_s*' ..
'echo "profiled"\_s*' ..
'\d DEBUG line 1 varcount 0\_s*' ..
'\d DEBUG line 1-2 varcount 0\_s*' ..
'\d PUSHS "profiled"\_s*' ..
'\d ECHO 1\_s*' ..
'# comment\_s*' ..
'var some = "some text"\_s*' ..
'\d DEBUG line 2 varcount 0\_s*' ..
'\d DEBUG line 3-4 varcount 0\_s*' ..
'\d PUSHS "some text"\_s*' ..
'\d STORE $0\_s*' ..
'return "done"\_s*' ..
'\d DEBUG line 3 varcount 1\_s*' ..
'\d DEBUG line 5-5 varcount 1\_s*' ..
'\d PUSHS "done"\_s*' ..
'\d RETURN\_s*',
res)
+33
View File
@@ -917,6 +917,22 @@ def Test_call_lambda_args()
CheckDefFailure(lines, 'E1167:')
CheckScriptFailure(['vim9script'] + lines, 'E1168:')
lines =<< trim END
var Ref: func(any, ?any): bool
Ref = (_, y = 1) => false
END
CheckDefAndScriptFailure(lines, 'E1172:')
lines =<< trim END
var a = 0
var b = (a == 0 ? 1 : 2)
assert_equal(1, b)
var txt = 'a'
b = (txt =~ 'x' ? 1 : 2)
assert_equal(2, b)
END
CheckDefAndScriptSuccess(lines)
lines =<< trim END
def ShadowLocal()
var one = 1
@@ -2316,6 +2332,23 @@ def Test_legacy_lambda()
CheckScriptSuccess(lines)
enddef
def Test_legacy()
var lines =<< trim END
vim9script
func g:LegacyFunction()
let g:legacyvar = 1
endfunc
def Testit()
legacy call g:LegacyFunction()
enddef
Testit()
assert_equal(1, g:legacyvar)
unlet g:legacyvar
delfunc g:LegacyFunction
END
CheckScriptSuccess(lines)
enddef
def Test_legacy_errors()
for cmd in ['if', 'elseif', 'else', 'endif',
'for', 'endfor', 'continue', 'break',
+28
View File
@@ -1519,6 +1519,27 @@ def Test_vim9script_reload_noclear()
delete('XExportReload')
delfunc g:Values
unlet g:loadCount
lines =<< trim END
vim9script
def Inner()
enddef
END
lines->writefile('XreloadScript.vim')
source XreloadScript.vim
lines =<< trim END
vim9script
def Outer()
def Inner()
enddef
enddef
defcompile
END
lines->writefile('XreloadScript.vim')
source XreloadScript.vim
delete('XreloadScript.vim')
enddef
def Test_vim9script_reload_import()
@@ -2385,6 +2406,13 @@ def Test_for_loop()
endfor
assert_equal('1a2b', res)
# unpack with one var
var reslist = []
for [x] in [['aaa'], ['bbb']]
reslist->add(x)
endfor
assert_equal(['aaa', 'bbb'], reslist)
# loop over string
res = ''
for c in 'aéc̀d'
+1 -1
View File
@@ -107,7 +107,7 @@ def CheckDefAndScriptFailure(lines: list<string>, error: string, lnum = -3)
CheckScriptFailure(['vim9script'] + lines, error, lnum + 1)
enddef
" As CheckDefAndScriptFailure() but with two different exepcted errors.
" As CheckDefAndScriptFailure() but with two different exepected errors.
def CheckDefAndScriptFailure2(
lines: list<string>,
errorDef: string,
+58 -2
View File
@@ -1224,7 +1224,7 @@ f_test_setmouse(typval_T *argvars, typval_T *rettv UNUSED)
void
f_test_gui_mouse_event(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_GUI
# ifdef FEAT_GUI
int button;
int row;
int col;
@@ -1248,7 +1248,7 @@ f_test_gui_mouse_event(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
mods = tv_get_number(&argvars[4]);
gui_send_mouse_event(button, TEXT_X(col - 1), TEXT_Y(row - 1), repeated_click, mods);
#endif
# endif
}
void
@@ -1257,5 +1257,61 @@ f_test_settime(typval_T *argvars, typval_T *rettv UNUSED)
time_for_testing = (time_t)tv_get_number(&argvars[0]);
}
void
f_test_gui_drop_files(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#if defined(HAVE_DROP_FILE)
int row;
int col;
int_u mods;
char_u **fnames;
int count = 0;
list_T *l;
listitem_T *li;
if (argvars[0].v_type != VAR_LIST
|| (argvars[1].v_type) != VAR_NUMBER
|| (argvars[2].v_type) != VAR_NUMBER
|| (argvars[3].v_type) != VAR_NUMBER)
{
emsg(_(e_invarg));
return;
}
row = tv_get_number(&argvars[1]);
col = tv_get_number(&argvars[2]);
mods = tv_get_number(&argvars[3]);
l = argvars[0].vval.v_list;
if (list_len(l) == 0)
return;
fnames = ALLOC_MULT(char_u *, list_len(l));
if (fnames == NULL)
return;
FOR_ALL_LIST_ITEMS(l, li)
{
// ignore non-string items
if (li->li_tv.v_type != VAR_STRING)
continue;
fnames[count] = vim_strsave(li->li_tv.vval.v_string);
if (fnames[count] == NULL)
{
while (--count >= 0)
vim_free(fnames[count]);
vim_free(fnames);
return;
}
count++;
}
if (count > 0)
gui_handle_drop(TEXT_X(col - 1), TEXT_Y(row - 1), mods, fnames, count);
else
vim_free(fnames);
# endif
}
#endif // defined(FEAT_EVAL)
+4 -4
View File
@@ -549,7 +549,7 @@ f_prop_clear(typval_T *argvars, typval_T *rettv UNUSED)
}
if (start < 1 || end < 1)
{
emsg(_(e_invrange));
emsg(_(e_invalid_range));
return;
}
@@ -646,7 +646,7 @@ f_prop_find(typval_T *argvars, typval_T *rettv)
if (lnum < 1 || lnum > buf->b_ml.ml_line_count)
{
emsg(_(e_invrange));
emsg(_(e_invalid_range));
return;
}
@@ -779,7 +779,7 @@ f_prop_list(typval_T *argvars, typval_T *rettv)
}
if (lnum < 1 || lnum > buf->b_ml.ml_line_count)
{
emsg(_(e_invrange));
emsg(_(e_invalid_range));
return;
}
@@ -839,7 +839,7 @@ f_prop_remove(typval_T *argvars, typval_T *rettv)
end = tv_get_number(&argvars[2]);
if (start < 1 || end < 1)
{
emsg(_(e_invrange));
emsg(_(e_invalid_range));
return;
}
}
+1 -1
View File
@@ -1328,7 +1328,7 @@ eval_number(
: STR2NR_ALL, &n, NULL, 0, TRUE);
if (len == 0)
{
semsg(_(e_invexpr2), *arg);
semsg(_(e_invalid_expression_str), *arg);
return FAIL;
}
*arg += len;
+1 -1
View File
@@ -316,7 +316,7 @@ undo_allowed(void)
// Don't allow changes when 'modifiable' is off.
if (!curbuf->b_p_ma)
{
emsg(_(e_modifiable));
emsg(_(e_cannot_make_changes_modifiable_is_off));
return FALSE;
}
+30 -21
View File
@@ -198,7 +198,7 @@ get_function_args(
ga_init2(newargs, (int)sizeof(char_u *), 3);
if (argtypes != NULL)
ga_init2(argtypes, (int)sizeof(char_u *), 3);
if (default_args != NULL)
if (!skip && default_args != NULL)
ga_init2(default_args, (int)sizeof(char_u *), 3);
if (varargs != NULL)
@@ -266,13 +266,19 @@ get_function_args(
}
else
{
char_u *np;
arg = p;
p = one_function_arg(p, newargs, argtypes, types_optional,
evalarg, FALSE, skip);
if (p == arg)
break;
if (*skipwhite(p) == '=' && default_args != NULL)
// Recognize " = expr" but not " == expr". A lambda can have
// "(a = expr" but "(a == expr" and "(a =~ expr" are not a lambda.
np = skipwhite(p);
if (*np == '=' && np[1] != '=' && np[1] != '~'
&& default_args != NULL)
{
typval_T rettv;
@@ -284,24 +290,27 @@ get_function_args(
expr = p;
if (eval1(&p, &rettv, NULL) != FAIL)
{
if (ga_grow(default_args, 1) == FAIL)
goto err_ret;
// trim trailing whitespace
while (p > expr && VIM_ISWHITE(p[-1]))
p--;
c = *p;
*p = NUL;
expr = vim_strsave(expr);
if (expr == NULL)
if (!skip)
{
*p = c;
goto err_ret;
}
((char_u **)(default_args->ga_data))
if (ga_grow(default_args, 1) == FAIL)
goto err_ret;
// trim trailing whitespace
while (p > expr && VIM_ISWHITE(p[-1]))
p--;
c = *p;
*p = NUL;
expr = vim_strsave(expr);
if (expr == NULL)
{
*p = c;
goto err_ret;
}
((char_u **)(default_args->ga_data))
[default_args->ga_len] = expr;
default_args->ga_len++;
*p = c;
default_args->ga_len++;
*p = c;
}
}
else
mustend = TRUE;
@@ -352,7 +361,7 @@ get_function_args(
err_ret:
if (newargs != NULL)
ga_clear_strings(newargs);
if (default_args != NULL)
if (!skip && default_args != NULL)
ga_clear_strings(default_args);
return FAIL;
}
@@ -1222,7 +1231,7 @@ get_lambda_tv(
s = *arg + 1;
ret = get_function_args(&s, equal_arrow ? ')' : '-', NULL,
types_optional ? &argtypes : NULL, types_optional, evalarg,
NULL, NULL, TRUE, NULL, NULL);
NULL, &default_args, TRUE, NULL, NULL);
if (ret == FAIL || skip_arrow(s, equal_arrow, &ret_type, NULL) == NULL)
{
if (types_optional)
@@ -4855,7 +4864,7 @@ ex_call(exarg_T *eap)
{
// If the function deleted lines or switched to another buffer
// the line number may become invalid.
emsg(_(e_invrange));
emsg(_(e_invalid_range));
break;
}
curwin->w_cursor.lnum = lnum;
+68
View File
@@ -770,6 +770,74 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3070,
/**/
3069,
/**/
3068,
/**/
3067,
/**/
3066,
/**/
3065,
/**/
3064,
/**/
3063,
/**/
3062,
/**/
3061,
/**/
3060,
/**/
3059,
/**/
3058,
/**/
3057,
/**/
3056,
/**/
3055,
/**/
3054,
/**/
3053,
/**/
3052,
/**/
3051,
/**/
3050,
/**/
3049,
/**/
3048,
/**/
3047,
/**/
3046,
/**/
3045,
/**/
3044,
/**/
3043,
/**/
3042,
/**/
3041,
/**/
3040,
/**/
3039,
/**/
3038,
/**/
3037,
/**/
3036,
/**/
+9 -3
View File
@@ -168,8 +168,7 @@ typedef enum {
ISN_PROF_START, // start a line for profiling
ISN_PROF_END, // end a line for profiling
ISN_DEBUG, // check for debug breakpoint, isn_arg.number is current
// number of local variables
ISN_DEBUG, // check for debug breakpoint, uses isn_arg.debug
ISN_UNPACK, // unpack list into items, uses isn_arg.unpack
ISN_SHUFFLE, // move item on stack up or down
@@ -391,6 +390,12 @@ typedef struct {
int invert;
} tobool_T;
// arguments to ISN_DEBUG
typedef struct {
varnumber_T dbg_var_names_len; // current number of local variables
int dbg_break_lnum; // first line to break after
} debug_T;
/*
* Instruction
*/
@@ -439,6 +444,7 @@ struct isn_S {
tostring_T tostring;
tobool_T tobool;
getitem_T getitem;
debug_T debug;
} isn_arg;
};
@@ -512,7 +518,7 @@ extern garray_T def_functions;
: (dfunc)->df_instr))
#else
# define INSTRUCTIONS(dfunc) \
(debug_break_level > 0 \
(debug_break_level > 0 || dfunc->df_ufunc->uf_has_breakpoint \
? (dfunc)->df_instr_debug \
: (dfunc)->df_instr)
#endif
+55 -32
View File
@@ -174,6 +174,9 @@ struct cctx_S {
char_u *ctx_line_start; // start of current line or NULL
garray_T ctx_instr; // generated instructions
int ctx_prev_lnum; // line number below previous command, for
// debugging
compiletype_T ctx_compile_type;
garray_T ctx_locals; // currently visible local variables
@@ -495,8 +498,9 @@ check_defined(char_u *p, size_t len, cctx_T *cctx, int is_arg)
|| (ufunc = find_func_even_dead(p, FALSE, cctx)) != NULL)
{
// A local or script-local function can shadow a global function.
if (ufunc == NULL || !func_is_global(ufunc)
|| (p[0] == 'g' && p[1] == ':'))
if (ufunc == NULL || ((ufunc->uf_flags & FC_DEAD) == 0
&& (!func_is_global(ufunc)
|| (p[0] == 'g' && p[1] == ':'))))
{
if (is_arg)
semsg(_(e_argument_name_shadows_existing_variable_str), p);
@@ -585,7 +589,8 @@ generate_instr_debug(cctx_T *cctx)
if ((isn = generate_instr(cctx, ISN_DEBUG)) == NULL)
return NULL;
isn->isn_arg.number = dfunc->df_var_names.ga_len;
isn->isn_arg.debug.dbg_var_names_len = dfunc->df_var_names.ga_len;
isn->isn_arg.debug.dbg_break_lnum = cctx->ctx_prev_lnum;
return isn;
}
@@ -3617,7 +3622,7 @@ compile_lambda(char_u **arg, cctx_T *cctx)
// compile_return().
if (ufunc->uf_ret_type->tt_type == VAR_VOID)
ufunc->uf_ret_type = &t_unknown;
compile_def_function(ufunc, FALSE, COMPILE_TYPE(ufunc), cctx);
compile_def_function(ufunc, FALSE, cctx->ctx_compile_type, cctx);
// evalarg.eval_tofree_cmdline may have a copy of the last line and "*arg"
// points into it. Point to the original line to avoid a dangling pointer.
@@ -4986,7 +4991,7 @@ compile_expr4(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
}
if (type_is && (p[len] == '?' || p[len] == '#'))
{
semsg(_(e_invexpr2), *arg);
semsg(_(e_invalid_expression_str), *arg);
return FAIL;
}
// extra question mark appended: ignore case
@@ -5816,7 +5821,7 @@ get_var_dest(
if (p == NULL)
{
// cannot happen?
emsg(_(e_letunexp));
emsg(_(e_unexpected_characters_in_assignment));
return FAIL;
}
cc = *p;
@@ -5850,7 +5855,8 @@ get_var_dest(
}
else if (*name == '@')
{
if (!valid_yank_reg(name[1], FALSE) || name[1] == '.')
if (name[1] != '@'
&& (!valid_yank_reg(name[1], FALSE) || name[1] == '.'))
{
emsg_invreg(name[1]);
return FAIL;
@@ -6593,6 +6599,7 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
int var_count = 0;
int var_idx;
int semicolon = 0;
int did_generate_slice = FALSE;
garray_T *instr = &cctx->ctx_instr;
garray_T *stack = &cctx->ctx_type_stack;
char_u *op;
@@ -6635,6 +6642,12 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
}
if (eap->cmdidx == CMD_increment || eap->cmdidx == CMD_decrement)
{
if (VIM_ISWHITE(eap->cmd[2]))
{
semsg(_(e_no_white_space_allowed_after_str_str),
eap->cmdidx == CMD_increment ? "++" : "--", eap->cmd);
return NULL;
}
op = (char_u *)(eap->cmdidx == CMD_increment ? "+=" : "-=");
oplen = 2;
incdec = TRUE;
@@ -6790,6 +6803,7 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
else if (semicolon && var_idx == var_count - 1)
{
// For "[var; var] = expr" get the rest of the list
did_generate_slice = TRUE;
if (generate_SLICE(cctx, var_count - 1) == FAIL)
goto theend;
}
@@ -6999,8 +7013,9 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
var_start = skipwhite(lhs.lhs_dest_end + 1);
}
// for "[var, var] = expr" drop the "expr" value
if (var_count > 0 && !semicolon)
// For "[var, var] = expr" drop the "expr" value.
// Also for "[var, var; _] = expr".
if (var_count > 0 && (!semicolon || !did_generate_slice))
{
if (generate_instr_drop(cctx, ISN_DROP, 1) == NULL)
goto theend;
@@ -7721,6 +7736,7 @@ compile_for(char_u *arg_start, cctx_T *cctx)
char_u *p;
char_u *wp;
int var_count = 0;
int var_list = FALSE;
int semicolon = FALSE;
size_t varlen;
garray_T *stack = &cctx->ctx_type_stack;
@@ -7737,6 +7753,8 @@ compile_for(char_u *arg_start, cctx_T *cctx)
return NULL;
if (var_count == 0)
var_count = 1;
else
var_list = TRUE; // can also be a list of one variable
// consume "in"
wp = p;
@@ -7801,7 +7819,7 @@ compile_for(char_u *arg_start, cctx_T *cctx)
else if (vartype->tt_type == VAR_LIST
&& vartype->tt_member->tt_type != VAR_ANY)
{
if (var_count == 1)
if (!var_list)
item_type = vartype->tt_member;
else if (vartype->tt_member->tt_type == VAR_LIST
&& vartype->tt_member->tt_member->tt_type != VAR_ANY)
@@ -7818,7 +7836,7 @@ compile_for(char_u *arg_start, cctx_T *cctx)
generate_FOR(cctx, loop_lvar->lv_idx);
arg = arg_start;
if (var_count > 1)
if (var_list)
{
generate_UNPACK(cctx, var_count, semicolon);
arg = skipwhite(arg + 1); // skip white after '['
@@ -7889,12 +7907,12 @@ compile_for(char_u *arg_start, cctx_T *cctx)
}
// Reserve a variable to store "var".
where.wt_index = var_count > 1 ? idx + 1 : 0;
where.wt_index = var_list ? idx + 1 : 0;
where.wt_variable = TRUE;
if (lhs_type == &t_any)
lhs_type = item_type;
else if (item_type != &t_unknown
&& !(var_count > 1 && item_type == &t_any)
&& !(var_list && item_type == &t_any)
&& check_type(lhs_type, item_type, TRUE, where) == FAIL)
goto failed;
var_lvar = reserve_local(cctx, arg, varlen, TRUE, lhs_type);
@@ -9270,6 +9288,7 @@ compile_def_function(
debug_lnum = cctx.ctx_lnum;
generate_instr_debug(&cctx);
}
cctx.ctx_prev_lnum = cctx.ctx_lnum + 1;
// Some things can be recognized by the first character.
switch (*ea.cmd)
@@ -9332,27 +9351,30 @@ compile_def_function(
break;
}
// Skip ":call" to get to the function name.
// Skip ":call" to get to the function name, unless using :legacy
p = ea.cmd;
if (checkforcmd(&ea.cmd, "call", 3))
if (!(local_cmdmod.cmod_flags & CMOD_LEGACY))
{
if (*ea.cmd == '(')
// not for "call()"
ea.cmd = p;
else
ea.cmd = skipwhite(ea.cmd);
}
if (checkforcmd(&ea.cmd, "call", 3))
{
if (*ea.cmd == '(')
// not for "call()"
ea.cmd = p;
else
ea.cmd = skipwhite(ea.cmd);
}
if (!starts_with_colon)
{
int assign;
if (!starts_with_colon)
{
int assign;
// Check for assignment after command modifiers.
assign = may_compile_assignment(&ea, &line, &cctx);
if (assign == OK)
goto nextline;
if (assign == FAIL)
goto erret;
// Check for assignment after command modifiers.
assign = may_compile_assignment(&ea, &line, &cctx);
if (assign == OK)
goto nextline;
if (assign == FAIL)
goto erret;
}
}
/*
@@ -9361,8 +9383,9 @@ compile_def_function(
* "++nr" and "--nr" are eval commands
*/
cmd = ea.cmd;
if (starts_with_colon || !(*cmd == '\''
|| (cmd[0] == cmd[1] && (*cmd == '+' || *cmd == '-'))))
if (!(local_cmdmod.cmod_flags & CMOD_LEGACY)
&& (starts_with_colon || !(*cmd == '\''
|| (cmd[0] == cmd[1] && (*cmd == '+' || *cmd == '-')))))
{
ea.cmd = skip_range(ea.cmd, TRUE, NULL);
if (ea.cmd > cmd)
+6 -4
View File
@@ -1473,14 +1473,14 @@ handle_debug(isn_T *iptr, ectx_T *ectx)
// check for the next breakpoint if needed
breakpoint = dbg_find_breakpoint(FALSE, ufunc->uf_name,
iptr->isn_lnum - 1);
iptr->isn_arg.debug.dbg_break_lnum);
if (breakpoint <= 0 || breakpoint > iptr->isn_lnum)
return;
}
SOURCING_LNUM = iptr->isn_lnum;
debug_context = ectx;
debug_var_count = iptr->isn_arg.number;
debug_var_count = iptr->isn_arg.debug.dbg_var_names_len;
for (ni = iptr + 1; ni->isn_type != ISN_FINISH; ++ni)
if (ni->isn_type == ISN_DEBUG
@@ -5476,8 +5476,10 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc)
break;
case ISN_DEBUG:
smsg("%s%4d DEBUG line %d varcount %lld", pfx, current,
iptr->isn_lnum, iptr->isn_arg.number);
smsg("%s%4d DEBUG line %d-%d varcount %lld", pfx, current,
iptr->isn_arg.debug.dbg_break_lnum + 1,
iptr->isn_lnum,
iptr->isn_arg.debug.dbg_var_names_len);
break;
case ISN_UNPACK: smsg("%s%4d UNPACK %d%s", pfx, current,
+13 -2
View File
@@ -166,19 +166,30 @@ vim9_comment_start(char_u *p)
ex_incdec(exarg_T *eap)
{
char_u *cmd = eap->cmd;
size_t len = STRLEN(eap->cmd) + 6;
char_u *nextcmd = eap->nextcmd;
size_t len = STRLEN(eap->cmd) + 8;
if (VIM_ISWHITE(cmd[2]))
{
semsg(_(e_no_white_space_allowed_after_str_str),
eap->cmdidx == CMD_increment ? "++" : "--", eap->cmd);
return;
}
// This works like "nr += 1" or "nr -= 1".
// Add a '|' to avoid looking in the next line.
eap->cmd = alloc(len);
if (eap->cmd == NULL)
return;
vim_snprintf((char *)eap->cmd, len, "%s %c= 1", cmd + 2,
vim_snprintf((char *)eap->cmd, len, "%s %c= 1 |", cmd + 2,
eap->cmdidx == CMD_increment ? '+' : '-');
eap->arg = eap->cmd;
eap->cmdidx = CMD_var;
eap->nextcmd = NULL;
ex_let(eap);
vim_free(eap->cmd);
eap->cmd = cmd;
eap->nextcmd = nextcmd;
}
/*

Some files were not shown because too many files have changed in this diff Show More