Compare commits
176 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47a2abf0bc | ||
|
|
34c54eb6cb | ||
|
|
6bed0dbc85 | ||
|
|
d653293c80 | ||
|
|
3a3b691042 | ||
|
|
36fe7b287e | ||
|
|
5dc4e2f883 | ||
|
|
448465e687 | ||
|
|
5ee0981fb5 | ||
|
|
ff94bd9e47 | ||
|
|
813196784a | ||
|
|
a09bee322e | ||
|
|
c9f8b849b6 | ||
|
|
8e6be34338 | ||
|
|
142f23544c | ||
|
|
60bc8e7244 | ||
|
|
9e40c4b15e | ||
|
|
f637bceb61 | ||
|
|
792f786aad | ||
|
|
6abdcf8285 | ||
|
|
dcbab75db3 | ||
|
|
18dc355395 | ||
|
|
4b2ce1297e | ||
|
|
5546688fb6 | ||
|
|
896ad2c33e | ||
|
|
9681f71392 | ||
|
|
e79cdb69a4 | ||
|
|
4466ad6baa | ||
|
|
2d718267f4 | ||
|
|
d91467f830 | ||
|
|
c71ee829ef | ||
|
|
95388e3179 | ||
|
|
eeece9e488 | ||
|
|
bebaa0d5c0 | ||
|
|
80d868ec25 | ||
|
|
2ea95b61f4 | ||
|
|
67d1c68f09 | ||
|
|
c6ca9f3a29 | ||
|
|
2bede173a1 | ||
|
|
ee8b787bcd | ||
|
|
79cdf80bed | ||
|
|
d92cc130fb | ||
|
|
9950280d37 | ||
|
|
8e02faf4e9 | ||
|
|
382319211a | ||
|
|
032f40afb8 | ||
|
|
17ab28daa0 | ||
|
|
88774a30c0 | ||
|
|
c77534c303 | ||
|
|
b3a01946b3 | ||
|
|
1efefda623 | ||
|
|
52bf81c2d5 | ||
|
|
0ba48e8c27 | ||
|
|
fc74d03e76 | ||
|
|
e6329e4c55 | ||
|
|
27f4f6baee | ||
|
|
8adc8d9b73 | ||
|
|
193f6201b4 | ||
|
|
714cbe5b21 | ||
|
|
c4390fe6c0 | ||
|
|
50dc3ecc64 | ||
|
|
4792a679f9 | ||
|
|
ca359cbedd | ||
|
|
6a07644db3 | ||
|
|
2dfae04f37 | ||
|
|
e41decc892 | ||
|
|
6453cc8078 | ||
|
|
a065a14115 | ||
|
|
02764713a7 | ||
|
|
33aecb1f2c | ||
|
|
f4d61bc559 | ||
|
|
2ce7790348 | ||
|
|
8496c9eadb | ||
|
|
659bb2275e | ||
|
|
47c5ea44b9 | ||
|
|
957cf67d50 | ||
|
|
ea2d407f9c | ||
|
|
6f6244855f | ||
|
|
bbf9f344af | ||
|
|
29b281ba8d | ||
|
|
232f4612e2 | ||
|
|
5e1f22ff61 | ||
|
|
c56936e2ba | ||
|
|
f883508e36 | ||
|
|
ea696852e7 | ||
|
|
8cebd43e97 | ||
|
|
59d8e56e04 | ||
|
|
cbcd9cbd77 | ||
|
|
46f479c756 | ||
|
|
faebda8cc1 | ||
|
|
927495b1fe | ||
|
|
32e5ec0b01 | ||
|
|
85d9b03f84 | ||
|
|
22286895fc | ||
|
|
0fd797eacd | ||
|
|
3132cddd20 | ||
|
|
00806bceb6 | ||
|
|
b885b435d1 | ||
|
|
fabc3ca896 | ||
|
|
b4d16cb11d | ||
|
|
66669fc664 | ||
|
|
f65b35b446 | ||
|
|
631e8f9345 | ||
|
|
c7f7f6db3e | ||
|
|
64ffa9b5fb | ||
|
|
9c13f76275 | ||
|
|
348be7ed07 | ||
|
|
4778b4d0e1 | ||
|
|
c136a3528b | ||
|
|
35efa22ff2 | ||
|
|
0d90e728fe | ||
|
|
6fd3a4ba23 | ||
|
|
36113e46b4 | ||
|
|
dbfa795d8b | ||
|
|
399db046ed | ||
|
|
97a19005e1 | ||
|
|
3b6d57f2ce | ||
|
|
a46765a797 | ||
|
|
645cd3eb1f | ||
|
|
388908352f | ||
|
|
578f4cc7d0 | ||
|
|
e88c8e802c | ||
|
|
55e29611d2 | ||
|
|
963734e316 | ||
|
|
fbcbffe1ad | ||
|
|
749bc9521d | ||
|
|
0289065e41 | ||
|
|
cd030c4b60 | ||
|
|
d66960bf57 | ||
|
|
b2620202c7 | ||
|
|
6d967125ad | ||
|
|
086fc9a585 | ||
|
|
4f6b6ed208 | ||
|
|
185577e47e | ||
|
|
dcdd42a8cc | ||
|
|
cf4d454df0 | ||
|
|
28ee892ac4 | ||
|
|
3e2534ed1a | ||
|
|
159563b439 | ||
|
|
171fb923b8 | ||
|
|
6cf7e3b026 | ||
|
|
b4bcea474d | ||
|
|
70cf45810c | ||
|
|
68a48ee55e | ||
|
|
977fd0b327 | ||
|
|
caf73dcfad | ||
|
|
cb80aa2d53 | ||
|
|
8133cc6bf4 | ||
|
|
c8970b9464 | ||
|
|
f9d51354de | ||
|
|
a360dbe3b6 | ||
|
|
4882d98339 | ||
|
|
89b693e562 | ||
|
|
37e4e03c67 | ||
|
|
e974fa7b2b | ||
|
|
4ff2f2fb6b | ||
|
|
02194d2bd5 | ||
|
|
67def64a4e | ||
|
|
e100440158 | ||
|
|
5661ed6c83 | ||
|
|
e1be11864d | ||
|
|
210681c509 | ||
|
|
f4c6e1e75c | ||
|
|
8ded5b647a | ||
|
|
9c24cd11e2 | ||
|
|
683581eb49 | ||
|
|
081db1a66d | ||
|
|
b07a39de48 | ||
|
|
e6e70a10f1 | ||
|
|
15ab48f088 | ||
|
|
371806e164 | ||
|
|
2733779a1a | ||
|
|
a1224cb706 | ||
|
|
4ce5fe4c87 | ||
|
|
c58f5456e5 | ||
|
|
692d1a51e7 |
4
.github/CODEOWNERS
vendored
4
.github/CODEOWNERS
vendored
@@ -63,6 +63,7 @@ runtime/doc/pi_netrw.txt @cecamp
|
||||
runtime/doc/pi_tar.txt @cecamp
|
||||
runtime/doc/pi_vimball.txt @cecamp
|
||||
runtime/doc/pi_zip.txt @cecamp
|
||||
runtime/ftplugin/awk.vim @dkearns
|
||||
runtime/ftplugin/bst.vim @tpope
|
||||
runtime/ftplugin/css.vim @dkearns
|
||||
runtime/ftplugin/cucumber.vim @tpope
|
||||
@@ -107,6 +108,9 @@ runtime/plugin/tarPlugin.vim @cecamp
|
||||
runtime/plugin/vimballPlugin.vim @cecamp
|
||||
runtime/plugin/zipPlugin.vim @cecamp
|
||||
runtime/syntax/amiga.vim @cecamp
|
||||
runtime/syntax/asm.vim @dkearns
|
||||
runtime/syntax/asmh8300.vim @dkearns
|
||||
runtime/syntax/awk.vim @dkearns
|
||||
runtime/syntax/bst.vim @tpope
|
||||
runtime/syntax/csh.vim @cecamp
|
||||
runtime/syntax/cucumber.vim @tpope
|
||||
|
||||
6
.github/workflows/ci-windows.yaml
vendored
6
.github/workflows/ci-windows.yaml
vendored
@@ -3,7 +3,7 @@ name: GitHub CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
- '**'
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
@@ -39,6 +39,7 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
toolchain: [msvc, mingw]
|
||||
arch: [x64, x86]
|
||||
@@ -214,7 +215,8 @@ jobs:
|
||||
:: Wait about 10 minutes.
|
||||
for /L %%i in (1,1,60) do (
|
||||
if exist done.txt goto exitloop
|
||||
timeout 10
|
||||
timeout 10 > NUL 2>&1
|
||||
if ERRORLEVEL 1 ping -n 11 localhost > NUL
|
||||
)
|
||||
set timeout=1
|
||||
:exitloop
|
||||
|
||||
@@ -159,18 +159,18 @@ thing I have been thinking of is assignments without ":let". I often
|
||||
make that mistake (after writing JavaScript especially). I think it is
|
||||
possible, if we make local variables shadow commands. That should be OK,
|
||||
if you shadow a command you want to use, just rename the variable.
|
||||
Using "let" and "const" to declare a variable, like in JavaScript and
|
||||
Using "var" and "const" to declare a variable, like in JavaScript and
|
||||
TypeScript, can work:
|
||||
|
||||
|
||||
``` vim
|
||||
def MyFunction(arg: number): number
|
||||
let local = 1
|
||||
let todo = arg
|
||||
var local = 1
|
||||
var todo = arg
|
||||
const ADD = 88
|
||||
while todo > 0
|
||||
local += ADD
|
||||
--todo
|
||||
todo -= 1
|
||||
endwhile
|
||||
return local
|
||||
enddef
|
||||
@@ -192,7 +192,7 @@ function and export it:
|
||||
``` vim
|
||||
vim9script " Vim9 script syntax used here
|
||||
|
||||
let local = 'local variable is not exported, script-local'
|
||||
var local = 'local variable is not exported, script-local'
|
||||
|
||||
export def MyFunction() " exported function
|
||||
...
|
||||
@@ -248,10 +248,10 @@ END
|
||||
return luaeval('sum')
|
||||
endfunc
|
||||
|
||||
def VimNew()
|
||||
let sum = 0
|
||||
def VimNew(): number
|
||||
var sum = 0
|
||||
for i in range(1, 2999999)
|
||||
let sum += i
|
||||
sum += i
|
||||
endfor
|
||||
return sum
|
||||
enddef
|
||||
@@ -277,7 +277,7 @@ echo 'Vim new: ' .. reltimestr(reltime(start))
|
||||
|
||||
``` vim
|
||||
def VimNew(): number
|
||||
let totallen = 0
|
||||
var totallen = 0
|
||||
for i in range(1, 100000)
|
||||
setline(i, ' ' .. getline(i))
|
||||
totallen += len(getline(i))
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
" Vim completion script
|
||||
" Language: C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2020 Apr 08
|
||||
" Last Change: 2020 Nov 14
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" This function is used for the 'omnifunc' option.
|
||||
function! ccomplete#Complete(findstart, base)
|
||||
func ccomplete#Complete(findstart, base)
|
||||
if a:findstart
|
||||
" Locate the start of the item, including ".", "->" and "[...]".
|
||||
let line = getline('.')
|
||||
@@ -244,7 +244,7 @@ function! ccomplete#Complete(findstart, base)
|
||||
return map(res, 's:Tagline2item(v:val, brackets)')
|
||||
endfunc
|
||||
|
||||
function! s:GetAddition(line, match, memarg, bracket)
|
||||
func s:GetAddition(line, match, memarg, bracket)
|
||||
" Guess if the item is an array.
|
||||
if a:bracket && match(a:line, a:match . '\s*\[') > 0
|
||||
return '['
|
||||
@@ -260,13 +260,13 @@ function! s:GetAddition(line, match, memarg, bracket)
|
||||
endif
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
endfunc
|
||||
|
||||
" Turn the tag info "val" into an item for completion.
|
||||
" "val" is is an item in the list returned by taglist().
|
||||
" If it is a variable we may add "." or "->". Don't do it for other types,
|
||||
" such as a typedef, by not including the info that s:GetAddition() uses.
|
||||
function! s:Tag2item(val)
|
||||
func s:Tag2item(val)
|
||||
let res = {'match': a:val['name']}
|
||||
|
||||
let res['extra'] = s:Tagcmd2extra(a:val['cmd'], a:val['name'], a:val['filename'])
|
||||
@@ -289,10 +289,10 @@ function! s:Tag2item(val)
|
||||
endif
|
||||
|
||||
return res
|
||||
endfunction
|
||||
endfunc
|
||||
|
||||
" Use all the items in dictionary for the "info" entry.
|
||||
function! s:Dict2info(dict)
|
||||
func s:Dict2info(dict)
|
||||
let info = ''
|
||||
for k in sort(keys(a:dict))
|
||||
let info .= k . repeat(' ', 10 - len(k))
|
||||
@@ -307,7 +307,7 @@ function! s:Dict2info(dict)
|
||||
endfunc
|
||||
|
||||
" Parse a tag line and return a dictionary with items like taglist()
|
||||
function! s:ParseTagline(line)
|
||||
func s:ParseTagline(line)
|
||||
let l = split(a:line, "\t")
|
||||
let d = {}
|
||||
if len(l) >= 3
|
||||
@@ -334,12 +334,12 @@ function! s:ParseTagline(line)
|
||||
endif
|
||||
|
||||
return d
|
||||
endfunction
|
||||
endfunc
|
||||
|
||||
" Turn a match item "val" into an item for completion.
|
||||
" "val['match']" is the matching item.
|
||||
" "val['tagline']" is the tagline in which the last part was found.
|
||||
function! s:Tagline2item(val, brackets)
|
||||
func s:Tagline2item(val, brackets)
|
||||
let line = a:val['tagline']
|
||||
let add = s:GetAddition(line, a:val['match'], [a:val], a:brackets == '')
|
||||
let res = {'word': a:val['match'] . a:brackets . add }
|
||||
@@ -377,10 +377,10 @@ function! s:Tagline2item(val, brackets)
|
||||
let res['menu'] = s:Tagcmd2extra(s, a:val['match'], matchstr(line, '[^\t]*\t\zs[^\t]*\ze\t'))
|
||||
endif
|
||||
return res
|
||||
endfunction
|
||||
endfunc
|
||||
|
||||
" Turn a command from a tag line to something that is useful in the menu
|
||||
function! s:Tagcmd2extra(cmd, name, fname)
|
||||
func s:Tagcmd2extra(cmd, name, fname)
|
||||
if a:cmd =~ '^/^'
|
||||
" The command is a search command, useful to see what it is.
|
||||
let x = matchstr(a:cmd, '^/^\s*\zs.*\ze$/')
|
||||
@@ -395,13 +395,13 @@ function! s:Tagcmd2extra(cmd, name, fname)
|
||||
let x = a:cmd . ' - ' . a:fname
|
||||
endif
|
||||
return x
|
||||
endfunction
|
||||
endfunc
|
||||
|
||||
" Find composing type in "lead" and match items[0] with it.
|
||||
" Repeat this recursively for items[1], if it's there.
|
||||
" When resolving typedefs "depth" is used to avoid infinite recursion.
|
||||
" Return the list of matches.
|
||||
function! s:Nextitem(lead, items, depth, all)
|
||||
func s:Nextitem(lead, items, depth, all)
|
||||
|
||||
" Use the text up to the variable name and split it in tokens.
|
||||
let tokens = split(a:lead, '\s\+\|\<')
|
||||
@@ -485,7 +485,7 @@ function! s:Nextitem(lead, items, depth, all)
|
||||
endfor
|
||||
|
||||
return res
|
||||
endfunction
|
||||
endfunc
|
||||
|
||||
|
||||
" Search for members of structure "typename" in tags files.
|
||||
@@ -493,7 +493,7 @@ endfunction
|
||||
" Each match is a dictionary with "match" and "tagline" entries.
|
||||
" When "all" is non-zero find all, otherwise just return 1 if there is any
|
||||
" member.
|
||||
function! s:StructMembers(typename, items, all)
|
||||
func s:StructMembers(typename, items, all)
|
||||
" Todo: What about local structures?
|
||||
let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
|
||||
if fnames == ''
|
||||
@@ -586,12 +586,12 @@ function! s:StructMembers(typename, items, all)
|
||||
|
||||
" Failed to find anything.
|
||||
return []
|
||||
endfunction
|
||||
endfunc
|
||||
|
||||
" For matching members, find matches for following items.
|
||||
" When "all" is non-zero find all, otherwise just return 1 if there is any
|
||||
" member.
|
||||
function! s:SearchMembers(matches, items, all)
|
||||
func s:SearchMembers(matches, items, all)
|
||||
let res = []
|
||||
for i in range(len(a:matches))
|
||||
let typename = ''
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" zip.vim: Handles browsing zipfiles
|
||||
" AUTOLOAD PORTION
|
||||
" Date: Jan 07, 2020
|
||||
" Version: 30
|
||||
" Version: 31
|
||||
" Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
|
||||
" License: Vim License (see vim's :help license)
|
||||
" Copyright: Copyright (C) 2005-2019 Charles E. Campbell {{{1
|
||||
@@ -20,7 +20,7 @@
|
||||
if &cp || exists("g:loaded_zip")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_zip= "v30"
|
||||
let g:loaded_zip= "v31"
|
||||
if v:version < 702
|
||||
echohl WarningMsg
|
||||
echo "***warning*** this version of zip needs vim 7.2 or later"
|
||||
@@ -65,7 +65,7 @@ endif
|
||||
" zip#Browse: {{{2
|
||||
fun! zip#Browse(zipfile)
|
||||
" call Dfunc("zip#Browse(zipfile<".a:zipfile.">)")
|
||||
" sanity check: ensure that the zipfile has "PK" as its first two letters
|
||||
" sanity check: insure that the zipfile has "PK" as its first two letters
|
||||
" (zipped files have a leading PK as a "magic cookie")
|
||||
if !filereadable(a:zipfile) || readfile(a:zipfile, "", 1)[0] !~ '^PK'
|
||||
exe "noswapfile noautocmd noswapfile e ".fnameescape(a:zipfile)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 8.2. Last change: 2020 Sep 25
|
||||
*autocmd.txt* For Vim version 8.2. Last change: 2020 Nov 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -70,6 +70,10 @@ effects. Be careful not to destroy your text.
|
||||
The special pattern <buffer> or <buffer=N> defines a buffer-local autocommand.
|
||||
See |autocmd-buflocal|.
|
||||
|
||||
If the `:autocmd` is in Vim9 script then {cmd} will be executed as in Vim9
|
||||
script. Thus this depends on where the autocmd is defined, not where it is
|
||||
triggered.
|
||||
|
||||
Note: The ":autocmd" command can only be followed by another command when the
|
||||
'|' appears before {cmd}. This works: >
|
||||
:augroup mine | au! BufRead | augroup END
|
||||
@@ -278,7 +282,7 @@ Name triggered by ~
|
||||
|BufWinLeave| before a buffer is removed from a window
|
||||
|
||||
|BufUnload| before unloading a buffer
|
||||
|BufHidden| just after a buffer has become hidden
|
||||
|BufHidden| just before a buffer becomes hidden
|
||||
|BufNew| just after creating a new buffer
|
||||
|
||||
|SwapExists| detected an existing swap file
|
||||
@@ -551,12 +555,15 @@ CmdlineChanged After a change was made to the text in the
|
||||
*CmdlineEnter*
|
||||
CmdlineEnter After moving the cursor to the command line,
|
||||
where the user can type a command or search
|
||||
string.
|
||||
string; including non-interactive use of ":"
|
||||
in a mapping, but not when using |<Cmd>|.
|
||||
<afile> is set to a single character,
|
||||
indicating the type of command-line.
|
||||
|cmdwin-char|
|
||||
*CmdlineLeave*
|
||||
CmdlineLeave Before leaving the command line.
|
||||
CmdlineLeave Before leaving the command line; including
|
||||
non-interactive use of ":" in a mapping, but
|
||||
not when using |<Cmd>|.
|
||||
Also when abandoning the command line, after
|
||||
typing CTRL-C or <Esc>.
|
||||
When the commands result in an error the
|
||||
@@ -883,7 +890,7 @@ InsertEnter Just before starting Insert mode. Also for
|
||||
string.
|
||||
*InsertLeavePre*
|
||||
InsertLeavePre Just before leaving Insert mode. Also when
|
||||
using CTRL-O |i_CTRL-O|. Be caseful not to
|
||||
using CTRL-O |i_CTRL-O|. Be careful not to
|
||||
change mode or use `:normal`, it will likely
|
||||
cause trouble.
|
||||
*InsertLeave*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 8.2. Last change: 2020 Aug 15
|
||||
*change.txt* For Vim version 8.2. Last change: 2020 Nov 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1801,7 +1801,7 @@ Vim has a sorting function and a sorting command. The sorting function can be
|
||||
found here: |sort()|, |uniq()|.
|
||||
|
||||
*:sor* *:sort*
|
||||
:[range]sor[t][!] [b][f][i][n][o][r][u][x] [/{pattern}/]
|
||||
:[range]sor[t][!] [b][f][i][l][n][o][r][u][x] [/{pattern}/]
|
||||
Sort lines in [range]. When no range is given all
|
||||
lines are sorted.
|
||||
|
||||
@@ -1809,6 +1809,16 @@ found here: |sort()|, |uniq()|.
|
||||
|
||||
With [i] case is ignored.
|
||||
|
||||
With [l] sort uses the current collation locale.
|
||||
Implementation details: strcoll() is used to compare
|
||||
strings. See |:language| to check or set the collation
|
||||
locale. Example: >
|
||||
:language collate en_US.UTF-8
|
||||
:%sort l
|
||||
< |v:collate| can also used to check the current locale.
|
||||
Sorting using the locale typically ignores case.
|
||||
This does not work properly on Mac.
|
||||
|
||||
Options [n][f][x][o][b] are mutually exclusive.
|
||||
|
||||
With [n] sorting is done on the first decimal number
|
||||
@@ -1842,6 +1852,8 @@ found here: |sort()|, |uniq()|.
|
||||
When /{pattern}/ is specified and there is no [r] flag
|
||||
the text matched with {pattern} is skipped, so that
|
||||
you sort on what comes after the match.
|
||||
'ignorecase' applies to the pattern, but 'smartcase'
|
||||
is not used.
|
||||
Instead of the slash any non-letter can be used.
|
||||
For example, to sort on the second comma-separated
|
||||
field: >
|
||||
@@ -1875,8 +1887,7 @@ found here: |sort()|, |uniq()|.
|
||||
Note that using `:sort` with `:global` doesn't sort the matching lines, it's
|
||||
quite useless.
|
||||
|
||||
The details about sorting depend on the library function used. There is no
|
||||
guarantee that sorting obeys the current locale. You will have to try it out.
|
||||
`:sort` does not use the current locale unless the l flag is used.
|
||||
Vim does do a "stable" sort.
|
||||
|
||||
The sorting can be interrupted, but if you interrupt it too late in the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*channel.txt* For Vim version 8.2. Last change: 2020 Sep 03
|
||||
*channel.txt* For Vim version 8.2. Last change: 2020 Oct 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -965,6 +965,10 @@ job_status({job}) *job_status()* *E916*
|
||||
"fail", because a fork happens before the failure can be
|
||||
detected.
|
||||
|
||||
If in Vim9 script a variable is declared with type "job" but
|
||||
never assigned to, passing that variable to job_status()
|
||||
returns "fail".
|
||||
|
||||
If an exit callback was set with the "exit_cb" option and the
|
||||
job is now detected to be "dead" the callback will be invoked.
|
||||
|
||||
@@ -1288,7 +1292,7 @@ prompt. >
|
||||
" Send the text to a shell with Enter appended.
|
||||
call ch_sendraw(g:shell_job, a:text .. "\n")
|
||||
endfunc
|
||||
|
||||
|
||||
" Function handling output from the shell: Added above the prompt.
|
||||
func GotOutput(channel, msg)
|
||||
call append(line("$") - 1, "- " . a:msg)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 8.2. Last change: 2020 Aug 17
|
||||
*editing.txt* For Vim version 8.2. Last change: 2020 Oct 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -73,10 +73,14 @@ g CTRL-G Prints the current position of the cursor in five
|
||||
ways: Column, Line, Word, Character and Byte. If the
|
||||
number of Characters and Bytes is the same then the
|
||||
Character position is omitted.
|
||||
|
||||
If there are characters in the line that take more
|
||||
than one position on the screen (<Tab> or special
|
||||
character), both the "real" column and the screen
|
||||
column are shown, separated with a dash.
|
||||
character), or characters using more than one byte per
|
||||
column (characters above 0x7F when 'encoding' is
|
||||
utf-8), both the byte column and the screen column are
|
||||
shown, separated by a dash.
|
||||
|
||||
Also see the 'ruler' option and the |wordcount()|
|
||||
function.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.2. Last change: 2020 Oct 05
|
||||
*eval.txt* For Vim version 8.2. Last change: 2020 Nov 11
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -120,7 +120,7 @@ base, use |str2nr()|.
|
||||
|
||||
*TRUE* *FALSE* *Boolean*
|
||||
For boolean operators Numbers are used. Zero is FALSE, non-zero is TRUE.
|
||||
You can also use |v:false| and |v:true|. In Vim9 script |false| and |true|.
|
||||
You can also use |v:false| and |v:true|. In Vim9 script |false| and |true|.
|
||||
When TRUE is returned from a function it is the Number one, FALSE is the
|
||||
number zero.
|
||||
|
||||
@@ -2669,8 +2669,9 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]])
|
||||
rhs of mapping {name} in mode {mode}
|
||||
mapcheck({name} [, {mode} [, {abbr}]])
|
||||
String check for mappings matching {name}
|
||||
mapset({mode}, {abbr}, {dict})
|
||||
none restore mapping from |maparg()| result
|
||||
mapnew({expr1}, {expr2}) List/Dict like |map()| but creates a new List
|
||||
or Dictionary
|
||||
mapset({mode}, {abbr}, {dict}) none restore mapping from |maparg()| result
|
||||
match({expr}, {pat} [, {start} [, {count}]])
|
||||
Number position where {pat} matches in {expr}
|
||||
matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]])
|
||||
@@ -2746,7 +2747,7 @@ prop_type_change({name}, {props})
|
||||
none change an existing property type
|
||||
prop_type_delete({name} [, {props}])
|
||||
none delete a property type
|
||||
prop_type_get([{name} [, {props}]])
|
||||
prop_type_get({name} [, {props}])
|
||||
Dict get property type values
|
||||
prop_type_list([{props}]) List get list of property types
|
||||
pum_getpos() Dict position and size of pum if visible
|
||||
@@ -3126,7 +3127,7 @@ appendbufline({expr}, {lnum}, {text}) *appendbufline()*
|
||||
error message is given. Example: >
|
||||
:let failed = appendbufline(13, 0, "# THE START")
|
||||
<
|
||||
< Can also be used as a |method| after a List, the base is
|
||||
Can also be used as a |method| after a List, the base is
|
||||
passed as the second argument: >
|
||||
mylist->appendbufline(buf, lnum)
|
||||
|
||||
@@ -3472,8 +3473,8 @@ byteidx({expr}, {nr}) *byteidx()*
|
||||
Return byte index of the {nr}'th character in the string
|
||||
{expr}. Use zero for the first character, it then returns
|
||||
zero.
|
||||
This function is only useful when there are multibyte
|
||||
characters, otherwise the returned value is equal to {nr}.
|
||||
If there are no multibyte characters the returned value is
|
||||
equal to {nr}.
|
||||
Composing characters are not counted separately, their byte
|
||||
length is added to the preceding base character. See
|
||||
|byteidxcomp()| below for counting composing characters
|
||||
@@ -3798,7 +3799,7 @@ confirm({msg} [, {choices} [, {default} [, {type}]]])
|
||||
not need to be the first letter: >
|
||||
confirm("file has been modified", "&Save\nSave &All")
|
||||
< For the console, the first letter of each choice is used as
|
||||
the default shortcut key.
|
||||
the default shortcut key. Case is ignored.
|
||||
|
||||
The optional {default} argument is the number of the choice
|
||||
that is made if the user hits <CR>. Use 1 to make the first
|
||||
@@ -4427,10 +4428,10 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()*
|
||||
|Dictionaries|.
|
||||
|
||||
If they are |Lists|: Append {expr2} to {expr1}.
|
||||
If {expr3} is given insert the items of {expr2} before item
|
||||
{expr3} in {expr1}. When {expr3} is zero insert before the
|
||||
first item. When {expr3} is equal to len({expr1}) then
|
||||
{expr2} is appended.
|
||||
If {expr3} is given insert the items of {expr2} before the
|
||||
item with index {expr3} in {expr1}. When {expr3} is zero
|
||||
insert before the first item. When {expr3} is equal to
|
||||
len({expr1}) then {expr2} is appended.
|
||||
Examples: >
|
||||
:echo sort(extend(mylist, [7, 5]))
|
||||
:call extend(mylist, [2, 3], 1)
|
||||
@@ -6987,9 +6988,14 @@ luaeval({expr} [, {expr}]) *luaeval()*
|
||||
< {only available when compiled with the |+lua| feature}
|
||||
|
||||
map({expr1}, {expr2}) *map()*
|
||||
{expr1} must be a |List| or a |Dictionary|.
|
||||
{expr1} must be a |List|, |Blob| or |Dictionary|.
|
||||
Replace each item in {expr1} with the result of evaluating
|
||||
{expr2}. {expr2} must be a |string| or |Funcref|.
|
||||
{expr2}. For a |Blob| each byte is replaced.
|
||||
If the item type changes you may want to use |mapnew()| to
|
||||
create a new List or Dictionary. This is required when using
|
||||
Vim9 script.
|
||||
|
||||
{expr2} must be a |string| or |Funcref|.
|
||||
|
||||
If {expr2} is a |string|, inside {expr2} |v:val| has the value
|
||||
of the current item. For a |Dictionary| |v:key| has the key
|
||||
@@ -7024,11 +7030,11 @@ map({expr1}, {expr2}) *map()*
|
||||
|Dictionary| to remain unmodified make a copy first: >
|
||||
:let tlist = map(copy(mylist), ' v:val . "\t"')
|
||||
|
||||
< Returns {expr1}, the |List| or |Dictionary| that was filtered.
|
||||
When an error is encountered while evaluating {expr2} no
|
||||
further items in {expr1} are processed. When {expr2} is a
|
||||
Funcref errors inside a function are ignored, unless it was
|
||||
defined with the "abort" flag.
|
||||
< Returns {expr1}, the |List|, |Blob| or |Dictionary| that was
|
||||
filtered. When an error is encountered while evaluating
|
||||
{expr2} no further items in {expr1} are processed. When
|
||||
{expr2} is a Funcref errors inside a function are ignored,
|
||||
unless it was defined with the "abort" flag.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
mylist->map(expr2)
|
||||
@@ -7137,7 +7143,13 @@ mapcheck({name} [, {mode} [, {abbr}]]) *mapcheck()*
|
||||
GetKey()->mapcheck('n')
|
||||
|
||||
|
||||
mapset({mode}, {abbr}, {dict}) *mapset()*
|
||||
mapnew({expr1}, {expr2}) *mapnew()*
|
||||
Like |map()| but instead of replacing items in {expr1} a new
|
||||
List or Dictionary is created and returned. {expr1} remains
|
||||
unchanged.
|
||||
|
||||
|
||||
mapset({mode}, {abbr}, {dict}) *mapset()*
|
||||
Restore a mapping from a dictionary returned by |maparg()|.
|
||||
{mode} and {abbr} should be the same as for the call to
|
||||
|maparg()|. *E460*
|
||||
@@ -7367,8 +7379,15 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()*
|
||||
the strings in {list} that fuzzy match {str}. The strings in
|
||||
the returned list are sorted based on the matching score.
|
||||
|
||||
The optional {dict} argument always supports the following
|
||||
items:
|
||||
matchseq When this item is present and {str} contains
|
||||
multiple words separated by white space, then
|
||||
returns only matches that contain the words in
|
||||
the given sequence.
|
||||
|
||||
If {list} is a list of dictionaries, then the optional {dict}
|
||||
argument supports the following items:
|
||||
argument supports the following additional items:
|
||||
key key of the item which is fuzzy matched against
|
||||
{str}. The value of this item should be a
|
||||
string.
|
||||
@@ -7382,6 +7401,9 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()*
|
||||
matching is NOT supported. The maximum supported {str} length
|
||||
is 256.
|
||||
|
||||
When {str} has multiple words each separated by white space,
|
||||
then the list of strings that have all the words is returned.
|
||||
|
||||
If there are no matching strings or there is an error, then an
|
||||
empty list is returned. If length of {str} is greater than
|
||||
256, then returns an empty list.
|
||||
@@ -7401,12 +7423,19 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()*
|
||||
:echo v:oldfiles->matchfuzzy("test")
|
||||
< results in a list of file names fuzzy matching "test". >
|
||||
:let l = readfile("buffer.c")->matchfuzzy("str")
|
||||
< results in a list of lines in "buffer.c" fuzzy matching "str".
|
||||
< results in a list of lines in "buffer.c" fuzzy matching "str". >
|
||||
:echo ['one two', 'two one']->matchfuzzy('two one')
|
||||
< results in ['two one', 'one two']. >
|
||||
:echo ['one two', 'two one']->matchfuzzy('two one',
|
||||
\ {'matchseq': 1})
|
||||
< results in ['two one'].
|
||||
|
||||
matchfuzzypos({list}, {str} [, {dict}]) *matchfuzzypos()*
|
||||
Same as |matchfuzzy()|, but returns the list of matched
|
||||
strings and the list of character positions where characters
|
||||
in {str} matches.
|
||||
in {str} matches. You can use |byteidx()|to convert a
|
||||
character position to a byte position.
|
||||
|
||||
|
||||
If {str} matches multiple times in a string, then only the
|
||||
positions for the best match is returned.
|
||||
@@ -7957,8 +7986,8 @@ printf({fmt}, {expr1} ...) *printf()*
|
||||
|
||||
|
||||
prompt_getprompt({buf}) *prompt_getprompt()*
|
||||
Returns the effective prompt text for buffer {buf}. {buf} can
|
||||
be a buffer name or number. |prompt-buffer|.
|
||||
Returns the effective prompt text for buffer {buf}. {buf} can
|
||||
be a buffer name or number. See |prompt-buffer|.
|
||||
|
||||
If the buffer doesn't exist or isn't a prompt buffer, an empty
|
||||
string is returned.
|
||||
@@ -8304,15 +8333,18 @@ reg_recording() *reg_recording()*
|
||||
Returns an empty string when not recording. See |q|.
|
||||
|
||||
reltime([{start} [, {end}]]) *reltime()*
|
||||
Return an item that represents a time value. The format of
|
||||
the item depends on the system. It can be passed to
|
||||
|reltimestr()| to convert it to a string or |reltimefloat()|
|
||||
to convert to a Float.
|
||||
Without an argument it returns the current time.
|
||||
Return an item that represents a time value. The item is a
|
||||
list with items that depend on the system. In Vim 9 script
|
||||
list<any> can be used.
|
||||
The item can be passed to |reltimestr()| to convert it to a
|
||||
string or |reltimefloat()| to convert to a Float.
|
||||
|
||||
Without an argument reltime() returns the current time.
|
||||
With one argument is returns the time passed since the time
|
||||
specified in the argument.
|
||||
With two arguments it returns the time passed between {start}
|
||||
and {end}.
|
||||
|
||||
The {start} and {end} arguments must be values returned by
|
||||
reltime().
|
||||
|
||||
@@ -8630,6 +8662,7 @@ screencol() *screencol()*
|
||||
the following mappings: >
|
||||
nnoremap <expr> GG ":echom ".screencol()."\n"
|
||||
nnoremap <silent> GG :echom screencol()<CR>
|
||||
nnoremap GG <Cmd>echom screencol()<CR>
|
||||
<
|
||||
screenpos({winid}, {lnum}, {col}) *screenpos()*
|
||||
The result is a Dict with the screen position of the text
|
||||
@@ -8697,11 +8730,16 @@ search({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]])
|
||||
|
||||
'ignorecase', 'smartcase' and 'magic' are used.
|
||||
|
||||
When the 'z' flag is not given, searching always starts in
|
||||
column zero and then matches before the cursor are skipped.
|
||||
When the 'c' flag is present in 'cpo' the next search starts
|
||||
after the match. Without the 'c' flag the next search starts
|
||||
one column further.
|
||||
When the 'z' flag is not given, forward searching always
|
||||
starts in column zero and then matches before the cursor are
|
||||
skipped. When the 'c' flag is present in 'cpo' the next
|
||||
search starts after the match. Without the 'c' flag the next
|
||||
search starts one column further. This matters for
|
||||
overlapping matches.
|
||||
When searching backwards and the 'z' flag is given then the
|
||||
search starts in column zero, thus no match in the current
|
||||
line will be found (unless wrapping around the end of the
|
||||
file).
|
||||
|
||||
When the {stopline} argument is given then the search stops
|
||||
after searching this line. This is useful to restrict the
|
||||
@@ -9685,8 +9723,25 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702*
|
||||
When {func} is given and it is '1' or 'i' then case is
|
||||
ignored.
|
||||
|
||||
When {func} is given and it is 'l' then the current collation
|
||||
locale is used for ordering. Implementation details: strcoll()
|
||||
is used to compare strings. See |:language| check or set the
|
||||
collation locale. |v:collate| can also be used to check the
|
||||
current locale. Sorting using the locale typically ignores
|
||||
case. Example: >
|
||||
" ö is sorted similarly to o with English locale.
|
||||
:language collate en_US.UTF8
|
||||
:echo sort(['n', 'o', 'O', 'ö', 'p', 'z'], 'l')
|
||||
< ['n', 'o', 'O', 'ö', 'p', 'z'] ~
|
||||
>
|
||||
" ö is sorted after z with Swedish locale.
|
||||
:language collate sv_SE.UTF8
|
||||
:echo sort(['n', 'o', 'O', 'ö', 'p', 'z'], 'l')
|
||||
< ['n', 'o', 'O', 'p', 'z', 'ö'] ~
|
||||
This does not work properly on Mac.
|
||||
|
||||
When {func} is given and it is 'n' then all items will be
|
||||
sorted numerical (Implementation detail: This uses the
|
||||
sorted numerical (Implementation detail: this uses the
|
||||
strtod() function to parse numbers, Strings, Lists, Dicts and
|
||||
Funcrefs will be considered as being 0).
|
||||
|
||||
@@ -10694,8 +10749,8 @@ terminalprops() *terminalprops()*
|
||||
detected from the response to |t_RV| request. See
|
||||
|v:termresponse| for the response itself. If |v:termresponse|
|
||||
is empty most values here will be 'u' for unknown.
|
||||
cursor_style wether sending |t_RS| works **
|
||||
cursor_blink_mode wether sending |t_RC| works **
|
||||
cursor_style whether sending |t_RS| works **
|
||||
cursor_blink_mode whether sending |t_RC| works **
|
||||
underline_rgb whether |t_8u| works **
|
||||
mouse mouse type supported
|
||||
|
||||
@@ -11351,7 +11406,8 @@ winsaveview() Returns a |Dictionary| that contains information to restore
|
||||
curswant column for vertical movement
|
||||
topline first line in the window
|
||||
topfill filler lines, only in diff mode
|
||||
leftcol first column displayed
|
||||
leftcol first column displayed; only used when
|
||||
'wrap' is off
|
||||
skipcol columns skipped
|
||||
Note that no option values are saved.
|
||||
|
||||
@@ -11570,7 +11626,7 @@ menu Compiled with support for |:menu|.
|
||||
mksession Compiled with support for |:mksession|.
|
||||
modify_fname Compiled with file name modifiers. |filename-modifiers|
|
||||
(always true)
|
||||
mouse Compiled with support mouse.
|
||||
mouse Compiled with support for mouse.
|
||||
mouse_dec Compiled with support for Dec terminal mouse.
|
||||
mouse_gpm Compiled with support for gpm (Linux console mouse)
|
||||
mouse_gpm_enabled GPM mouse is working
|
||||
@@ -12125,8 +12181,9 @@ be used to pass settings to the autoload script before it's loaded: >
|
||||
|
||||
Note that when you make a mistake and call a function that is supposed to be
|
||||
defined in an autoload script, but the script doesn't actually define the
|
||||
function, the script will be sourced every time you try to call the function.
|
||||
And you will get an error message every time.
|
||||
function, you will get an error message for the missing function. If you fix
|
||||
the autoload script it won't be automatically loaded again. Either restart
|
||||
Vim or manually source the script.
|
||||
|
||||
Also note that if you have two script files, and one calls a function in the
|
||||
other and vice versa, before the used function is defined, it won't work.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_mzsch.txt* For Vim version 8.2. Last change: 2019 Dec 07
|
||||
*if_mzsch.txt* For Vim version 8.2. Last change: 2020 Oct 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Sergey Khorev
|
||||
@@ -43,7 +43,7 @@ To speed up the process, you might also want to use --disable-gracket and
|
||||
{script}
|
||||
{endmarker}
|
||||
Execute inlined MzScheme script {script}.
|
||||
Note: This command doesn't work if the MzScheme
|
||||
Note: This command doesn't work when the MzScheme
|
||||
feature wasn't compiled in. To avoid errors, see
|
||||
|script-here|.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*insert.txt* For Vim version 8.2. Last change: 2020 Sep 19
|
||||
*insert.txt* For Vim version 8.2. Last change: 2020 Oct 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -312,6 +312,7 @@ If you enter a value of 10, it will end up in the file as a 0. The 10 is a
|
||||
the buffer to a file, the <NL> character is translated into <Nul>. The <NL>
|
||||
character is written at the end of each line. Thus if you want to insert a
|
||||
<NL> character in a file you will have to make a line break.
|
||||
Also see 'fileformat'.
|
||||
|
||||
*i_CTRL-X* *insert_expand*
|
||||
CTRL-X enters a sub-mode where several commands can be used. Most of these
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 8.2. Last change: 2020 Oct 07
|
||||
*map.txt* For Vim version 8.2. Last change: 2020 Nov 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -271,7 +271,7 @@ For this reason the following is blocked:
|
||||
- The |:normal| command.
|
||||
- Moving the cursor is allowed, but it is restored afterwards.
|
||||
If you want the mapping to do any of these let the returned characters do
|
||||
that.
|
||||
that, or use a |<Cmd>| mapping instead.
|
||||
|
||||
You can use getchar(), it consumes typeahead if there is any. E.g., if you
|
||||
have these mappings: >
|
||||
@@ -303,6 +303,43 @@ empty string, so that nothing is inserted.
|
||||
Note that using 0x80 as a single byte before other text does not work, it will
|
||||
be seen as a special key.
|
||||
|
||||
*<Cmd>* *:map-cmd*
|
||||
The special text <Cmd> begins a "command mapping", it executes the command
|
||||
directly without changing modes. Where you might use ":...<CR>" in the
|
||||
{rhs} of a mapping, you can instead use "<Cmd>...<CR>".
|
||||
Example: >
|
||||
noremap x <Cmd>echo mode(1)<CR>
|
||||
<
|
||||
This is more flexible than `:<C-U>` in Visual and Operator-pending mode, or
|
||||
`<C-O>:` in Insert mode, because the commands are executed directly in the
|
||||
current mode, instead of always going to Normal mode. Visual mode is
|
||||
preserved, so tricks with |gv| are not needed. Commands can be invoked
|
||||
directly in Command-line mode (which would otherwise require timer hacks).
|
||||
Example of using <Cmd> halfway Insert mode: >
|
||||
nnoremap <F3> aText <Cmd>echo mode(1)<CR> Added<Esc>
|
||||
|
||||
Unlike <expr> mappings, there are no special restrictions on the <Cmd>
|
||||
command: it is executed as if an (unrestricted) |autocommand| was invoked.
|
||||
|
||||
Note:
|
||||
- Because <Cmd> avoids mode-changes it does not trigger |CmdlineEnter| and
|
||||
|CmdlineLeave| events, because no user interaction is expected.
|
||||
- For the same reason, |keycodes| like <C-R><C-W> are interpreted as plain,
|
||||
unmapped keys.
|
||||
- The command is not echo'ed, no need for <silent>.
|
||||
- In Visual mode you can use `line('v')` and `col('v')` to get one end of the
|
||||
Visual area, the cursor is at the other end.
|
||||
- In Select mode, |:map| and |:vmap| command mappings are executed in
|
||||
Visual mode. Use |:smap| to handle Select mode differently.
|
||||
|
||||
*E1135* *E1136*
|
||||
<Cmd> commands must terminate, that is, they must be followed by <CR> in the
|
||||
{rhs} of the mapping definition. |Command-line| mode is never entered.
|
||||
|
||||
*E1137*
|
||||
<Cmd> commands can have only normal characters and cannot contain special
|
||||
characters like function keys.
|
||||
|
||||
|
||||
1.3 MAPPING AND MODES *:map-modes*
|
||||
*mapmode-nvo* *mapmode-n* *mapmode-v* *mapmode-o*
|
||||
@@ -1204,9 +1241,9 @@ Otherwise, using "<SID>" outside of a script context is an error.
|
||||
|
||||
If you need to get the script number to use in a complicated script, you can
|
||||
use this function: >
|
||||
function s:SID()
|
||||
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
|
||||
endfun
|
||||
func s:ScriptNumber()
|
||||
return matchstr(expand('<SID>'), '<SNR>\zs\d\+\ze_')
|
||||
endfunc
|
||||
|
||||
The "<SNR>" will be shown when listing functions and mappings. This is useful
|
||||
to find out what they are defined to.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*motion.txt* For Vim version 8.2. Last change: 2020 Aug 24
|
||||
*motion.txt* For Vim version 8.2. Last change: 2020 Oct 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -190,11 +190,14 @@ l or *l*
|
||||
|
||||
*^*
|
||||
^ To the first non-blank character of the line.
|
||||
|exclusive| motion.
|
||||
|exclusive| motion. Any count is ignored.
|
||||
|
||||
*$* *<End>* *<kEnd>*
|
||||
$ or <End> To the end of the line. When a count is given also go
|
||||
[count - 1] lines downward. |inclusive| motion.
|
||||
[count - 1] lines downward, or as far is possible.
|
||||
|inclusive| motion. If a count of 2 of larger is
|
||||
given and the cursor is on the last line, that is an
|
||||
error an 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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*netbeans.txt* For Vim version 8.2. Last change: 2020 Aug 15
|
||||
*netbeans.txt* For Vim version 8.2. Last change: 2020 Nov 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Gordon Prieur et al.
|
||||
@@ -562,9 +562,10 @@ setModtime time
|
||||
saved directly by the Vim Controller.
|
||||
New in version 2.3.
|
||||
|
||||
setReadOnly
|
||||
Set a file as readonly
|
||||
Implemented in version 2.3.
|
||||
setReadOnly readonly
|
||||
When the boolean argument "readonly" is "T" for True, mark the
|
||||
buffer as readonly, when it is "F" for False, mark it as not
|
||||
readonly. Implemented in version 2.3.
|
||||
|
||||
setStyle Not implemented.
|
||||
|
||||
|
||||
@@ -7225,7 +7225,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
normal text. Each status line item is of the form:
|
||||
%-0{minwid}.{maxwid}{item}
|
||||
All fields except the {item} are optional. A single percent sign can
|
||||
be given as "%%". Up to 80 items can be specified. *E541*
|
||||
be given as "%%".
|
||||
|
||||
When the option starts with "%!" then it is used as an expression,
|
||||
evaluated and the result is used as the option value. Example: >
|
||||
|
||||
@@ -154,4 +154,4 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright*
|
||||
v1 Sep 15, 2005 * Initial release, had browsing, reading, and writing
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:fdm=marker
|
||||
vim:tw=78:ts=8:ft=help:noet:norl:fdm=marker
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*popup.txt* For Vim version 8.2. Last change: 2020 Sep 28
|
||||
*popup.txt* For Vim version 8.2. Last change: 2020 Nov 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -101,7 +101,7 @@ CLOSING THE POPUP WINDOW *popup-close*
|
||||
|
||||
Normally the plugin that created the popup window is also in charge of closing
|
||||
it. If somehow a popup hangs around, you can close all of them with: >
|
||||
call popup_clear()
|
||||
call popup_clear(1)
|
||||
Some popups, such as notifications, close after a specified time. This can be
|
||||
set with the "time" property on `popup_create()`.
|
||||
Otherwise, a popup can be closed by clicking on the X in the top-right corner
|
||||
@@ -314,6 +314,7 @@ popup_filter_menu({id}, {key}) *popup_filter_menu()*
|
||||
<Space> <Enter> accept current selection
|
||||
x Esc CTRL-C cancel the menu
|
||||
Other keys are ignored.
|
||||
Always returns |v:true|.
|
||||
|
||||
A match is set on that line to highlight it, see
|
||||
|popup_menu()|.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*sign.txt* For Vim version 8.2. Last change: 2020 Aug 31
|
||||
*sign.txt* For Vim version 8.2. Last change: 2020 Oct 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Gordon Prieur
|
||||
@@ -81,6 +81,10 @@ on the same line, the attributes of the sign with the highest priority is used
|
||||
independently of the sign group. The default priority for a sign is 10. The
|
||||
priority is assigned at the time of placing a sign.
|
||||
|
||||
When two signs with the same priority are present, and one has an icon or text
|
||||
in the signcolumn while the other has line highlighting, then both are
|
||||
displayed.
|
||||
|
||||
When the line on which the sign is placed is deleted, the sign is moved to the
|
||||
next line (or the last line of the buffer, if there is no next line). When
|
||||
the delete is undone the sign does not move back.
|
||||
@@ -458,11 +462,11 @@ sign_getplaced([{expr} [, {dict}]]) *sign_getplaced()*
|
||||
entries
|
||||
|
||||
The dictionary for each sign contains the following entries:
|
||||
group sign group. Set to '' for the global group.
|
||||
id identifier of the sign
|
||||
lnum line number where the sign is placed
|
||||
name name of the defined sign
|
||||
priority sign priority
|
||||
group sign group. Set to '' for the global group.
|
||||
id identifier of the sign
|
||||
lnum line number where the sign is placed
|
||||
name name of the defined sign
|
||||
priority sign priority
|
||||
|
||||
The returned signs in a buffer are ordered by their line
|
||||
number and priority.
|
||||
|
||||
@@ -3006,7 +3006,7 @@ vimrc file: >
|
||||
(Adapted from the html.vim help text by Claudio Fleiner <claudio@fleiner.com>)
|
||||
|
||||
|
||||
*ft-posix-synax* *ft-dash-syntax*
|
||||
*ft-posix-syntax* *ft-dash-syntax*
|
||||
SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax*
|
||||
|
||||
This covers syntax highlighting for the older Unix (Bourne) sh, and newer
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*tabpage.txt* For Vim version 8.2. Last change: 2020 Aug 10
|
||||
*tabpage.txt* For Vim version 8.2. Last change: 2020 Oct 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -195,8 +195,8 @@ gt *i_CTRL-<PageDown>* *i_<C-PageDown>*
|
||||
:+2tabnext " go to the two next tab page
|
||||
:1tabnext " go to the first tab page
|
||||
:$tabnext " go to the last tab page
|
||||
:tabnext # " go to the last accessed tab page
|
||||
:tabnext $ " as above
|
||||
:tabnext # " go to the last accessed tab page
|
||||
:tabnext - " go to the previous tab page
|
||||
:tabnext -1 " as above
|
||||
:tabnext + " go to the next tab page
|
||||
@@ -225,7 +225,7 @@ gT Go to the previous tab page. Wraps around from the first one
|
||||
*:tabl* *:tablast*
|
||||
:tabl[ast] Go to the last tab page.
|
||||
|
||||
*g<Tab>* *CTRL-W_g<Tab>* *<C-Tab>*
|
||||
*g<Tab>* *CTRL-W_g<Tab>* *<C-Tab>*
|
||||
g<Tab> Go to the last accessed tab page.
|
||||
|
||||
Other commands:
|
||||
@@ -259,7 +259,7 @@ REORDERING TAB PAGES:
|
||||
:tabmove " move the tab page to the last
|
||||
:$tabmove " as above
|
||||
:tabmove $ " as above
|
||||
:tabmove # " move the tab page after the last accessed
|
||||
:tabmove # " move the tab page after the last accessed
|
||||
" tab page
|
||||
|
||||
:tabm[ove] +[N]
|
||||
|
||||
@@ -2125,6 +2125,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:bad windows.txt /*:bad*
|
||||
:badd windows.txt /*:badd*
|
||||
:ball windows.txt /*:ball*
|
||||
:balt windows.txt /*:balt*
|
||||
:bar cmdline.txt /*:bar*
|
||||
:bd windows.txt /*:bd*
|
||||
:bdel windows.txt /*:bdel*
|
||||
@@ -2724,6 +2725,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:map-<unique> map.txt /*:map-<unique>*
|
||||
:map-alt-keys map.txt /*:map-alt-keys*
|
||||
:map-arguments map.txt /*:map-arguments*
|
||||
:map-cmd map.txt /*:map-cmd*
|
||||
:map-commands map.txt /*:map-commands*
|
||||
:map-expression map.txt /*:map-expression*
|
||||
:map-local map.txt /*:map-local*
|
||||
@@ -3506,6 +3508,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
<CSI> intro.txt /*<CSI>*
|
||||
<Char-> map.txt /*<Char->*
|
||||
<Char> map.txt /*<Char>*
|
||||
<Cmd> map.txt /*<Cmd>*
|
||||
<CursorHold> autocmd.txt /*<CursorHold>*
|
||||
<D- intro.txt /*<D-*
|
||||
<D-c> os_mac.txt /*<D-c>*
|
||||
@@ -3923,6 +3926,9 @@ E1112 eval.txt /*E1112*
|
||||
E1113 eval.txt /*E1113*
|
||||
E112 eval.txt /*E112*
|
||||
E113 eval.txt /*E113*
|
||||
E1135 map.txt /*E1135*
|
||||
E1136 map.txt /*E1136*
|
||||
E1137 map.txt /*E1137*
|
||||
E114 eval.txt /*E114*
|
||||
E115 eval.txt /*E115*
|
||||
E116 eval.txt /*E116*
|
||||
@@ -4378,7 +4384,6 @@ E538 options.txt /*E538*
|
||||
E539 options.txt /*E539*
|
||||
E54 pattern.txt /*E54*
|
||||
E540 options.txt /*E540*
|
||||
E541 options.txt /*E541*
|
||||
E542 options.txt /*E542*
|
||||
E543 options.txt /*E543*
|
||||
E544 options.txt /*E544*
|
||||
@@ -4932,6 +4937,7 @@ InsertChange autocmd.txt /*InsertChange*
|
||||
InsertCharPre autocmd.txt /*InsertCharPre*
|
||||
InsertEnter autocmd.txt /*InsertEnter*
|
||||
InsertLeave autocmd.txt /*InsertLeave*
|
||||
InsertLeavePre autocmd.txt /*InsertLeavePre*
|
||||
Integer eval.txt /*Integer*
|
||||
J change.txt /*J*
|
||||
Japanese mbyte.txt /*Japanese*
|
||||
@@ -6549,7 +6555,7 @@ ft-php-syntax syntax.txt /*ft-php-syntax*
|
||||
ft-php3-syntax syntax.txt /*ft-php3-syntax*
|
||||
ft-phtml-syntax syntax.txt /*ft-phtml-syntax*
|
||||
ft-plaintex-syntax syntax.txt /*ft-plaintex-syntax*
|
||||
ft-posix-synax syntax.txt /*ft-posix-synax*
|
||||
ft-posix-syntax syntax.txt /*ft-posix-syntax*
|
||||
ft-postscr-syntax syntax.txt /*ft-postscr-syntax*
|
||||
ft-ppwiz-syntax syntax.txt /*ft-ppwiz-syntax*
|
||||
ft-printcap-syntax syntax.txt /*ft-printcap-syntax*
|
||||
@@ -7745,6 +7751,7 @@ mapmode-s map.txt /*mapmode-s*
|
||||
mapmode-t map.txt /*mapmode-t*
|
||||
mapmode-v map.txt /*mapmode-v*
|
||||
mapmode-x map.txt /*mapmode-x*
|
||||
mapnew() eval.txt /*mapnew()*
|
||||
mapping map.txt /*mapping*
|
||||
mapping-functions usr_41.txt /*mapping-functions*
|
||||
mapset() eval.txt /*mapset()*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*terminal.txt* For Vim version 8.2. Last change: 2020 Sep 04
|
||||
*terminal.txt* For Vim version 8.2. Last change: 2020 Nov 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -503,6 +503,8 @@ term_dumpdiff({filename}, {filename} [, {options}])
|
||||
a different attribute
|
||||
+ missing position in first file
|
||||
- missing position in second file
|
||||
> cursor position in first file, not in second
|
||||
< cursor position in secone file, not in first
|
||||
|
||||
Using the "s" key the top and bottom parts are swapped. This
|
||||
makes it easy to spot a difference.
|
||||
@@ -1411,16 +1413,18 @@ If you don't want this then disable it with: >
|
||||
|
||||
Vim window width *termdebug_wide*
|
||||
|
||||
To change the width of the Vim window when debugging starts, and use a
|
||||
vertical split: >
|
||||
let g:termdebug_wide = 163
|
||||
This will set &columns to 163 when `:Termdebug` is used. The value is restored
|
||||
when quitting the debugger.
|
||||
If g:termdebug_wide is set and &columns is already larger than
|
||||
g:termdebug_wide then a vertical split will be used without changing &columns.
|
||||
Set it to 1 to get a vertical split without every changing &columns (useful
|
||||
for when the terminal can't be resized by Vim).
|
||||
To change the width of the Vim window when debugging starts and use a vertical
|
||||
split: >
|
||||
let g:termdebug_wide = 163
|
||||
|
||||
This will set 'columns' to 163 when `:Termdebug` is used. The value is
|
||||
restored when quitting the debugger.
|
||||
|
||||
If g:termdebug_wide is set and 'columns' is already a greater value, then a
|
||||
vertical split will be used without modifying 'columns'.
|
||||
|
||||
Set g:termdebug_wide to 1 to use a vertical split without ever changing
|
||||
'columns'. This is useful when the terminal can't be resized by Vim.
|
||||
|
||||
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*textprop.txt* For Vim version 8.2. Last change: 2020 Mar 05
|
||||
*textprop.txt* For Vim version 8.2. Last change: 2020 Oct 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -101,7 +101,7 @@ Manipulating text property types:
|
||||
prop_type_add({name}, {props}) define a new property type
|
||||
prop_type_change({name}, {props}) change an existing property type
|
||||
prop_type_delete({name} [, {props}]) delete a property type
|
||||
prop_type_get([{name} [, {props}]]) get property type values
|
||||
prop_type_get({name} [, {props}]) get property type values
|
||||
prop_type_list([{props}]) get list of property types
|
||||
|
||||
|
||||
@@ -291,7 +291,7 @@ prop_type_delete({name} [, {props}]) *prop_type_delete()*
|
||||
Can also be used as a |method|: >
|
||||
GetPropName()->prop_type_delete()
|
||||
|
||||
prop_type_get([{name} [, {props}]]) *prop_type_get()*
|
||||
prop_type_get({name} [, {props}]) *prop_type_get()*
|
||||
Returns the properties of property type {name}. This is a
|
||||
dictionary with the same fields as was given to
|
||||
prop_type_add().
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.2. Last change: 2020 Oct 10
|
||||
*todo.txt* For Vim version 8.2. Last change: 2020 Nov 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -38,43 +38,26 @@ browser use: https://github.com/vim/vim/issues/1234
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Making everything work:
|
||||
- If a function is defined in a block it may need to keep the block-locals,
|
||||
like a compiled closure.
|
||||
- Fix memory leaks in test_vim9_assign, remove "if 0"
|
||||
- Fix memory leaks in test_vim9_script
|
||||
- Closure arguments should be more strict, like any function call?
|
||||
- Remove v:disallow_let
|
||||
- Recognize call to assert_fails() and execute it in the function context?
|
||||
Won't work if the command itself fails, not an expression failure:
|
||||
assert_fails("unknown", "E99:")
|
||||
Use try/catch is complicated:
|
||||
let did_catch = false
|
||||
try
|
||||
unknown
|
||||
catch
|
||||
assert_caught('E99:')
|
||||
did_catch = true
|
||||
endtry
|
||||
assert_true('did_catch')
|
||||
Add a new command perhaps:
|
||||
assertfail
|
||||
unknown
|
||||
endassertfail E99:.*unknown
|
||||
- Make map() give an error if the resulting type is wrong.
|
||||
Add mapnew() or mapcopy() to create a new List/Dict for the result, which
|
||||
can have a different value type.
|
||||
- Error message for "'yes && 0" is "using String as a Number", should be "using
|
||||
String as a Bool".
|
||||
Coverity errors in October and November.
|
||||
|
||||
Vim9 - Change
|
||||
- Drop support for #{} early December. Close #7310
|
||||
-> Does it work to recognize lambda?
|
||||
{x: int -> x + 5}
|
||||
var int = 5
|
||||
{x: int, y: int}
|
||||
Vim9 - Making everything work:
|
||||
- Make map() give an error if the resulting type of the first argument is
|
||||
wrong. Only works if the type is known?
|
||||
- Run the same tests in :def and Vim9 script, like in Test_expr7_not()
|
||||
- In autocmd: use legacy syntax, not whatever the current script uses?
|
||||
- need to check type when a declaration specifies a type: #6507
|
||||
let nr: number = 'asdf'
|
||||
- Check many more builtin function arguments at compile time.
|
||||
- Make sure that in vim9script a function call without namespace only finds
|
||||
the script-local function, not a global one.
|
||||
- Make sure that where a callback is expected a function can be used (without
|
||||
quotes). E.g. sort() and map(). Also at the script level.
|
||||
- assignment to more complex lval: list[1][2][3] = 8
|
||||
- assignment to more complex lval: list[1][2][3] = 8 #7309
|
||||
Also "list[0] += value". test in Test_assign_dict_unknown_type().
|
||||
- ":put" with ISN_PUT does not handle range correctly, e.g. ":$-2put".
|
||||
Add command to parse range at runtime?
|
||||
@@ -105,11 +88,13 @@ Making everything work:
|
||||
- Check that when using a user function name without prefix, it does not find
|
||||
a global function. Prefixing g: is required.
|
||||
- Compile: for [key, value] in items(map)
|
||||
- Assignment to dict doesn't work:
|
||||
let ret: dict<string> = #{}
|
||||
ret[i] = string(i)
|
||||
- Appending to dict item doesn't work:
|
||||
let d[i] ..= value
|
||||
- Need the equivalent of get_lval() and set_var_lval() to implement assignment
|
||||
to nested list and dict members.
|
||||
- Assignment to dict doesn't work:
|
||||
let ret: dict<string> = #{}
|
||||
ret[i] = string(i)
|
||||
- Appending to dict item doesn't work:
|
||||
let d[i] ..= value
|
||||
- Using ".." at script level doesn't convert arguments to a string.
|
||||
- Compile replacement of :s command: s/pat/\=expr/
|
||||
- Compile redir to local variable: var_redir_start().
|
||||
@@ -124,12 +109,10 @@ Making everything work:
|
||||
- Make "++nr" work.
|
||||
- Make closures work:
|
||||
- Create closure in a loop. Need to make a list of them.
|
||||
- nested closure only uses one context, not all (#7150)
|
||||
- expandcmd() with `=expr` in filename uses legacy expression.
|
||||
- eval_expr() in ex_cexpr()
|
||||
- eval_expr() call in dbg_parsearg() and debuggy_find()
|
||||
- has() is compiled as a constant, but some checks are dynamic.
|
||||
Check for dynamic values, such as "gui_running".
|
||||
- Implement command modifiers, such as "silent". (#6530)
|
||||
New syntax and functionality:
|
||||
Improve error checking:
|
||||
- "echo Func()" is an error if Func() does not return anything.
|
||||
@@ -152,7 +135,7 @@ Also:
|
||||
- implement enum
|
||||
- Make accessing varargs faster: arg[expr]
|
||||
EVAL expr
|
||||
LOADVARARG (varags idx)
|
||||
LOADVARARG (varargs idx)
|
||||
- Make debugging work - at least per function. Need to recompile a function
|
||||
to step through it line-by-line? Evaluate the stack and variables on the
|
||||
stack?
|
||||
@@ -295,13 +278,13 @@ Was originally written by Felipe Morales.
|
||||
|
||||
Remove SPACE_IN_FILENAME ? It is only used for completion.
|
||||
|
||||
Patch to use collation based sorting. (Christian Brabandt, #6229)
|
||||
|
||||
Add 'termguiattr' option, use "gui=" attributes in the terminal? Would work
|
||||
with 'termguicolors'. #1740
|
||||
|
||||
Patch for blockwise paste reporting changes: #6660.
|
||||
|
||||
Missing filetype test for bashrc, PKGBUILD, etc.
|
||||
|
||||
Add an option to not fetch terminal codes in xterm, to avoid flicker when t_Co
|
||||
changes.
|
||||
|
||||
@@ -351,8 +334,6 @@ work.
|
||||
Using "au!" after "filetype on" is a bit slow. Can the matching of
|
||||
autocommands be made faster? (#7056)
|
||||
|
||||
Valgrind warns for uninitialized values in f_term_dumpwrite().
|
||||
|
||||
Add the <=> (spaceship) operator and "cond ?< expr ?= expr ?> expr"
|
||||
replace this:
|
||||
let left = GetLeftFunc()
|
||||
@@ -364,6 +345,8 @@ Patch to make :q work with local arglist. (Christian Brabandt, #6286)
|
||||
|
||||
Why does Test_invalid_sid() not work in the GUI?
|
||||
|
||||
":pedit" ignores the local working directory when 'pvp' is set (#7267)
|
||||
|
||||
Lua: updating wrong buffer when using newly created, unloaded buffer.
|
||||
(#6539)
|
||||
|
||||
@@ -433,9 +416,6 @@ Another spurious BufDelete. (Dani Dickstein, #5701)
|
||||
|
||||
Wrong error when using local arglist. (Harm te Hennepe, #6133)
|
||||
|
||||
Request to support <Cmd> in mappings, similar to how Neovim does this.
|
||||
(Daniel Hahler, #4784)
|
||||
|
||||
Test loose_clipboard() by selecting text before suspending.
|
||||
|
||||
Undo puts cursor in wrong line after "cG<Esc>" undo.
|
||||
@@ -455,12 +435,8 @@ Patch to fix session file when using multiple tab pages. (Jason Franklin, 2019
|
||||
May 20)
|
||||
Also put :argadd commands at the start for all buffers, so that their order
|
||||
remains equal? Then %argdel to clean it up. Do try this with 'hidden' set.
|
||||
Also #4994: window-local options not always restored, related to using :badd.
|
||||
Also #5326: netrw buffers are not restored.
|
||||
|
||||
Alternate file is not set in the session file. Use setwintabvar("@#") ?
|
||||
(#6714)
|
||||
|
||||
When 'backupdir' has a path ending in double slash (meaning: use full path of
|
||||
the file) combined with 'patchmode' the file name is wrong. (#5791)
|
||||
|
||||
@@ -595,10 +571,6 @@ Patch to have text objects defined by arbitrary single characters. (Daniel
|
||||
Thau, 2013 Nov 20, 2014 Jan 29, 2014 Jan 31)
|
||||
Added tests (James McCoy, 2016 Aug 3, #958). Still needs more work.
|
||||
|
||||
":2resize +10" uses size of the current window, adds 10 and applies it to
|
||||
window 2. User expects 10 to be added to size of window 2. (Daniel Steinberg,
|
||||
#5443)
|
||||
|
||||
Would be nice to set tab-local values for 'diffexpr' and 'diffopt'. Use
|
||||
t:diffexpr_option t:diffopt_option? (#4782)
|
||||
|
||||
@@ -1088,7 +1060,7 @@ neovim #7431)
|
||||
Patch for improving detecting Ruby on Mac in configure. (Ilya Mikhaltsou, 2017
|
||||
Nov 21)
|
||||
|
||||
When t_Co is changed from termresponse, the OptionSet autocmmand event isn't
|
||||
When t_Co is changed from termresponse, the OptionSet autocommand event isn't
|
||||
triggered. Use the code from the end of set_num_option() in
|
||||
set_color_count().
|
||||
|
||||
@@ -1373,6 +1345,9 @@ no longer support.
|
||||
sort() is not stable when using numeric/float sort (Nikolay Pavlov, 2016 Sep
|
||||
4#1038)
|
||||
|
||||
sort() does not use 'smartcase' for the skip pattern, even though 'ignorecase'
|
||||
is used. (Filipe Brandenburger, #7322)
|
||||
|
||||
+channel:
|
||||
- Add a in_cb, invoked when the write buffer has become empty. (Matteo Landi)
|
||||
- Add ch_readlines(): for a channel in NL mode, reads as many lines as are
|
||||
@@ -2318,7 +2293,7 @@ Additional info by Dominique Pelle. (also on 2010 Apr 10)
|
||||
|
||||
CreateFile and CreateFileW are used without sharing, filewritable() fails when
|
||||
the file was already open (e.g. script is being sourced). Add FILE_SHARE_READ|
|
||||
FILE_SHARE_WRITE in mch_access()? (Phillippe Vaucher, 2010 Nov 2)
|
||||
FILE_SHARE_WRITE in mch_access()? (Philippe Vaucher, 2010 Nov 2)
|
||||
|
||||
Is ~/bin (literally) in $PATH supposed to work? (Paul, 2010 March 29)
|
||||
Looks like only bash can do it. (Yakov Lerner)
|
||||
@@ -3858,10 +3833,6 @@ Macintosh:
|
||||
on the status line (caused by 'winheight'). Select window on button up,
|
||||
instead of on button down.
|
||||
8 Dragging the status line doesn't scroll but redraw.
|
||||
9 Evaluating 'statusline' in build_stl_str_hl() does not properly check for
|
||||
reaching the end of the available buffer.
|
||||
Patch to dynamically allocate the buffer for % items. (Eric Arnold, 2006
|
||||
May 14)
|
||||
8 When performing incremental search, should abort searching as soon as a
|
||||
character is typed.
|
||||
8 When the value of $MAKE contains a path, configure can't handle this.
|
||||
@@ -5958,7 +5929,7 @@ Writing files:
|
||||
losing the original when writing twice. (Slootman)
|
||||
7 On non-Unix machines, also overwrite the original file in some situations
|
||||
(file system full, it's a link on an NFS partition).
|
||||
7 When editing a file, check that it has been change outside of Vim more
|
||||
7 When editing a file, check that it has been changed outside of Vim more
|
||||
often, not only when writing over it. E.g., at the time the swap file is
|
||||
flushed. Or every ten seconds or so (use the time of day, check it before
|
||||
waiting for a character to be typed).
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*undo.txt* For Vim version 8.2. Last change: 2019 Dec 07
|
||||
*undo.txt* For Vim version 8.2. Last change: 2020 Oct 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -392,7 +392,7 @@ back the text of three deletes ago with '"3P'.
|
||||
*redo-register*
|
||||
If you want to get back more than one part of deleted text, you can use a
|
||||
special feature of the repeat command ".". It will increase the number of the
|
||||
register used. So if you first do ""1P", the following "." will result in a
|
||||
register used. So if you first do '"1P', the following "." will result in a
|
||||
'"2P'. Repeating this will result in all numbered registers being inserted.
|
||||
|
||||
Example: If you deleted text with 'dd....' it can be restored with
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_11.txt* For Vim version 8.2. Last change: 2020 Jul 08
|
||||
*usr_11.txt* For Vim version 8.2. Last change: 2020 Oct 25
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -294,7 +294,7 @@ If you really don't want to see this message, you can add the 'A' flag to the
|
||||
'shortmess' option. But it's very unusual that you need this.
|
||||
|
||||
For remarks about encryption and the swap file, see |:recover-crypt|.
|
||||
For programatic access to the swap file, see |swapinfo()|.
|
||||
For programmatic access to the swap file, see |swapinfo()|.
|
||||
|
||||
==============================================================================
|
||||
*11.4* Further reading
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 8.2. Last change: 2020 Aug 30
|
||||
*usr_41.txt* For Vim version 8.2. Last change: 2020 Nov 09
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -644,6 +644,7 @@ List manipulation: *list-functions*
|
||||
deepcopy() make a full copy of a List
|
||||
filter() remove selected items from a List
|
||||
map() change each List item
|
||||
mapnew() make a new List with changed items
|
||||
reduce() reduce a List to a value
|
||||
sort() sort a List
|
||||
reverse() reverse the order of a List
|
||||
@@ -669,6 +670,7 @@ Dictionary manipulation: *dict-functions*
|
||||
extend() add entries from one Dictionary to another
|
||||
filter() remove selected entries from a Dictionary
|
||||
map() change each Dictionary entry
|
||||
mapnew() make a new Dictionary with changed items
|
||||
keys() get List of Dictionary keys
|
||||
values() get List of Dictionary values
|
||||
items() get List of Dictionary key-value pairs
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*various.txt* For Vim version 8.2. Last change: 2020 Aug 20
|
||||
*various.txt* For Vim version 8.2. Last change: 2020 Nov 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -142,15 +142,17 @@ g8 Print the hex values of the bytes used in the
|
||||
quit
|
||||
<
|
||||
*:z* *E144*
|
||||
:{range}z[+-^.=]{count} Display several lines of text surrounding the line
|
||||
specified with {range}, or around the current line
|
||||
if there is no {range}. If there is a {count}, that's
|
||||
how many lines you'll see; if there is no {count} and
|
||||
only one window then twice the value of the 'scroll'
|
||||
option is used, otherwise the current window height
|
||||
minus 3 is used.
|
||||
:[range]z[+-^.=][count] Display several lines of text surrounding the line
|
||||
specified with [range], or around the current line
|
||||
if there is no [range].
|
||||
|
||||
If there is a {count} the 'window' option is set to
|
||||
If there is a [count], that's how many lines you'll
|
||||
see; if there is no [count] and only one window then
|
||||
twice the value of the 'scroll' option is used,
|
||||
otherwise the current window height minus 3 is used.
|
||||
This is the value of "scr" in the table below.
|
||||
|
||||
If there is a [count] the 'window' option is set to
|
||||
its value.
|
||||
|
||||
:z can be used either alone or followed by any of
|
||||
@@ -168,7 +170,7 @@ g8 Print the hex values of the bytes used in the
|
||||
If the mark is "=", a line of dashes is printed
|
||||
around the current line.
|
||||
|
||||
:{range}z#[+-^.=]{count} *:z#*
|
||||
:[range]z#[+-^.=][count] *:z#*
|
||||
Like ":z", but number the lines.
|
||||
|
||||
*:=*
|
||||
|
||||
@@ -1331,7 +1331,7 @@ eventhandler() Returns 1 when inside an event handler and interactive
|
||||
executable() Checks if a program or batch script can be executed.
|
||||
filewritable() Checks if a file can be written. (Ron Aaron)
|
||||
foldclosed() Find out if there is a closed fold. (Johannes Zellner).
|
||||
foldcloseend() Find the end of a closed fold.
|
||||
foldclosedend() Find the end of a closed fold.
|
||||
foldlevel() Find out the foldlevel. (Johannes Zellner)
|
||||
foreground() Move the GUI window to the foreground.
|
||||
getchar() Get one character from the user. Can be used to define a
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*version7.txt* For Vim version 8.2. Last change: 2020 Aug 15
|
||||
*version7.txt* For Vim version 8.2. Last change: 2020 Oct 25
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -10260,7 +10260,7 @@ Commands:
|
||||
Brabandt)
|
||||
|
||||
Other:
|
||||
Lua interface now also uses userdata binded to Vim structures. (Taro
|
||||
Lua interface now also uses userdata bound to Vim structures. (Taro
|
||||
Muraoka, Luis Carvalho)
|
||||
|
||||
glob() and autocommand patterns used to work with the undocumented
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*version8.txt* For Vim version 8.2. Last change: 2020 Aug 15
|
||||
*version8.txt* For Vim version 8.2. Last change: 2020 Oct 25
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -42557,7 +42557,7 @@ Files: src/buffer.c, src/testdir/test_statusline.vim,
|
||||
src/testdir/dumps/Test_statusline_1.dump
|
||||
|
||||
Patch 8.2.0236
|
||||
Problem: MS-Windows uninstall doesn't delete vimtutur.bat.
|
||||
Problem: MS-Windows uninstall doesn't delete vimtutor.bat.
|
||||
Solution: Change directory before deletion. (Ken Takata, closes #5603)
|
||||
Files: src/uninstall.c
|
||||
|
||||
@@ -47698,7 +47698,7 @@ Files: src/eval.c, src/testdir/test_vim9_expr.vim
|
||||
|
||||
Patch 8.2.1064
|
||||
Problem: Vim9: no line break allowed before comparators.
|
||||
Solution: Check for comperator after line break.
|
||||
Solution: Check for comparator after line break.
|
||||
Files: src/eval.c, src/testdir/test_vim9_expr.vim
|
||||
|
||||
Patch 8.2.1065
|
||||
|
||||
@@ -459,6 +459,9 @@ Use {name} as the server name. Used for the current Vim, unless used with a
|
||||
\-\-socketid {id}
|
||||
GTK GUI only: Use the GtkPlug mechanism to run gvim in another window.
|
||||
.TP
|
||||
\-\-startuptime {file}
|
||||
During startup write timing messages to the file {fname}.
|
||||
.TP
|
||||
\-\-version
|
||||
Print version information and exit.
|
||||
.SH ON-LINE HELP
|
||||
|
||||
@@ -345,6 +345,9 @@ OPTIONS
|
||||
GTK GUI only: Use the GtkPlug mechanism to run gvim in an‐
|
||||
other window.
|
||||
|
||||
--startuptime {file}
|
||||
During startup write timing messages to the file {fname}.
|
||||
|
||||
--version Print version information and exit.
|
||||
|
||||
ON-LINE HELP
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2020 Oct 05
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2020 Nov 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -112,8 +112,7 @@ In Vi # is a command to list text with numbers. In Vim9 script you can use
|
||||
101 number
|
||||
|
||||
To improve readability there must be a space between a command and the #
|
||||
that starts a comment. Note that #{ is the start of a dictionary, therefore
|
||||
it does not start a comment.
|
||||
that starts a comment.
|
||||
|
||||
|
||||
Vim9 functions ~
|
||||
@@ -176,8 +175,8 @@ However, it is recommended to always use "g:" to refer to a global function
|
||||
for clarity.
|
||||
|
||||
In all cases the function must be defined before used. That is when it is
|
||||
called, when `:defcompile` causes the it to be compiled, or when code that
|
||||
calls it is being compiled (to figure out the return type).
|
||||
called, when `:defcompile` causes it to be compiled, or when code that calls
|
||||
it is being compiled (to figure out the return type).
|
||||
|
||||
The result is that functions and variables without a namespace can usually be
|
||||
found in the script, either defined there or imported. Global functions and
|
||||
@@ -303,8 +302,7 @@ identifier or can't be an Ex command. Examples: >
|
||||
myList->add(123)
|
||||
g:myList->add(123)
|
||||
[1, 2, 3]->Process()
|
||||
#{a: 1, b: 2}->Process()
|
||||
{'a': 1, 'b': 2}->Process()
|
||||
{a: 1, b: 2}->Process()
|
||||
"foobar"->Process()
|
||||
("foobar")->Process()
|
||||
'foobar'->Process()
|
||||
@@ -346,7 +344,7 @@ those cases there is no need to prefix the line with a backslash
|
||||
'two',
|
||||
]
|
||||
And when a dict spans multiple lines: >
|
||||
var mydict = #{
|
||||
var mydict = {
|
||||
one: 1,
|
||||
two: 2,
|
||||
}
|
||||
@@ -430,6 +428,27 @@ No curly braces expansion ~
|
||||
|curly-braces-names| cannot be used.
|
||||
|
||||
|
||||
Dictionary literals ~
|
||||
|
||||
Traditionally Vim has supported dictionary literals with a {} syntax: >
|
||||
let dict = {'key': value}
|
||||
|
||||
Later it became clear that using a simple key name is very common, thus
|
||||
literally dictionaries were introduced in a backwards compatible way: >
|
||||
let dict = #{key: value}
|
||||
|
||||
However, this #{} syntax is unlike any existing language. As it appears that
|
||||
using a literal key is much more common than using an expression, and
|
||||
considering that JavaScript uses this syntax, using the {} form for dictionary
|
||||
literals was considered a much more useful syntax. In Vim9 script the {} form
|
||||
uses literal keys: >
|
||||
let dict = {key: value}
|
||||
|
||||
In case an expression needs to be used for the key, square brackets can be
|
||||
used, just like in JavaScript: >
|
||||
let dict = {["key" .. nr]: value}
|
||||
|
||||
|
||||
No :xit, :t, :append, :change or :insert ~
|
||||
|
||||
These commands are too easily confused with local variable names.
|
||||
@@ -901,7 +920,7 @@ The script name after `import` can be:
|
||||
location of the script file itself. This is useful to split up a large
|
||||
plugin into several files.
|
||||
- An absolute path, starting with "/" on Unix or "D:/" on MS-Windows. This
|
||||
will be rarely used.
|
||||
will rarely be used.
|
||||
- A path not being relative or absolute. This will be found in the
|
||||
"import" subdirectories of 'runtimepath' entries. The name will usually be
|
||||
longer and unique, to avoid loading the wrong file.
|
||||
@@ -1160,8 +1179,8 @@ Some details are unexpected and can be improved. For example a boolean
|
||||
condition would accept a string, convert it to a number and check if the
|
||||
number is non-zero. This is unexpected and often leads to mistakes, since
|
||||
text not starting with a number would be converted to zero, which is
|
||||
considered false. Thus a string would not give an error and be considered
|
||||
false if it doesn't start with a number. That is confusing.
|
||||
considered false. Thus using a string for a condition would often not give an
|
||||
error and be considered false. That is confusing.
|
||||
|
||||
In Vim9 type checking is more strict to avoid mistakes. Where a condition is
|
||||
used, e.g. with the `:if` command and the `||` operator, only boolean-like
|
||||
@@ -1169,7 +1188,7 @@ values are accepted:
|
||||
true: `true`, `v:true`, `1`, `0 < 9`
|
||||
false: `false`, `v:false`, `0`, `0 > 9`
|
||||
Note that the number zero is false and the number one is true. This is more
|
||||
persmissive than most other languages. It was done because many builtin
|
||||
permissive than most other languages. It was done because many builtin
|
||||
functions return these values.
|
||||
|
||||
If you have any type of value and want to use it as a boolean, use the `!!`
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*windows.txt* For Vim version 8.2. Last change: 2020 Sep 02
|
||||
*windows.txt* For Vim version 8.2. Last change: 2020 Nov 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1119,6 +1119,11 @@ list of buffers. |unlisted-buffer|
|
||||
line when the buffer is first entered. Note that other
|
||||
commands after the + will be ignored.
|
||||
|
||||
*:balt*
|
||||
:balt [+lnum] {fname}
|
||||
Like `:badd` and also set the alternate file for the current
|
||||
window to {fname}.
|
||||
|
||||
:[N]bd[elete][!] *:bd* *:bdel* *:bdelete* *E516*
|
||||
:bd[elete][!] [N]
|
||||
Unload buffer [N] (default: current buffer) and delete it from
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2020 Sep 30
|
||||
" Last Change: 2020 Oct 24
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -696,12 +696,15 @@ au BufNewFile,BufRead .gtkrc,gtkrc setf gtkrc
|
||||
au BufNewFile,BufRead *.haml setf haml
|
||||
|
||||
" Hamster Classic | Playground files
|
||||
au BufNewFile,BufRead *.hsc,*.hsm setf hamster
|
||||
au BufNewFile,BufRead *.hsm setf hamster
|
||||
|
||||
" Haskell
|
||||
au BufNewFile,BufRead *.hs,*.hs-boot setf haskell
|
||||
au BufNewFile,BufRead *.hs,*.hsc,*.hs-boot setf haskell
|
||||
au BufNewFile,BufRead *.lhs setf lhaskell
|
||||
au BufNewFile,BufRead *.chs setf chaskell
|
||||
au BufNewFile,BufRead cabal.project setf cabalproject
|
||||
au BufNewFile,BufRead $HOME/.cabal/config setf cabalconfig
|
||||
au BufNewFile,BufRead cabal.config setf cabalconfig
|
||||
|
||||
" Haste
|
||||
au BufNewFile,BufRead *.ht setf haste
|
||||
@@ -1305,6 +1308,7 @@ au BufNewFile,BufRead *.pml setf promela
|
||||
|
||||
" Google protocol buffers
|
||||
au BufNewFile,BufRead *.proto setf proto
|
||||
au BufNewFile,BufRead *.pbtxt setf pbtxt
|
||||
|
||||
" Protocols
|
||||
au BufNewFile,BufRead */etc/protocols setf protocols
|
||||
@@ -1506,9 +1510,10 @@ au BufNewFile,BufRead *.decl,*.dcl,*.dec
|
||||
au BufNewFile,BufRead catalog setf catalog
|
||||
|
||||
" Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc.
|
||||
" Gentoo ebuilds and Arch Linux PKGBUILDs are actually bash scripts
|
||||
" Gentoo ebuilds, Arch Linux PKGBUILDs and Alpine Linux APKBUILDs are actually
|
||||
" bash scripts.
|
||||
" NOTE: Patterns ending in a star are further down, these have lower priority.
|
||||
au BufNewFile,BufRead .bashrc,bashrc,bash.bashrc,.bash[_-]profile,.bash[_-]logout,.bash[_-]aliases,bash-fc[-.],*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD call dist#ft#SetFileTypeSH("bash")
|
||||
au BufNewFile,BufRead .bashrc,bashrc,bash.bashrc,.bash[_-]profile,.bash[_-]logout,.bash[_-]aliases,bash-fc[-.],*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD,APKBUILD call dist#ft#SetFileTypeSH("bash")
|
||||
au BufNewFile,BufRead .kshrc,*.ksh call dist#ft#SetFileTypeSH("ksh")
|
||||
au BufNewFile,BufRead */etc/profile,.profile,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1))
|
||||
|
||||
@@ -1720,7 +1725,7 @@ au BufNewFile,BufRead *.latex,*.sty,*.dtx,*.ltx,*.bbl setf tex
|
||||
au BufNewFile,BufRead *.tex call dist#ft#FTtex()
|
||||
|
||||
" ConTeXt
|
||||
au BufNewFile,BufRead *.mkii,*.mkiv,*.mkvi setf context
|
||||
au BufNewFile,BufRead *.mkii,*.mkiv,*.mkvi,*.mkxl,*.mklx setf context
|
||||
|
||||
" Texinfo
|
||||
au BufNewFile,BufRead *.texinfo,*.texi,*.txi setf texinfo
|
||||
@@ -2035,12 +2040,14 @@ au BufNewFile,BufRead bzr_log.* setf bzr
|
||||
|
||||
" Bazel build file
|
||||
if !has("fname_case")
|
||||
au BufNewFile,BufRead *.BUILD,BUILD setf bzl
|
||||
au BufNewFile,BufRead *.BUILD,BUILD setf bzl
|
||||
endif
|
||||
|
||||
" BIND zone
|
||||
au BufNewFile,BufRead */named/db.*,*/bind/db.* call s:StarSetf('bindzone')
|
||||
|
||||
au BufNewFile,BufRead cabal.project.* call s:StarSetf('cabalproject')
|
||||
|
||||
" Calendar
|
||||
au BufNewFile,BufRead */.calendar/*,
|
||||
\*/share/calendar/*/calendar.*,*/share/calendar/calendar.*
|
||||
@@ -2163,7 +2170,7 @@ au BufNewFile,BufRead .reminders* call s:StarSetf('remind')
|
||||
au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog')
|
||||
|
||||
" Shell scripts ending in a star
|
||||
au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,,PKGBUILD* call dist#ft#SetFileTypeSH("bash")
|
||||
au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,PKGBUILD*,APKBUILD* call dist#ft#SetFileTypeSH("bash")
|
||||
au BufNewFile,BufRead .kshrc* call dist#ft#SetFileTypeSH("ksh")
|
||||
au BufNewFile,BufRead .profile* call dist#ft#SetFileTypeSH(getline(1))
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
" Vim filetype plugin
|
||||
" Language: awk, nawk, gawk, mawk
|
||||
" Maintainer: Antonio Colombo <azc100@gmail.com>
|
||||
" Last Change: 2020 Sep 28
|
||||
" Language: awk, nawk, gawk, mawk
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Antonio Colombo <azc100@gmail.com>
|
||||
" Last Change: 2020 Sep 28
|
||||
|
||||
" This plugin was prepared by Mark Sikora
|
||||
" This plugin was updated as proposed by Doug Kearns
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim ftplugin file
|
||||
" Language: Erlang
|
||||
" Author: Oscar Hellström <oscar@oscarh.net>
|
||||
" Contributors: Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
||||
" Author: Oscar Hellström <oscar@oscarh.net>
|
||||
" Contributors: Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
||||
" Eduardo Lopez (http://github.com/tapichu)
|
||||
" License: Vim license
|
||||
" Version: 2012/01/25
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Make
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2019 Apr 02
|
||||
" Last Change: 2020 Oct 16
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -9,10 +9,10 @@ if exists("b:did_ftplugin")
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = "setl et< sts< fo< com< cms< inc<"
|
||||
let b:undo_ftplugin = "setl et< sts< sw< fo< com< cms< inc<"
|
||||
|
||||
" Make sure a hard tab is used, required for most make programs
|
||||
setlocal noexpandtab softtabstop=0
|
||||
setlocal noexpandtab softtabstop=0 shiftwidth=0
|
||||
|
||||
" Set 'formatoptions' to break comment lines but not other lines,
|
||||
" and insert the comment leader when hitting <CR> or using "o".
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: man
|
||||
" Maintainer: Jason Franklin <vim@justemail.net>
|
||||
" Maintainer: SungHyun Nam <goweol@gmail.com>
|
||||
" Last Change: 2020 Jun 01
|
||||
" Last Change: 2020 Oct 09
|
||||
|
||||
" To make the ":Man" command available before editing a manual page, source
|
||||
" this script from your startup vimrc file.
|
||||
@@ -76,7 +76,7 @@ catch /E145:/
|
||||
" Ignore the error in restricted mode
|
||||
endtry
|
||||
|
||||
func <SID>PreGetPage(cnt)
|
||||
func s:PreGetPage(cnt)
|
||||
if a:cnt == 0
|
||||
let old_isk = &iskeyword
|
||||
if &ft == 'man'
|
||||
@@ -99,24 +99,27 @@ func <SID>PreGetPage(cnt)
|
||||
call s:GetPage('', sect, page)
|
||||
endfunc
|
||||
|
||||
func <SID>GetCmdArg(sect, page)
|
||||
if a:sect == ''
|
||||
return a:page
|
||||
func s:GetCmdArg(sect, page)
|
||||
|
||||
if empty(a:sect)
|
||||
return shellescape(a:page)
|
||||
endif
|
||||
return s:man_sect_arg.' '.a:sect.' '.a:page
|
||||
|
||||
return s:man_sect_arg . ' ' . shellescape(a:sect) . ' ' . shellescape(a:page)
|
||||
endfunc
|
||||
|
||||
func <SID>FindPage(sect, page)
|
||||
let where = system("man ".s:man_find_arg.' '.s:GetCmdArg(a:sect, a:page))
|
||||
if where !~ "^/"
|
||||
if matchstr(where, " [^ ]*$") !~ "^ /"
|
||||
return 0
|
||||
endif
|
||||
func s:FindPage(sect, page)
|
||||
let l:cmd = printf('man %s %s', s:man_find_arg, s:GetCmdArg(a:sect, a:page))
|
||||
call system(l:cmd)
|
||||
|
||||
if v:shell_error
|
||||
return 0
|
||||
endif
|
||||
|
||||
return 1
|
||||
endfunc
|
||||
|
||||
func <SID>GetPage(cmdmods, ...)
|
||||
func s:GetPage(cmdmods, ...)
|
||||
if a:0 >= 2
|
||||
let sect = a:1
|
||||
let page = a:2
|
||||
@@ -226,7 +229,7 @@ func <SID>GetPage(cmdmods, ...)
|
||||
setl noma
|
||||
endfunc
|
||||
|
||||
func <SID>PopPage()
|
||||
func s:PopPage()
|
||||
if s:man_tag_depth > 0
|
||||
let s:man_tag_depth = s:man_tag_depth - 1
|
||||
exec "let s:man_tag_buf=s:man_tag_buf_".s:man_tag_depth
|
||||
|
||||
21
runtime/ftplugin/pbtxt.vim
Normal file
21
runtime/ftplugin/pbtxt.vim
Normal file
@@ -0,0 +1,21 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Protobuf Text Format
|
||||
" Maintainer: Lakshay Garg <lakshayg@outlook.in>
|
||||
" Last Change: 2020 Nov 17
|
||||
" Homepage: https://github.com/lakshayg/vim-pbtxt
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal commentstring=#\ %s
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: RPL/2
|
||||
" Maintainer: Joël BERTRAND <rpl2@free.fr>
|
||||
" Maintainer: Joël BERTRAND <rpl2@free.fr>
|
||||
" Last Change: 2012 Mar 07
|
||||
" Version: 0.1
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: RPL/2
|
||||
" Version: 0.2
|
||||
" Last Change: 2017 Jun 13
|
||||
" Maintainer: BERTRAND Joël <rpl2@free.fr>
|
||||
" Maintainer: BERTRAND Joël <rpl2@free.fr>
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"Description: Indent scheme for the tilde weblanguage
|
||||
"Author: Tobias Rundström <tobi@tobi.nu>
|
||||
"Author: Tobias Rundström <tobi@tobi.nu>
|
||||
"URL: http://tilde.tildesoftware.net
|
||||
"Last Change: May 8 09:15:09 CEST 2002
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" These commands create the option window.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2020 Sep 10
|
||||
" Last Change: 2020 Oct 27
|
||||
|
||||
" If there already is an option window, jump to that one.
|
||||
let buf = bufnr('option-window')
|
||||
@@ -617,7 +617,7 @@ call <SID>AddOption("mousemodel", gettext("\"extend\", \"popup\" or \"popup_setp
|
||||
call <SID>OptionG("mousem", &mousem)
|
||||
call <SID>AddOption("mousetime", gettext("maximum time in msec to recognize a double-click"))
|
||||
call append("$", " \tset mouset=" . &mouset)
|
||||
call <SID>AddOption("ttymouse", gettext("\"xterm\", \"xterm2\", \"dec\" or \"netterm\"; type of mouse"))
|
||||
call <SID>AddOption("ttymouse", gettext("\"xterm\", \"xterm2\", \"sgr\", etc.; type of mouse"))
|
||||
call <SID>OptionG("ttym", &ttym)
|
||||
if has("mouseshape")
|
||||
call <SID>AddOption("mouseshape", gettext("what the mouse pointer looks like in different modes"))
|
||||
@@ -689,10 +689,6 @@ if has("gui")
|
||||
call append("$", " \tset bexpr=" . &bexpr)
|
||||
endif
|
||||
endif
|
||||
if exists("+macatsui")
|
||||
call <SID>AddOption("macatsui", gettext("use ATSUI text drawing; disable to avoid display problems"))
|
||||
call <SID>OptionG("macatsui", &macatsui)
|
||||
endif
|
||||
endif
|
||||
|
||||
if has("printer")
|
||||
@@ -791,7 +787,7 @@ call <SID>BinOptionL("mod")
|
||||
call <SID>AddOption("readonly", gettext("buffer is not to be written"))
|
||||
call append("$", "\t" .. s:local_to_buffer)
|
||||
call <SID>BinOptionL("ro")
|
||||
call <SID>AddOption("modifiable", gettext("changes to the text are not possible"))
|
||||
call <SID>AddOption("modifiable", gettext("changes to the text are possible"))
|
||||
call append("$", "\t" .. s:local_to_buffer)
|
||||
call <SID>BinOptionL("ma")
|
||||
call <SID>AddOption("textwidth", gettext("line length above which to break a line"))
|
||||
@@ -852,7 +848,7 @@ if has("digraphs")
|
||||
endif
|
||||
call <SID>AddOption("tildeop", gettext("the \"~\" command behaves like an operator"))
|
||||
call <SID>BinOptionG("top", &top)
|
||||
call <SID>AddOption("operatorfunc", gettext("function called for the\"g@\" operator"))
|
||||
call <SID>AddOption("operatorfunc", gettext("function called for the \"g@\" operator"))
|
||||
call <SID>OptionG("opfunc", &opfunc)
|
||||
call <SID>AddOption("showmatch", gettext("when inserting a bracket, briefly jump to its match"))
|
||||
call <SID>BinOptionG("sm", &sm)
|
||||
@@ -863,7 +859,7 @@ call append("$", "\t" .. s:local_to_buffer)
|
||||
call <SID>OptionL("mps")
|
||||
call <SID>AddOption("joinspaces", gettext("use two spaces after '.' when joining a line"))
|
||||
call <SID>BinOptionG("js", &js)
|
||||
call <SID>AddOption("nrformats", gettext("\"alpha\", \"octal\" and/or \"hex\"; number formats recognized for\nCTRL-A and CTRL-X commands"))
|
||||
call <SID>AddOption("nrformats", gettext("\"alpha\", \"octal\", \"hex\", \"bin\" and/or \"unsigned\"; number formats\nrecognized for CTRL-A and CTRL-X commands"))
|
||||
call append("$", "\t" .. s:local_to_buffer)
|
||||
call <SID>OptionL("nf")
|
||||
|
||||
@@ -938,7 +934,7 @@ endif
|
||||
|
||||
if has("folding")
|
||||
call <SID>Header(gettext("folding"))
|
||||
call <SID>AddOption("foldenable", gettext("set to display all folds open"))
|
||||
call <SID>AddOption("foldenable", gettext("unset to display all folds open"))
|
||||
call append("$", "\t" .. s:local_to_window)
|
||||
call <SID>BinOptionL("fen")
|
||||
call <SID>AddOption("foldlevel", gettext("folds with a level higher than this number will be closed"))
|
||||
@@ -961,7 +957,7 @@ if has("folding")
|
||||
call <SID>OptionL("fml")
|
||||
call <SID>AddOption("commentstring", gettext("template for comments; used to put the marker in"))
|
||||
call <SID>OptionL("cms")
|
||||
call <SID>AddOption("foldmethod", gettext("folding type: \"manual\", \"indent\", \"expr\", \"marker\" or \"syntax\""))
|
||||
call <SID>AddOption("foldmethod", gettext("folding type: \"manual\", \"indent\", \"expr\", \"marker\",\n\"syntax\" or \"diff\""))
|
||||
call append("$", "\t" .. s:local_to_window)
|
||||
call <SID>OptionL("fdm")
|
||||
call <SID>AddOption("foldexpr", gettext("expression used when 'foldmethod' is \"expr\""))
|
||||
@@ -1069,7 +1065,7 @@ call <SID>BinOptionG("fs", &fs)
|
||||
call <SID>AddOption("shortname", gettext("use 8.3 file names"))
|
||||
call append("$", "\t" .. s:local_to_buffer)
|
||||
call <SID>BinOptionL("sn")
|
||||
call <SID>AddOption("cryptmethod", gettext("encryption method for file writing: zip or blowfish"))
|
||||
call <SID>AddOption("cryptmethod", gettext("encryption method for file writing: zip, blowfish or blowfish2"))
|
||||
call append("$", "\t" .. s:local_to_buffer)
|
||||
call <SID>OptionL("cm")
|
||||
|
||||
@@ -1093,7 +1089,7 @@ call append("$", " \tset mmt=" . &mmt)
|
||||
|
||||
|
||||
call <SID>Header(gettext("command line editing"))
|
||||
call <SID>AddOption("history", gettext("how many command lines are remembered "))
|
||||
call <SID>AddOption("history", gettext("how many command lines are remembered"))
|
||||
call append("$", " \tset hi=" . &hi)
|
||||
call <SID>AddOption("wildchar", gettext("key that triggers command-line expansion"))
|
||||
call append("$", " \tset wc=" . &wc)
|
||||
@@ -1187,19 +1183,12 @@ if has("quickfix")
|
||||
endif
|
||||
|
||||
|
||||
if has("win32") || has("osfiletype")
|
||||
if has("win32")
|
||||
call <SID>Header(gettext("system specific"))
|
||||
if has("osfiletype")
|
||||
call <SID>AddOption("osfiletype", gettext("OS-specific information about the type of file"))
|
||||
call append("$", "\t" .. s:local_to_buffer)
|
||||
call <SID>OptionL("oft")
|
||||
endif
|
||||
if has("win32")
|
||||
call <SID>AddOption("shellslash", gettext("use forward slashes in file names; for Unix-like shells"))
|
||||
call <SID>BinOptionG("ssl", &ssl)
|
||||
call <SID>AddOption("completeslash", gettext("specifies slash/backslash used for completion"))
|
||||
call <SID>OptionG("csl", &csl)
|
||||
endif
|
||||
call <SID>AddOption("shellslash", gettext("use forward slashes in file names; for Unix-like shells"))
|
||||
call <SID>BinOptionG("ssl", &ssl)
|
||||
call <SID>AddOption("completeslash", gettext("specifies slash/backslash used for completion"))
|
||||
call <SID>OptionG("csl", &csl)
|
||||
endif
|
||||
|
||||
|
||||
@@ -1236,12 +1225,6 @@ if has("rightleft")
|
||||
call <SID>AddOption("hkmapp", gettext("use phonetic Hebrew keyboard mapping"))
|
||||
call <SID>BinOptionG("hkp", &hkp)
|
||||
endif
|
||||
if has("farsi")
|
||||
call <SID>AddOption("altkeymap", gettext("use Farsi as the second language when 'revins' is set"))
|
||||
call <SID>BinOptionG("akm", &akm)
|
||||
call <SID>AddOption("fkmap", gettext("use Farsi keyboard mapping"))
|
||||
call <SID>BinOptionG("fk", &fk)
|
||||
endif
|
||||
if has("arabic")
|
||||
call <SID>AddOption("arabic", gettext("prepare for editing Arabic text"))
|
||||
call append("$", "\t" .. s:local_to_window)
|
||||
@@ -1284,7 +1267,7 @@ endif
|
||||
|
||||
|
||||
call <SID>Header(gettext("multi-byte characters"))
|
||||
call <SID>AddOption("encoding", gettext("character encoding used in Vim: \"latin1\", \"utf-8\"\n\"euc-jp\", \"big5\", etc."))
|
||||
call <SID>AddOption("encoding", gettext("character encoding used in Vim: \"latin1\", \"utf-8\",\n\"euc-jp\", \"big5\", etc."))
|
||||
call <SID>OptionG("enc", &enc)
|
||||
call <SID>AddOption("fileencoding", gettext("character encoding for the current file"))
|
||||
call append("$", "\t" .. s:local_to_buffer)
|
||||
@@ -1310,7 +1293,7 @@ call <SID>BinOptionG("emo", &emo)
|
||||
|
||||
|
||||
call <SID>Header(gettext("various"))
|
||||
call <SID>AddOption("virtualedit", gettext("when to use virtual editing: \"block\", \"insert\" and/or \"all\""))
|
||||
call <SID>AddOption("virtualedit", gettext("when to use virtual editing: \"block\", \"insert\", \"all\"\nand/or \"onemore\""))
|
||||
call <SID>OptionG("ve", &ve)
|
||||
call <SID>AddOption("eventignore", gettext("list of autocommand events which are to be ignored"))
|
||||
call <SID>OptionG("ei", &ei)
|
||||
@@ -1350,7 +1333,7 @@ if has("quickfix")
|
||||
call <SID>AddOption("bufhidden", gettext("what happens with a buffer when it's no longer in a window"))
|
||||
call append("$", "\t" .. s:local_to_buffer)
|
||||
call <SID>OptionL("bh")
|
||||
call <SID>AddOption("buftype", gettext("\"\", \"nofile\", \"nowrite\" or \"quickfix\": type of buffer"))
|
||||
call <SID>AddOption("buftype", gettext("empty, \"nofile\", \"nowrite\", \"quickfix\", etc.: type of buffer"))
|
||||
call append("$", "\t" .. s:local_to_buffer)
|
||||
call <SID>OptionL("bt")
|
||||
endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"
|
||||
" Author: Bram Moolenaar
|
||||
" Copyright: Vim license applies, see ":help license"
|
||||
" Last Change: 2020 Aug 31
|
||||
" Last Change: 2020 Oct 28
|
||||
"
|
||||
" WORK IN PROGRESS - Only the basics work
|
||||
" Note: On MS-Windows you need a recent version of gdb. The one included with
|
||||
@@ -119,7 +119,11 @@ func s:StartDebug_internal(dict)
|
||||
" call ch_logfile('debuglog', 'w')
|
||||
|
||||
let s:sourcewin = win_getid(winnr())
|
||||
let s:startsigncolumn = &signcolumn
|
||||
|
||||
" Remember the old value of 'signcolumn' for each buffer that it's set in, so
|
||||
" that we can restore the value for all buffers.
|
||||
let b:save_signcolumn = &signcolumn
|
||||
let s:signcolumn_buflist = [bufnr()]
|
||||
|
||||
let s:save_columns = 0
|
||||
let s:allleft = 0
|
||||
@@ -556,8 +560,20 @@ func s:EndDebugCommon()
|
||||
exe 'bwipe! ' . s:ptybuf
|
||||
endif
|
||||
|
||||
" Restore 'signcolumn' in all buffers for which it was set.
|
||||
call win_gotoid(s:sourcewin)
|
||||
let &signcolumn = s:startsigncolumn
|
||||
let was_buf = bufnr()
|
||||
for bufnr in s:signcolumn_buflist
|
||||
if bufexists(bufnr)
|
||||
exe bufnr .. "buf"
|
||||
if exists('b:save_signcolumn')
|
||||
let &signcolumn = b:save_signcolumn
|
||||
unlet b:save_signcolumn
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
exe was_buf .. "buf"
|
||||
|
||||
call s:DeleteCommands()
|
||||
|
||||
call win_gotoid(curwinid)
|
||||
@@ -938,6 +954,10 @@ func s:HandleCursor(msg)
|
||||
exe lnum
|
||||
exe 'sign unplace ' . s:pc_id
|
||||
exe 'sign place ' . s:pc_id . ' line=' . lnum . ' name=debugPC priority=110 file=' . fname
|
||||
if !exists('b:save_signcolumn')
|
||||
let b:save_signcolumn = &signcolumn
|
||||
call add(s:signcolumn_buflist, bufnr())
|
||||
endif
|
||||
setlocal signcolumn=yes
|
||||
endif
|
||||
elseif !s:stopped || fname != ''
|
||||
@@ -1014,7 +1034,7 @@ endfunc
|
||||
|
||||
func s:PlaceSign(id, subid, entry)
|
||||
let nr = printf('%d.%d', a:id, a:subid)
|
||||
exe 'sign place ' . s:Breakpoint2SignNumber(a:id, a:subid) . ' line=' . a:entry['lnum'] . ' name=debugBreakpoint' . nr . ' file=' . a:entry['fname']
|
||||
exe 'sign place ' . s:Breakpoint2SignNumber(a:id, a:subid) . ' line=' . a:entry['lnum'] . ' name=debugBreakpoint' . nr . ' priority=110 file=' . a:entry['fname']
|
||||
let a:entry['placed'] = 1
|
||||
endfunc
|
||||
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
if &cp || exists("g:loaded_zipPlugin")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_zipPlugin = "v30"
|
||||
let g:loaded_zipPlugin = "v31"
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Options: {{{1
|
||||
if !exists("g:zipPlugin_ext")
|
||||
let g:zipPlugin_ext='*.apk,*.celzip,*.crtx,*.docm,*.docx,*.dotm,*.dotx,*.ear,*.epub,*.gcsx,*.glox,*.gqsx,*.ja,*.jar,*.kmz,*.odb,*.odc,*.odf,*.odg,*.odi,*.odm,*.odp,*.ods,*.odt,*.otc,*.otf,*.otg,*.oth,*.oti,*.otp,*.ots,*.ott,*.oxt,*.potm,*.potx,*.ppam,*.ppsm,*.ppsx,*.pptm,*.pptx,*.sldx,*.thmx,*.vdw,*.war,*.wsz,*.xap,*.xlam,*.xlam,*.xlsb,*.xlsm,*.xlsx,*.xltm,*.xltx,*.xpi,*.zip'
|
||||
let g:zipPlugin_ext='*.aar,*.apk,*.celzip,*.crtx,*.docm,*.docx,*.dotm,*.dotx,*.ear,*.epub,*.gcsx,*.glox,*.gqsx,*.ja,*.jar,*.kmz,*.odb,*.odc,*.odf,*.odg,*.odi,*.odm,*.odp,*.ods,*.odt,*.otc,*.otf,*.otg,*.oth,*.oti,*.otp,*.ots,*.ott,*.oxt,*.potm,*.potx,*.ppam,*.ppsm,*.ppsx,*.pptm,*.pptx,*.sldx,*.thmx,*.vdw,*.war,*.wsz,*.xap,*.xlam,*.xlam,*.xlsb,*.xlsm,*.xlsx,*.xltm,*.xltx,*.xpi,*.zip'
|
||||
endif
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
|
||||
@@ -404,6 +404,7 @@ an 50.90.120 &Syntax.PQ.Pam\ config :cal SetSyn("pamconf")<CR>
|
||||
an 50.90.130 &Syntax.PQ.PApp :cal SetSyn("papp")<CR>
|
||||
an 50.90.140 &Syntax.PQ.Pascal :cal SetSyn("pascal")<CR>
|
||||
an 50.90.150 &Syntax.PQ.Password\ file :cal SetSyn("passwd")<CR>
|
||||
an 50.90.490 &Syntax.PQ.Pbtxt :cal SetSyn("pbtxt")<CR>
|
||||
an 50.90.160 &Syntax.PQ.PCCTS :cal SetSyn("pccts")<CR>
|
||||
an 50.90.170 &Syntax.PQ.PDF :cal SetSyn("pdf")<CR>
|
||||
an 50.90.180 &Syntax.PQ.Perl.Perl :cal SetSyn("perl")<CR>
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
" Vim syntax file
|
||||
" Language: GNU Assembler
|
||||
" Maintainer: Erik Wognsen <erik.wognsen@gmail.com>
|
||||
" Previous maintainer:
|
||||
" Kevin Dahlhausen <kdahlhaus@yahoo.com>
|
||||
" Last Change: 2014 Feb 04
|
||||
|
||||
" Thanks to Ori Avtalion for feedback on the comment markers!
|
||||
" Language: GNU Assembler
|
||||
" Maintainer: Doug Kearns dougkearns@gmail.com
|
||||
" Previous Maintainers: Erik Wognsen <erik.wognsen@gmail.com>
|
||||
" Kevin Dahlhausen <kdahlhaus@yahoo.com>
|
||||
" Contributors: Ori Avtalion, Lakshay Garg
|
||||
" Last Change: 2020 Oct 31
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -34,29 +33,49 @@ syn match asmType "\.space"
|
||||
syn match asmType "\.string"
|
||||
syn match asmType "\.word"
|
||||
|
||||
syn match asmLabel "[a-z_][a-z0-9_]*:"he=e-1
|
||||
syn match asmIdentifier "[a-z_][a-z0-9_]*"
|
||||
syn match asmLabel "[a-z_][a-z0-9_]*:"he=e-1
|
||||
|
||||
" Various #'s as defined by GAS ref manual sec 3.6.2.1
|
||||
" Technically, the first decNumber def is actually octal,
|
||||
" Technically, the first asmDecimal def is actually octal,
|
||||
" since the value of 0-7 octal is the same as 0-7 decimal,
|
||||
" I (Kevin) prefer to map it as decimal:
|
||||
syn match decNumber "0\+[1-7]\=[\t\n$,; ]"
|
||||
syn match decNumber "[1-9]\d*"
|
||||
syn match octNumber "0[0-7][0-7]\+"
|
||||
syn match hexNumber "0[xX][0-9a-fA-F]\+"
|
||||
syn match binNumber "0[bB][0-1]*"
|
||||
syn match asmDecimal "\<0\+[1-7]\=\>" display
|
||||
syn match asmDecimal "\<[1-9]\d*\>" display
|
||||
syn match asmOctal "\<0[0-7][0-7]\+\>" display
|
||||
syn match asmHexadecimal "\<0[xX][0-9a-fA-F]\+\>" display
|
||||
syn match asmBinary "\<0[bB][0-1]\+\>" display
|
||||
|
||||
syn keyword asmTodo contained TODO
|
||||
syn match asmFloat "\<\d\+\.\d*\%(e[+-]\=\d\+\)\=\>" display
|
||||
syn match asmFloat "\.\d\+\%(e[+-]\=\d\+\)\=\>" display
|
||||
syn match asmFloat "\<\d\%(e[+-]\=\d\+\)\>" display
|
||||
syn match asmFloat "[+-]\=Inf\>\|\<NaN\>" display
|
||||
|
||||
syn match asmFloat "\%(0[edfghprs]\)[+-]\=\d*\%(\.\d\+\)\%(e[+-]\=\d\+\)\=" display
|
||||
syn match asmFloat "\%(0[edfghprs]\)[+-]\=\d\+\%(\.\d\+\)\=\%(e[+-]\=\d\+\)\=" display
|
||||
" Avoid fighting the hexadecimal match for unicorn-like '0x' prefixed floats
|
||||
syn match asmFloat "\%(0x\)[+-]\=\d*\%(\.\d\+\)\%(e[+-]\=\d\+\)\=" display
|
||||
|
||||
" Allow all characters to be escaped (and in strings) as these vary across
|
||||
" architectures [See sec 3.6.1.1 Strings]
|
||||
syn match asmCharacterEscape "\\." contained
|
||||
syn match asmCharacter "'\\\=." contains=asmCharacterEscape
|
||||
|
||||
syn match asmStringEscape "\\\_." contained
|
||||
syn match asmStringEscape "\\\%(\o\{3}\|00[89]\)" contained display
|
||||
syn match asmStringEscape "\\x\x\+" contained display
|
||||
|
||||
syn region asmString start="\"" end="\"" skip="\\\\\|\\\"" contains=asmStringEscape
|
||||
|
||||
syn keyword asmTodo contained TODO FIXME XXX NOTE
|
||||
|
||||
" GAS supports one type of multi line comments:
|
||||
syn region asmComment start="/\*" end="\*/" contains=asmTodo
|
||||
syn region asmComment start="/\*" end="\*/" contains=asmTodo,@Spell
|
||||
|
||||
" GAS (undocumentedly?) supports C++ style comments. Unlike in C/C++ however,
|
||||
" a backslash ending a C++ style comment does not extend the comment to the
|
||||
" next line (hence the syntax region does not define 'skip="\\$"')
|
||||
syn region asmComment start="//" end="$" keepend contains=asmTodo
|
||||
syn region asmComment start="//" end="$" keepend contains=asmTodo,@Spell
|
||||
|
||||
" Line comment characters depend on the target architecture and command line
|
||||
" options and some comments may double as logical line number directives or
|
||||
@@ -69,7 +88,7 @@ syn region asmComment start="//" end="$" keepend contains=asmTodo
|
||||
" frequently used features of the most popular architectures (and also the
|
||||
" non-GNU assembly languages that use this syntax file because their asm files
|
||||
" are also named *.asm), the following are used as line comment characters:
|
||||
syn match asmComment "[#;!|].*" contains=asmTodo
|
||||
syn match asmComment "[#;!|].*" contains=asmTodo,@Spell
|
||||
|
||||
" Side effects of this include:
|
||||
" - When `;' is used to separate statements on the same line (many targets
|
||||
@@ -96,35 +115,50 @@ syn match asmMacro "\.endm"
|
||||
" with '.', including the GCC auto-generated '.L' labels.
|
||||
syn match asmDirective "\.[A-Za-z][0-9A-Za-z-_]*"
|
||||
|
||||
|
||||
syn case match
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
" The default methods for highlighting. Can be overridden later
|
||||
hi def link asmSection Special
|
||||
hi def link asmLabel Label
|
||||
hi def link asmComment Comment
|
||||
hi def link asmTodo Todo
|
||||
hi def link asmSection Special
|
||||
hi def link asmLabel Label
|
||||
hi def link asmComment Comment
|
||||
hi def link asmTodo Todo
|
||||
hi def link asmDirective Statement
|
||||
|
||||
hi def link asmInclude Include
|
||||
hi def link asmCond PreCondit
|
||||
hi def link asmMacro Macro
|
||||
hi def link asmInclude Include
|
||||
hi def link asmCond PreCondit
|
||||
hi def link asmMacro Macro
|
||||
|
||||
hi def link hexNumber Number
|
||||
hi def link decNumber Number
|
||||
hi def link octNumber Number
|
||||
hi def link binNumber Number
|
||||
if exists('g:asm_legacy_syntax_groups')
|
||||
hi def link hexNumber Number
|
||||
hi def link decNumber Number
|
||||
hi def link octNumber Number
|
||||
hi def link binNumber Number
|
||||
hi def link asmHexadecimal hexNumber
|
||||
hi def link asmDecimal decNumber
|
||||
hi def link asmOctal octNumber
|
||||
hi def link asmBinary binNumber
|
||||
else
|
||||
hi def link asmHexadecimal Number
|
||||
hi def link asmDecimal Number
|
||||
hi def link asmOctal Number
|
||||
hi def link asmBinary Number
|
||||
endif
|
||||
hi def link asmFloat Float
|
||||
|
||||
hi def link asmString String
|
||||
hi def link asmStringEscape Special
|
||||
hi def link asmCharacter Character
|
||||
hi def link asmCharacterEscape Special
|
||||
|
||||
hi def link asmIdentifier Identifier
|
||||
hi def link asmType Type
|
||||
|
||||
hi def link asmType Type
|
||||
|
||||
let b:current_syntax = "asm"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: ts=8
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
" Vim syntax file
|
||||
" Language: Hitachi H-8300h specific syntax for GNU Assembler
|
||||
" Maintainer: Kevin Dahlhausen <kdahlhaus@yahoo.com>
|
||||
" Last Change: 2002 Sep 19
|
||||
" Language: Hitachi H-8300h specific syntax for GNU Assembler
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Kevin Dahlhausen <kdahlhaus@yahoo.com>
|
||||
" Last Change: 2020 Oct 31
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
runtime! syntax/asm.vim
|
||||
|
||||
syn case ignore
|
||||
|
||||
syn match asmDirective "\.h8300[h]*"
|
||||
syn match asmDirective "\.h8300[hs]n\="
|
||||
|
||||
"h8300[h] registers
|
||||
syn match asmReg "e\=r[0-7][lh]\="
|
||||
syn match asmRegister "e\=r\o[lh]\="
|
||||
|
||||
"h8300[h] opcodes - order is important!
|
||||
syn match asmOpcode "add\.[lbw]"
|
||||
@@ -37,32 +39,20 @@ syn match asmOpcode "sha[lr]\.[lbw]"
|
||||
syn match asmOpcode "shl[lr]\.[lbw]"
|
||||
syn match asmOpcode "sub\.[lbw]"
|
||||
syn match asmOpcode "xor\.[lbw]"
|
||||
syn keyword asmOpcode "andc" "band" "bcc" "bclr" "bcs" "beq" "bf" "bge" "bgt"
|
||||
syn keyword asmOpcode "bhi" "bhs" "biand" "bild" "bior" "bist" "bixor" "bmi"
|
||||
syn keyword asmOpcode "bne" "bnot" "bnp" "bor" "bpl" "bpt" "bra" "brn" "bset"
|
||||
syn keyword asmOpcode "bsr" "btst" "bst" "bt" "bvc" "bvs" "bxor" "cmp" "daa"
|
||||
syn keyword asmOpcode "das" "eepmov" "eepmovw" "inc" "jmp" "jsr" "ldc" "movfpe"
|
||||
syn keyword asmOpcode "movtpe" "mov" "nop" "orc" "rte" "rts" "sleep" "stc"
|
||||
syn keyword asmOpcode "sub" "trapa" "xorc"
|
||||
|
||||
syn keyword asmOpcode andc band bcc bclr bcs beq bf bge bgt
|
||||
syn keyword asmOpcode bhi bhs biand bild bior bist bixor bmi
|
||||
syn keyword asmOpcode bne bnot bnp bor bpl bpt bra brn bset
|
||||
syn keyword asmOpcode bsr btst bst bt bvc bvs bxor cmp daa
|
||||
syn keyword asmOpcode das eepmov eepmovw inc jmp jsr ldc movfpe
|
||||
syn keyword asmOpcode movtpe mov nop orc rte rts sleep stc
|
||||
syn keyword asmOpcode sub trapa xorc
|
||||
|
||||
syn case match
|
||||
|
||||
|
||||
" Read the general asm syntax
|
||||
runtime! syntax/asm.vim
|
||||
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
hi def link asmOpcode Statement
|
||||
hi def link asmRegister Identifier
|
||||
|
||||
" My default-color overrides:
|
||||
"hi asmOpcode ctermfg=yellow
|
||||
"hi asmReg ctermfg=lightmagenta
|
||||
|
||||
hi def link asmOpcode Statement
|
||||
hi def link asmRegister Identifier
|
||||
|
||||
let b:current_syntax = "asmh8300"
|
||||
|
||||
" vim: ts=8
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: awk, nawk, gawk, mawk
|
||||
" Maintainer: Antonio Colombo <azc100@gmail.com>
|
||||
" Last Change: 2020 Aug 18
|
||||
" Language: awk, nawk, gawk, mawk
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Antonio Colombo <azc100@gmail.com>
|
||||
" Last Change: 2020 Aug 18
|
||||
|
||||
" AWK ref. is: Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger
|
||||
" The AWK Programming Language, Addison-Wesley, 1988
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Debian Vim Maintainers
|
||||
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
|
||||
" Wichert Akkerman <wakkerma@debian.org>
|
||||
" Last Change: 2020 Apr 27
|
||||
" Last Change: 2020 Oct 28
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debchangelog.vim
|
||||
|
||||
" Standard syntax initialization
|
||||
@@ -21,20 +21,20 @@ let s:cpo = &cpo
|
||||
set cpo-=C
|
||||
let s:supported = [
|
||||
\ 'oldstable', 'stable', 'testing', 'unstable', 'experimental',
|
||||
\ 'wheezy', 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm',
|
||||
\ 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm',
|
||||
\ 'sid', 'rc-buggy',
|
||||
\
|
||||
\ 'trusty', 'xenial', 'bionic', 'eoan', 'focal', 'groovy', 'devel'
|
||||
\ 'trusty', 'xenial', 'bionic', 'focal', 'groovy', 'hippo', 'devel'
|
||||
\ ]
|
||||
let s:unsupported = [
|
||||
\ 'frozen', 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
|
||||
\ 'woody', 'sarge', 'etch', 'lenny', 'squeeze',
|
||||
\ 'woody', 'sarge', 'etch', 'lenny', 'squeeze', 'wheezy',
|
||||
\
|
||||
\ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty',
|
||||
\ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
|
||||
\ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy',
|
||||
\ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic',
|
||||
\ 'disco'
|
||||
\ 'disco', 'eoan'
|
||||
\ ]
|
||||
let &cpo=s:cpo
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Debian Vim Maintainers
|
||||
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
|
||||
" Wichert Akkerman <wakkerma@debian.org>
|
||||
" Last Change: 2018 Aug 11
|
||||
" Last Change: 2020 Oct 26
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debcontrol.vim
|
||||
|
||||
" Standard syntax initialization
|
||||
@@ -47,22 +47,24 @@ exe 'syn keyword debcontrolArchitecture contained '. join(s:pairs)
|
||||
|
||||
unlet s:kernels s:archs s:pairs
|
||||
|
||||
" Keep in sync with https://metadata.ftp-master.org/sections.822
|
||||
" curl -q https://metadata.ftp-master.debian.org/sections.822 2>/dev/null| grep-dctrl -n --not -FSection -sSection / -
|
||||
let s:sections = [
|
||||
\ 'admin', 'cli-mono', 'comm', 'database', 'debian-installer', 'debug'
|
||||
\, 'devel', 'doc', 'editors', 'education', 'electronics', 'embedded'
|
||||
\, 'fonts', 'games', 'gnome', 'gnustep', 'gnu-r', 'golang', 'graphics'
|
||||
\, 'fonts', 'games', 'gnome', 'gnu-r', 'gnustep', 'golang', 'graphics'
|
||||
\, 'hamradio', 'haskell', 'httpd', 'interpreters', 'introspection'
|
||||
\, 'java\%(script\)\=', 'kde', 'kernel', 'libs', 'libdevel', 'lisp'
|
||||
\, 'localization', 'mail', 'math', 'metapackages', 'misc', 'net'
|
||||
\, 'news', 'ocaml', 'oldlibs', 'otherosfs', 'perl', 'php', 'python'
|
||||
\, 'ruby', 'rust', 'science', 'shells', 'sound', 'text', 'tex'
|
||||
\, 'java', 'javascript', 'kde', 'kernel', 'libdevel', 'libs', 'lisp'
|
||||
\, 'localization', 'mail', 'math', 'metapackages', 'misc', 'net', 'news'
|
||||
\, 'ocaml', 'oldlibs', 'otherosfs', 'perl', 'php', 'python', 'raku'
|
||||
\, 'ruby', 'rust', 'science', 'shells', 'sound', 'tasks', 'tex', 'text'
|
||||
\, 'utils', 'vcs', 'video', 'web', 'x11', 'xfce', 'zope'
|
||||
\ ]
|
||||
|
||||
syn keyword debcontrolMultiArch contained no foreign allowed same
|
||||
syn match debcontrolName contained "[a-z0-9][a-z0-9+.-]\+"
|
||||
syn keyword debcontrolPriority contained extra important optional required standard
|
||||
exe 'syn match debcontrolSection contained "\%(\%(contrib\|non-free\|non-US/main\|non-US/contrib\|non-US/non-free\|restricted\|universe\|multiverse\)/\)\=\%('.join(s:sections, '\|').'\)"'
|
||||
exe 'syn match debcontrolSection contained "\%(\%(contrib\|non-free\|non-US/main\|non-US/contrib\|non-US/non-free\|restricted\|universe\|multiverse\)/\)\=\<\%('.join(s:sections, '\|').'\)\>"'
|
||||
syn keyword debcontrolPackageType contained udeb deb
|
||||
syn match debcontrolVariable contained "\${.\{-}}"
|
||||
syn keyword debcontrolDmUpload contained yes
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: Debian sources.list
|
||||
" Maintainer: Debian Vim Maintainers
|
||||
" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
|
||||
" Last Change: 2020 Apr 27
|
||||
" Last Change: 2020 Oct 26
|
||||
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debsources.vim
|
||||
|
||||
" Standard syntax initialization
|
||||
@@ -23,20 +23,20 @@ let s:cpo = &cpo
|
||||
set cpo-=C
|
||||
let s:supported = [
|
||||
\ 'oldstable', 'stable', 'testing', 'unstable', 'experimental',
|
||||
\ 'wheezy', 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm',
|
||||
\ 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm',
|
||||
\ 'sid', 'rc-buggy',
|
||||
\
|
||||
\ 'trusty', 'xenial', 'bionic', 'eoan', 'focal', 'groovy', 'devel'
|
||||
\ 'trusty', 'xenial', 'bionic', 'focal', 'groovy', 'hippo', 'devel'
|
||||
\ ]
|
||||
let s:unsupported = [
|
||||
\ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
|
||||
\ 'woody', 'sarge', 'etch', 'lenny', 'squeeze',
|
||||
\ 'woody', 'sarge', 'etch', 'lenny', 'squeeze', 'wheezy',
|
||||
\
|
||||
\ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty',
|
||||
\ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
|
||||
\ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy',
|
||||
\ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic',
|
||||
\ 'disco'
|
||||
\ 'disco', 'eoan'
|
||||
\ ]
|
||||
let &cpo=s:cpo
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim syntax file
|
||||
" Language: ELF
|
||||
" Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
|
||||
" Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
|
||||
" Last Change: Son 22 Jun 2003 20:43:14 CEST
|
||||
" Filenames: *.ab,*.am
|
||||
" URL: http://www.cvjb.de/comp/vim/elf.vim
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: FORTH
|
||||
" Current Maintainer: Johan Kotlinski <kotlinski@gmail.com>
|
||||
" Previous Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
|
||||
" Previous Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
|
||||
" Last Change: 2018-03-29
|
||||
" Filenames: *.fs,*.ft
|
||||
" URL: https://github.com/jkotlinski/forth.vim
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
" older Fortran 77 syntax file by Mario Eusebio and Preben Guldberg.
|
||||
" Since then, useful suggestions and contributions have been made, in order, by:
|
||||
" Andrej Panjkov, Bram Moolenaar, Thomas Olsen, Michael Sternberg, Christian Reile,
|
||||
" Walter Dieudonné, Alexander Wagner, Roman Bertle, Charles Rendleman,
|
||||
" Walter Dieudonné, Alexander Wagner, Roman Bertle, Charles Rendleman,
|
||||
" Andrew Griffiths, Joe Krahn, Hendrik Merx, Matt Thompson, Jan Hermann,
|
||||
" Stefano Zaghi, Vishnu V. Krishnan, Judicaël Grasset, Takuma Yoshida,
|
||||
" Eisuke Kawashima, and André Chalella.`
|
||||
" Stefano Zaghi, Vishnu V. Krishnan, Judicaël Grasset, Takuma Yoshida,
|
||||
" Eisuke Kawashima, and André Chalella.`
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" VIM syntax file
|
||||
" Language: groff
|
||||
" Maintainer: Alejandro López-Valencia <dradul@yahoo.com>
|
||||
" Maintainer: Alejandro López-Valencia <dradul@yahoo.com>
|
||||
" URL: http://dradul.tripod.com/vim
|
||||
" Last Change: 2003-05-08-12:41:13 GMT-5.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim syntax file
|
||||
" Language: initng .i files
|
||||
" Maintainer: Elan Ruusamäe <glen@pld-linux.org>
|
||||
" Maintainer: Elan Ruusamäe <glen@pld-linux.org>
|
||||
" URL: http://glen.alkohol.ee/pld/initng/
|
||||
" License: GPL v2
|
||||
" Version: 0.13
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: Inno Setup File (iss file) and My InnoSetup extension
|
||||
" Maintainer: Jason Mills (jmills@cs.mun.ca)
|
||||
" Previous Maintainer: Dominique Stéphan (dominique@mggen.com)
|
||||
" Previous Maintainer: Dominique Stéphan (dominique@mggen.com)
|
||||
" Last Change: 2019 Sep 27
|
||||
"
|
||||
" Todo:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim syntax file
|
||||
" Language: Lout
|
||||
" Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
|
||||
" Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
|
||||
" Last Change: So 12 Feb 2012 15:15:03 CET
|
||||
" Filenames: *.lout,*.lt
|
||||
" URL: http://www.cvjb.de/comp/vim/lout.vim
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim syntax file
|
||||
" Language: MMIX
|
||||
" Maintainer: Dirk Hüsken, <huesken@informatik.uni-tuebingen.de>
|
||||
" Maintainer: Dirk Hüsken, <huesken@informatik.uni-tuebingen.de>
|
||||
" Last Change: 2012 Jun 01
|
||||
" (Dominique Pelle added @Spell)
|
||||
" Filenames: *.mms
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: MOO
|
||||
" Maintainer: Timo Frenay <timo@frenay.net>
|
||||
" Last Change: 2001 Oct 06
|
||||
" Last Change: 2020 Oct 19
|
||||
" Note: Requires Vim 6.0 or above
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
@@ -95,7 +95,7 @@ if exists("moo_unknown_builtin_functions")
|
||||
syn keyword mooKnownBuiltinFunction abs acos add_property add_verb asin atan binary_hash boot_player buffered_output_length callers caller_perms call_function ceil children chparent clear_property connected_players connected_seconds connection_name connection_option connection_options cos cosh create crypt ctime db_disk_size decode_binary delete_property delete_verb disassemble dump_database encode_binary equal eval exp floatstr floor flush_input force_input function_info idle_seconds index is_clear_property is_member is_player kill_task length listappend listdelete listen listeners listinsert listset log log10 match max max_object memory_usage min move notify object_bytes open_network_connection output_delimiters parent pass players properties property_info queued_tasks queue_info raise random read recycle renumber reset_max_object resume rindex rmatch seconds_left server_log server_version setadd setremove set_connection_option set_player_flag set_property_info set_task_perms set_verb_args set_verb_code set_verb_info shutdown sin sinh sqrt strcmp string_hash strsub substitute suspend tan tanh task_id task_stack ticks_left time tofloat toint toliteral tonum toobj tostr trunc typeof unlisten valid value_bytes value_hash verbs verb_args verb_code verb_info contained
|
||||
endif
|
||||
|
||||
" Enclosed expressions
|
||||
" Enclosed expressions
|
||||
syn match mooUnenclosedError display ~[')\]|}]~
|
||||
syn match mooParenthesesError display ~[';\]|}]~ contained
|
||||
syn region mooParentheses start=~(~ end=~)~ transparent contains=@mooEnclosedContents,mooParenthesesError
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" VIM syntax file
|
||||
" Language: nroff/groff
|
||||
" Maintainer: Pedro Alejandro López-Valencia <palopezv@gmail.com>
|
||||
" Maintainer: Pedro Alejandro López-Valencia <palopezv@gmail.com>
|
||||
" URL: http://vorbote.wordpress.com/
|
||||
" Last Change: 2012 Feb 2
|
||||
"
|
||||
@@ -8,7 +8,7 @@
|
||||
"
|
||||
" ACKNOWLEDGEMENTS:
|
||||
"
|
||||
" My thanks to Jérôme Plût <Jerome.Plut@ens.fr>, who was the
|
||||
" My thanks to Jérôme Plût <Jerome.Plut@ens.fr>, who was the
|
||||
" creator and maintainer of this syntax file for several years.
|
||||
" May I be as good at it as he has been.
|
||||
"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: Pascal
|
||||
" Version: 2.8
|
||||
" Last Change: 2004/10/17 17:47:30
|
||||
" Maintainer: Xavier Crégut <xavier.cregut@enseeiht.fr>
|
||||
" Maintainer: Xavier Crégut <xavier.cregut@enseeiht.fr>
|
||||
" Previous Maintainer: Mario Eusebio <bio@dq.fct.unl.pt>
|
||||
|
||||
" Contributors: Tim Chase <tchase@csc.com>,
|
||||
|
||||
44
runtime/syntax/pbtxt.vim
Normal file
44
runtime/syntax/pbtxt.vim
Normal file
@@ -0,0 +1,44 @@
|
||||
" Vim syntax file
|
||||
" Language: Protobuf Text Format
|
||||
" Maintainer: Lakshay Garg <lakshayg@outlook.in>
|
||||
" Last Change: 2020 Nov 17
|
||||
" Homepage: https://github.com/lakshayg/vim-pbtxt
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn case ignore
|
||||
|
||||
syn keyword pbtxtTodo TODO FIXME contained
|
||||
syn keyword pbtxtBool true false contained
|
||||
|
||||
syn match pbtxtInt display "\<\(0\|[1-9]\d*\)\>"
|
||||
syn match pbtxtHex display "\<0[xX]\x\+\>"
|
||||
syn match pbtxtFloat display "\(0\|[1-9]\d*\)\=\.\d*"
|
||||
syn match pbtxtMessage display "^\s*\w\+\s*{"me=e-1
|
||||
syn match pbtxtField display "^\s*\w\+:"me=e-1
|
||||
syn match pbtxtEnum display ":\s*\a\w\+"ms=s+1 contains=pbtxtBool
|
||||
syn region pbtxtString start=+"+ skip=+\\"+ end=+"+ contains=@Spell
|
||||
syn region pbtxtComment start="#" end="$" keepend contains=pbtxtTodo,@Spell
|
||||
|
||||
hi def link pbtxtTodo Todo
|
||||
hi def link pbtxtBool Boolean
|
||||
hi def link pbtxtInt Number
|
||||
hi def link pbtxtHex Number
|
||||
hi def link pbtxtFloat Float
|
||||
hi def link pbtxtMessage Structure
|
||||
hi def link pbtxtField Identifier
|
||||
hi def link pbtxtEnum Define
|
||||
hi def link pbtxtString String
|
||||
hi def link pbtxtComment Comment
|
||||
|
||||
let b:current_syntax = "pbtxt"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet
|
||||
@@ -1,26 +1,36 @@
|
||||
" syntax file for Protocol Buffers - Google's data interchange format
|
||||
"
|
||||
" Protocol Buffers - Google's data interchange format
|
||||
" Copyright 2008 Google Inc. All rights reserved.
|
||||
" https://developers.google.com/protocol-buffers/
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to deal
|
||||
" in the Software without restriction, including without limitation the rights
|
||||
" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
" copies of the Software, and to permit persons to whom the Software is
|
||||
" furnished to do so, subject to the following conditions:
|
||||
" Redistribution and use in source and binary forms, with or without
|
||||
" modification, are permitted provided that the following conditions are
|
||||
" met:
|
||||
"
|
||||
" The above copyright notice and this permission notice shall be included in
|
||||
" all copies or substantial portions of the Software.
|
||||
" * Redistributions of source code must retain the above copyright
|
||||
" notice, this list of conditions and the following disclaimer.
|
||||
" * Redistributions in binary form must reproduce the above
|
||||
" copyright notice, this list of conditions and the following disclaimer
|
||||
" in the documentation and/or other materials provided with the
|
||||
" distribution.
|
||||
" * Neither the name of Google Inc. nor the names of its
|
||||
" contributors may be used to endorse or promote products derived from
|
||||
" this software without specific prior written permission.
|
||||
"
|
||||
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
" THE SOFTWARE.
|
||||
"
|
||||
" http://code.google.com/p/protobuf/
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
" This is the Vim syntax file for Google Protocol Buffers as found at
|
||||
" https://github.com/protocolbuffers/protobuf
|
||||
" Last update: 2020 Oct 29
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -33,10 +43,10 @@ syn keyword protoTodo contained TODO FIXME XXX
|
||||
syn cluster protoCommentGrp contains=protoTodo
|
||||
|
||||
syn keyword protoSyntax syntax import option
|
||||
syn keyword protoStructure package message group
|
||||
syn keyword protoStructure package message group oneof
|
||||
syn keyword protoRepeat optional required repeated
|
||||
syn keyword protoDefault default
|
||||
syn keyword protoExtend extend extensions to max
|
||||
syn keyword protoExtend extend extensions to max reserved
|
||||
syn keyword protoRPC service rpc returns
|
||||
|
||||
syn keyword protoType int32 int64 uint32 uint64 sint32 sint64
|
||||
@@ -48,10 +58,10 @@ syn keyword protoBool true false
|
||||
syn match protoInt /-\?\<\d\+\>/
|
||||
syn match protoInt /\<0[xX]\x+\>/
|
||||
syn match protoFloat /\<-\?\d*\(\.\d*\)\?/
|
||||
syn region protoComment start="\/\*" end="\*\/" contains=@protoCommentGrp
|
||||
syn region protoComment start="//" skip="\\$" end="$" keepend contains=@protoCommentGrp
|
||||
syn region protoString start=/"/ skip=/\\./ end=/"/
|
||||
syn region protoString start=/'/ skip=/\\./ end=/'/
|
||||
syn region protoComment start="\/\*" end="\*\/" contains=@pbCommentGrp,@Spell
|
||||
syn region protoComment start="//" skip="\\$" end="$" keepend contains=@pbCommentGrp,@Spell
|
||||
syn region protoString start=/"/ skip=/\\./ end=/"/ contains=@Spell
|
||||
syn region protoString start=/'/ skip=/\\./ end=/'/ contains=@Spell
|
||||
|
||||
hi def link protoTodo Todo
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: "Robots.txt" files
|
||||
" Robots.txt files indicate to WWW robots which parts of a web site should not be accessed.
|
||||
" Maintainer: Dominique Stéphan (dominique@mggen.com)
|
||||
" Maintainer: Dominique Stéphan (dominique@mggen.com)
|
||||
" URL: http://www.mggen.com/vim/syntax/robots.zip
|
||||
" Last change: 2001 May 09
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: RPL/2
|
||||
" Version: 0.15.15 against RPL/2 version 4.00pre7i
|
||||
" Last Change: 2012 Feb 03 by Thilo Six
|
||||
" Maintainer: Joël BERTRAND <rpl2@free.fr>
|
||||
" Maintainer: Joël BERTRAND <rpl2@free.fr>
|
||||
" URL: http://www.makalis.fr/~bertrand/rpl2/download/vim/indent/rpl.vim
|
||||
" Credits: Nothing
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
" .hlp (windows help files) use compiled rtf files
|
||||
" rtf documentation at http://night.primate.wisc.edu/software/RTF/
|
||||
"
|
||||
" Maintainer: Dominique Stéphan (dominique@mggen.com)
|
||||
" Maintainer: Dominique Stéphan (dominique@mggen.com)
|
||||
" URL: http://www.mggen.com/vim/syntax/rtf.zip
|
||||
" Last change: 2001 Mai 02
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" This file works only for Vim6.x
|
||||
" Language: Tilde
|
||||
" Maintainer: Tobias Rundström <tobi@tildesoftware.net>
|
||||
" Maintainer: Tobias Rundström <tobi@tildesoftware.net>
|
||||
" URL: http://www.tildesoftware.net
|
||||
" CVS: $Id: tilde.vim,v 1.1 2004/06/13 19:31:51 vimboss Exp $
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: TypeScript and TypeScriptReact
|
||||
" Maintainer: Bram Moolenaar, Herrington Darkholme
|
||||
" Last Change: 2019 Nov 30
|
||||
" Last Change: 2020 Oct 27
|
||||
" Based On: Herrington Darkholme's yats.vim
|
||||
" Changes: See https:github.com/HerringtonDarkholme/yats.vim
|
||||
" Credits: See yats.vim on github
|
||||
@@ -21,15 +21,14 @@ if main_syntax == 'typescript' || main_syntax == 'typescriptreact'
|
||||
setlocal iskeyword+=$
|
||||
" syntax cluster htmlJavaScript contains=TOP
|
||||
endif
|
||||
" For private field added from TypeScript 3.8
|
||||
setlocal iskeyword+=#
|
||||
|
||||
" lowest priority on least used feature
|
||||
syntax match typescriptLabel /[a-zA-Z_$]\k*:/he=e-1 contains=typescriptReserved nextgroup=@typescriptStatement skipwhite skipempty
|
||||
|
||||
" other keywords like return,case,yield uses containedin
|
||||
syntax region typescriptBlock matchgroup=typescriptBraces start=/{/ end=/}/ contains=@typescriptStatement,@typescriptComments fold
|
||||
|
||||
|
||||
"runtime syntax/basic/identifiers.vim
|
||||
syntax cluster afterIdentifier contains=
|
||||
\ typescriptDotNotation,
|
||||
\ typescriptFuncCallArg,
|
||||
@@ -60,7 +59,56 @@ syntax region typescriptFuncCallArg contained matchgroup=typescriptPa
|
||||
syntax region typescriptEventFuncCallArg contained matchgroup=typescriptParens start=/(/ end=/)/ contains=@typescriptEventExpression
|
||||
syntax region typescriptEventString contained start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1\|$/ contains=typescriptASCII,@events
|
||||
|
||||
"runtime syntax/basic/literal.vim
|
||||
syntax region typescriptDestructureString
|
||||
\ start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1\|$/
|
||||
\ contains=typescriptASCII
|
||||
\ nextgroup=typescriptDestructureAs
|
||||
\ contained skipwhite skipempty
|
||||
|
||||
syntax cluster typescriptVariableDeclarations
|
||||
\ contains=typescriptVariableDeclaration,@typescriptDestructures
|
||||
|
||||
syntax match typescriptVariableDeclaration /[A-Za-z_$]\k*/
|
||||
\ nextgroup=typescriptTypeAnnotation,typescriptAssign
|
||||
\ contained skipwhite skipempty
|
||||
|
||||
syntax cluster typescriptDestructureVariables contains=
|
||||
\ typescriptRestOrSpread,
|
||||
\ typescriptDestructureComma,
|
||||
\ typescriptDestructureLabel,
|
||||
\ typescriptDestructureVariable,
|
||||
\ @typescriptDestructures
|
||||
|
||||
syntax match typescriptDestructureVariable /[A-Za-z_$]\k*/ contained
|
||||
\ nextgroup=typescriptDefaultParam
|
||||
\ contained skipwhite skipempty
|
||||
|
||||
syntax match typescriptDestructureLabel /[A-Za-z_$]\k*\ze\_s*:/
|
||||
\ nextgroup=typescriptDestructureAs
|
||||
\ contained skipwhite skipempty
|
||||
|
||||
syntax match typescriptDestructureAs /:/
|
||||
\ nextgroup=typescriptDestructureVariable,@typescriptDestructures
|
||||
\ contained skipwhite skipempty
|
||||
|
||||
syntax match typescriptDestructureComma /,/ contained
|
||||
|
||||
syntax cluster typescriptDestructures contains=
|
||||
\ typescriptArrayDestructure,
|
||||
\ typescriptObjectDestructure
|
||||
|
||||
syntax region typescriptArrayDestructure matchgroup=typescriptBraces
|
||||
\ start=/\[/ end=/]/
|
||||
\ contains=@typescriptDestructureVariables,@typescriptComments
|
||||
\ nextgroup=typescriptTypeAnnotation,typescriptAssign
|
||||
\ transparent contained skipwhite skipempty fold
|
||||
|
||||
syntax region typescriptObjectDestructure matchgroup=typescriptBraces
|
||||
\ start=/{/ end=/}/
|
||||
\ contains=typescriptDestructureString,@typescriptDestructureVariables,@typescriptComments
|
||||
\ nextgroup=typescriptTypeAnnotation,typescriptAssign
|
||||
\ transparent contained skipwhite skipempty fold
|
||||
|
||||
"Syntax in the JavaScript code
|
||||
|
||||
" String
|
||||
@@ -77,15 +125,15 @@ syntax region typescriptString
|
||||
\ contains=typescriptSpecial,@Spell
|
||||
\ extend
|
||||
|
||||
syntax match typescriptSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x{4,5}})|c\u|.)"
|
||||
syntax match typescriptSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x{1,6}})|c\u|.)"
|
||||
|
||||
" From vim runtime
|
||||
" <https://github.com/vim/vim/blob/master/runtime/syntax/javascript.vim#L48>
|
||||
syntax region typescriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gimuy]\{0,5\}\s*$+ end=+/[gimuy]\{0,5\}\s*[;.,)\]}]+me=e-1 nextgroup=typescriptDotNotation oneline
|
||||
syntax region typescriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gimuy]\{0,5\}\s*$+ end=+/[gimuy]\{0,5\}\s*[;.,)\]}:]+me=e-1 nextgroup=typescriptDotNotation oneline
|
||||
|
||||
syntax region typescriptTemplate
|
||||
\ start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/
|
||||
\ contains=typescriptTemplateSubstitution
|
||||
\ contains=typescriptTemplateSubstitution,typescriptSpecial,@Spell
|
||||
\ nextgroup=@typescriptSymbols
|
||||
\ skipwhite skipempty
|
||||
|
||||
@@ -100,18 +148,16 @@ syntax region typescriptArray matchgroup=typescriptBraces
|
||||
syntax match typescriptNumber /\<0[bB][01][01_]*\>/ nextgroup=@typescriptSymbols skipwhite skipempty
|
||||
syntax match typescriptNumber /\<0[oO][0-7][0-7_]*\>/ nextgroup=@typescriptSymbols skipwhite skipempty
|
||||
syntax match typescriptNumber /\<0[xX][0-9a-fA-F][0-9a-fA-F_]*\>/ nextgroup=@typescriptSymbols skipwhite skipempty
|
||||
syntax match typescriptNumber /\d[0-9_]*\.\d[0-9_]*\|\d[0-9_]*\|\.\d[0-9]*/
|
||||
\ nextgroup=typescriptExponent,@typescriptSymbols skipwhite skipempty
|
||||
syntax match typescriptExponent /[eE][+-]\=\d[0-9]*\>/
|
||||
\ nextgroup=@typescriptSymbols skipwhite skipempty contained
|
||||
syntax match typescriptNumber /\<\%(\d[0-9_]*\%(\.\d[0-9_]*\)\=\|\.\d[0-9_]*\)\%([eE][+-]\=\d[0-9_]*\)\=\>/
|
||||
\ nextgroup=typescriptSymbols skipwhite skipempty
|
||||
|
||||
|
||||
" runtime syntax/basic/object.vim
|
||||
syntax region typescriptObjectLiteral matchgroup=typescriptBraces
|
||||
\ start=/{/ end=/}/
|
||||
\ contains=@typescriptComments,typescriptObjectLabel,typescriptStringProperty,typescriptComputedPropertyName
|
||||
\ contains=@typescriptComments,typescriptObjectLabel,typescriptStringProperty,typescriptComputedPropertyName,typescriptObjectAsyncKeyword
|
||||
\ fold contained
|
||||
|
||||
syntax keyword typescriptObjectAsyncKeyword async contained
|
||||
|
||||
syntax match typescriptObjectLabel contained /\k\+\_s*/
|
||||
\ nextgroup=typescriptObjectColon,@typescriptCallImpl
|
||||
\ skipwhite skipempty
|
||||
@@ -136,7 +182,6 @@ syntax match typescriptObjectSpread /\.\.\./ contained containedin=typescriptObj
|
||||
|
||||
syntax match typescriptObjectColon contained /:/ nextgroup=@typescriptValue skipwhite skipempty
|
||||
|
||||
"runtime syntax/basic/symbols.vim
|
||||
" + - ^ ~
|
||||
syntax match typescriptUnaryOp /[+\-~!]/
|
||||
\ nextgroup=@typescriptValue
|
||||
@@ -153,10 +198,12 @@ syntax match typescriptBinaryOp contained /===\?/ nextgroup=@typescriptValue s
|
||||
syntax match typescriptBinaryOp contained />\(>>=\|>>\|>=\|>\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||
" 4: <<=, <<, <=, <
|
||||
syntax match typescriptBinaryOp contained /<\(<=\|<\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||
" 3: ||, |=, |
|
||||
syntax match typescriptBinaryOp contained /|\(|\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||
" 3: &&, &=, &
|
||||
syntax match typescriptBinaryOp contained /&\(&\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||
" 3: ||, |=, |, ||=
|
||||
syntax match typescriptBinaryOp contained /||\?=\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||
" 4: &&, &=, &, &&=
|
||||
syntax match typescriptBinaryOp contained /&&\?=\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||
" 2: ??, ??=
|
||||
syntax match typescriptBinaryOp contained /??=\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||
" 2: *=, *
|
||||
syntax match typescriptBinaryOp contained /\*=\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||
" 2: %=, %
|
||||
@@ -177,11 +224,18 @@ syntax match typescriptBinaryOp contained /\*\*=\?/ nextgroup=@typescriptValue
|
||||
syntax cluster typescriptSymbols contains=typescriptBinaryOp,typescriptKeywordOp,typescriptTernary,typescriptAssign,typescriptCastKeyword
|
||||
|
||||
" runtime syntax/basic/reserved.vim
|
||||
|
||||
"runtime syntax/basic/keyword.vim
|
||||
"Import
|
||||
syntax keyword typescriptImport from as import
|
||||
syntax keyword typescriptImport from as
|
||||
syntax keyword typescriptImport import
|
||||
\ nextgroup=typescriptImportType
|
||||
\ skipwhite
|
||||
syntax keyword typescriptImportType type
|
||||
\ contained
|
||||
syntax keyword typescriptExport export
|
||||
\ nextgroup=typescriptExportType
|
||||
\ skipwhite
|
||||
syntax match typescriptExportType /\<type\s*{\@=/
|
||||
\ contained skipwhite skipempty skipnl
|
||||
syntax keyword typescriptModule namespace module
|
||||
|
||||
"this
|
||||
@@ -199,16 +253,12 @@ syntax keyword typescriptIdentifier arguments this super
|
||||
\ nextgroup=@afterIdentifier
|
||||
|
||||
syntax keyword typescriptVariable let var
|
||||
\ nextgroup=typescriptVariableDeclaration
|
||||
\ skipwhite skipempty skipnl
|
||||
\ nextgroup=@typescriptVariableDeclarations
|
||||
\ skipwhite skipempty
|
||||
|
||||
syntax keyword typescriptVariable const
|
||||
\ nextgroup=typescriptEnum,typescriptVariableDeclaration
|
||||
\ skipwhite
|
||||
|
||||
syntax match typescriptVariableDeclaration /[A-Za-z_$]\k*/
|
||||
\ nextgroup=typescriptTypeAnnotation,typescriptAssign
|
||||
\ contained skipwhite skipempty skipnl
|
||||
\ nextgroup=typescriptEnum,@typescriptVariableDeclarations
|
||||
\ skipwhite skipempty
|
||||
|
||||
syntax region typescriptEnum matchgroup=typescriptEnumKeyword start=/enum / end=/\ze{/
|
||||
\ nextgroup=typescriptBlock
|
||||
@@ -271,7 +321,6 @@ syntax cluster typescriptAmbients contains=
|
||||
\ typescriptEnumKeyword,typescriptEnum,
|
||||
\ typescriptModule
|
||||
|
||||
"runtime syntax/basic/doc.vim
|
||||
"Syntax coloring for Node.js shebang line
|
||||
syntax match shellbang "^#!.*node\>"
|
||||
syntax match shellbang "^#!.*iojs\>"
|
||||
@@ -279,8 +328,9 @@ syntax match shellbang "^#!.*iojs\>"
|
||||
|
||||
"JavaScript comments
|
||||
syntax keyword typescriptCommentTodo TODO FIXME XXX TBD
|
||||
syntax match typescriptMagicComment "@ts-\%(ignore\|expect-error\)\>"
|
||||
syntax match typescriptLineComment "//.*"
|
||||
\ contains=@Spell,typescriptCommentTodo,typescriptRef
|
||||
\ contains=@Spell,typescriptCommentTodo,typescriptRef,typescriptMagicComment
|
||||
syntax region typescriptComment
|
||||
\ start="/\*" end="\*/"
|
||||
\ contains=@Spell,typescriptCommentTodo extend
|
||||
@@ -349,24 +399,27 @@ syntax region typescriptDocLinkTag contained matchgroup=typescriptDo
|
||||
|
||||
syntax cluster typescriptDocs contains=typescriptDocParamType,typescriptDocNamedParamType,typescriptDocParam
|
||||
|
||||
if main_syntax == "typescript"
|
||||
if exists("main_syntax") && main_syntax == "typescript"
|
||||
syntax sync clear
|
||||
syntax sync ccomment typescriptComment minlines=200
|
||||
endif
|
||||
|
||||
syntax case match
|
||||
|
||||
"runtime syntax/basic/type.vim
|
||||
" Types
|
||||
syntax match typescriptOptionalMark /?/ contained
|
||||
|
||||
syntax cluster typescriptTypeParameterCluster contains=
|
||||
\ typescriptTypeParameter,
|
||||
\ typescriptGenericDefault
|
||||
|
||||
syntax region typescriptTypeParameters matchgroup=typescriptTypeBrackets
|
||||
\ start=/</ end=/>/
|
||||
\ contains=typescriptTypeParameter
|
||||
\ contains=@typescriptTypeParameterCluster
|
||||
\ contained
|
||||
|
||||
syntax match typescriptTypeParameter /\K\k*/
|
||||
\ nextgroup=typescriptConstraint,typescriptGenericDefault
|
||||
\ nextgroup=typescriptConstraint
|
||||
\ contained skipwhite skipnl
|
||||
|
||||
syntax keyword typescriptConstraint extends
|
||||
@@ -409,6 +462,7 @@ syntax cluster typescriptPrimaryType contains=
|
||||
\ typescriptTupleType,
|
||||
\ typescriptTypeQuery,
|
||||
\ typescriptStringLiteralType,
|
||||
\ typescriptTemplateLiteralType,
|
||||
\ typescriptReadonlyArrayKeyword,
|
||||
\ typescriptAssertType
|
||||
|
||||
@@ -417,6 +471,17 @@ syntax region typescriptStringLiteralType contained
|
||||
\ nextgroup=typescriptUnion
|
||||
\ skipwhite skipempty
|
||||
|
||||
syntax region typescriptTemplateLiteralType contained
|
||||
\ start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/
|
||||
\ contains=typescriptTemplateSubstitutionType
|
||||
\ nextgroup=typescriptTypeOperator
|
||||
\ skipwhite skipempty
|
||||
|
||||
syntax region typescriptTemplateSubstitutionType matchgroup=typescriptTemplateSB
|
||||
\ start=/\${/ end=/}/
|
||||
\ contains=@typescriptType
|
||||
\ contained
|
||||
|
||||
syntax region typescriptParenthesizedType matchgroup=typescriptParens
|
||||
\ start=/(/ end=/)/
|
||||
\ contains=@typescriptType
|
||||
@@ -439,7 +504,7 @@ syntax region typescriptObjectType matchgroup=typescriptBraces
|
||||
\ start=/{/ end=/}/
|
||||
\ contains=@typescriptTypeMember,typescriptEndColons,@typescriptComments,typescriptAccessibilityModifier,typescriptReadonlyModifier
|
||||
\ nextgroup=@typescriptTypeOperator
|
||||
\ contained skipwhite fold
|
||||
\ contained skipwhite skipnl fold
|
||||
|
||||
syntax cluster typescriptTypeMember contains=
|
||||
\ @typescriptCallSignature,
|
||||
@@ -447,16 +512,21 @@ syntax cluster typescriptTypeMember contains=
|
||||
\ typescriptIndexSignature,
|
||||
\ @typescriptMembers
|
||||
|
||||
syntax match typescriptTupleLable /\K\k*?\?:/
|
||||
\ contained
|
||||
|
||||
syntax region typescriptTupleType matchgroup=typescriptBraces
|
||||
\ start=/\[/ end=/\]/
|
||||
\ contains=@typescriptType,@typescriptComments
|
||||
\ contains=@typescriptType,@typescriptComments,typescriptRestOrSpread,typescriptTupleLable
|
||||
\ contained skipwhite
|
||||
|
||||
syntax cluster typescriptTypeOperator
|
||||
\ contains=typescriptUnion,typescriptTypeBracket
|
||||
\ contains=typescriptUnion,typescriptTypeBracket,typescriptConstraint,typescriptConditionalType
|
||||
|
||||
syntax match typescriptUnion /|\|&/ contained nextgroup=@typescriptPrimaryType skipwhite skipempty
|
||||
|
||||
syntax match typescriptConditionalType /?\|:/ contained nextgroup=@typescriptPrimaryType skipwhite skipempty
|
||||
|
||||
syntax cluster typescriptFunctionType contains=typescriptGenericFunc,typescriptFuncType
|
||||
syntax region typescriptGenericFunc matchgroup=typescriptTypeBrackets
|
||||
\ start=/</ end=/>/
|
||||
@@ -511,6 +581,7 @@ syntax match typescriptTypeAnnotation /:/
|
||||
syntax cluster typescriptParameterList contains=
|
||||
\ typescriptTypeAnnotation,
|
||||
\ typescriptAccessibilityModifier,
|
||||
\ typescriptReadonlyModifier,
|
||||
\ typescriptOptionalMark,
|
||||
\ typescriptRestOrSpread,
|
||||
\ typescriptFuncComma,
|
||||
@@ -550,10 +621,9 @@ syntax keyword typescriptReadonlyArrayKeyword readonly
|
||||
\ nextgroup=@typescriptPrimaryType
|
||||
\ skipwhite
|
||||
|
||||
|
||||
" extension
|
||||
if get(g:, 'yats_host_keyword', 1)
|
||||
"runtime syntax/yats.vim
|
||||
"runtime syntax/yats/typescript.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Function Boolean
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Error EvalError
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName InternalError
|
||||
@@ -584,7 +654,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptGlobalMethod
|
||||
hi def link typescriptGlobalMethod Structure
|
||||
|
||||
"runtime syntax/yats/es6-number.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Number nextgroup=typescriptGlobalNumberDot,typescriptFuncCallArg
|
||||
syntax match typescriptGlobalNumberDot /\./ contained nextgroup=typescriptNumberStaticProp,typescriptNumberStaticMethod,typescriptProp
|
||||
syntax keyword typescriptNumberStaticProp contained EPSILON MAX_SAFE_INTEGER MAX_VALUE
|
||||
@@ -599,7 +668,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptNumberMethod
|
||||
hi def link typescriptNumberMethod Keyword
|
||||
|
||||
"runtime syntax/yats/es6-string.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName String nextgroup=typescriptGlobalStringDot,typescriptFuncCallArg
|
||||
syntax match typescriptGlobalStringDot /\./ contained nextgroup=typescriptStringStaticMethod,typescriptProp
|
||||
syntax keyword typescriptStringStaticMethod contained fromCharCode fromCodePoint raw nextgroup=typescriptFuncCallArg
|
||||
@@ -615,7 +683,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptStringMethod
|
||||
hi def link typescriptStringMethod Keyword
|
||||
|
||||
"runtime syntax/yats/es6-array.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Array nextgroup=typescriptGlobalArrayDot,typescriptFuncCallArg
|
||||
syntax match typescriptGlobalArrayDot /\./ contained nextgroup=typescriptArrayStaticMethod,typescriptProp
|
||||
syntax keyword typescriptArrayStaticMethod contained from isArray of nextgroup=typescriptFuncCallArg
|
||||
@@ -629,7 +696,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptArrayMethod
|
||||
hi def link typescriptArrayMethod Keyword
|
||||
|
||||
"runtime syntax/yats/es6-object.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Object nextgroup=typescriptGlobalObjectDot,typescriptFuncCallArg
|
||||
syntax match typescriptGlobalObjectDot /\./ contained nextgroup=typescriptObjectStaticMethod,typescriptProp
|
||||
syntax keyword typescriptObjectStaticMethod contained create defineProperties defineProperty nextgroup=typescriptFuncCallArg
|
||||
@@ -646,7 +712,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptObjectMethod
|
||||
hi def link typescriptObjectMethod Keyword
|
||||
|
||||
"runtime syntax/yats/es6-symbol.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Symbol nextgroup=typescriptGlobalSymbolDot,typescriptFuncCallArg
|
||||
syntax match typescriptGlobalSymbolDot /\./ contained nextgroup=typescriptSymbolStaticProp,typescriptSymbolStaticMethod,typescriptProp
|
||||
syntax keyword typescriptSymbolStaticProp contained length iterator match replace
|
||||
@@ -657,13 +722,11 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax keyword typescriptSymbolStaticMethod contained for keyFor nextgroup=typescriptFuncCallArg
|
||||
hi def link typescriptSymbolStaticMethod Keyword
|
||||
|
||||
"runtime syntax/yats/es6-function.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Function
|
||||
syntax keyword typescriptFunctionMethod contained apply bind call nextgroup=typescriptFuncCallArg
|
||||
syntax cluster props add=typescriptFunctionMethod
|
||||
hi def link typescriptFunctionMethod Keyword
|
||||
|
||||
"runtime syntax/yats/es6-math.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Math nextgroup=typescriptGlobalMathDot,typescriptFuncCallArg
|
||||
syntax match typescriptGlobalMathDot /\./ contained nextgroup=typescriptMathStaticProp,typescriptMathStaticMethod,typescriptProp
|
||||
syntax keyword typescriptMathStaticProp contained E LN10 LN2 LOG10E LOG2E PI SQRT1_2
|
||||
@@ -677,7 +740,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax keyword typescriptMathStaticMethod contained sinh sqrt tan tanh trunc nextgroup=typescriptFuncCallArg
|
||||
hi def link typescriptMathStaticMethod Keyword
|
||||
|
||||
"runtime syntax/yats/es6-date.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Date nextgroup=typescriptGlobalDateDot,typescriptFuncCallArg
|
||||
syntax match typescriptGlobalDateDot /\./ contained nextgroup=typescriptDateStaticMethod,typescriptProp
|
||||
syntax keyword typescriptDateStaticMethod contained UTC now parse nextgroup=typescriptFuncCallArg
|
||||
@@ -699,13 +761,11 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptDateMethod
|
||||
hi def link typescriptDateMethod Keyword
|
||||
|
||||
"runtime syntax/yats/es6-json.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName JSON nextgroup=typescriptGlobalJSONDot,typescriptFuncCallArg
|
||||
syntax match typescriptGlobalJSONDot /\./ contained nextgroup=typescriptJSONStaticMethod,typescriptProp
|
||||
syntax keyword typescriptJSONStaticMethod contained parse stringify nextgroup=typescriptFuncCallArg
|
||||
hi def link typescriptJSONStaticMethod Keyword
|
||||
|
||||
"runtime syntax/yats/es6-regexp.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName RegExp nextgroup=typescriptGlobalRegExpDot,typescriptFuncCallArg
|
||||
syntax match typescriptGlobalRegExpDot /\./ contained nextgroup=typescriptRegExpStaticProp,typescriptProp
|
||||
syntax keyword typescriptRegExpStaticProp contained lastIndex
|
||||
@@ -717,7 +777,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptRegExpMethod
|
||||
hi def link typescriptRegExpMethod Keyword
|
||||
|
||||
"runtime syntax/yats/es6-map.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Map WeakMap
|
||||
syntax keyword typescriptES6MapProp contained size
|
||||
syntax cluster props add=typescriptES6MapProp
|
||||
@@ -727,7 +786,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptES6MapMethod
|
||||
hi def link typescriptES6MapMethod Keyword
|
||||
|
||||
"runtime syntax/yats/es6-set.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Set WeakSet
|
||||
syntax keyword typescriptES6SetProp contained size
|
||||
syntax cluster props add=typescriptES6SetProp
|
||||
@@ -737,7 +795,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptES6SetMethod
|
||||
hi def link typescriptES6SetMethod Keyword
|
||||
|
||||
"runtime syntax/yats/es6-proxy.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Proxy
|
||||
syntax keyword typescriptProxyAPI contained getOwnPropertyDescriptor getOwnPropertyNames
|
||||
syntax keyword typescriptProxyAPI contained defineProperty deleteProperty freeze seal
|
||||
@@ -745,7 +802,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax keyword typescriptProxyAPI contained iterate ownKeys apply construct
|
||||
hi def link typescriptProxyAPI Keyword
|
||||
|
||||
"runtime syntax/yats/es6-promise.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Promise nextgroup=typescriptGlobalPromiseDot,typescriptFuncCallArg
|
||||
syntax match typescriptGlobalPromiseDot /\./ contained nextgroup=typescriptPromiseStaticMethod,typescriptProp
|
||||
syntax keyword typescriptPromiseStaticMethod contained resolve reject all race nextgroup=typescriptFuncCallArg
|
||||
@@ -754,7 +810,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptPromiseMethod
|
||||
hi def link typescriptPromiseMethod Keyword
|
||||
|
||||
"runtime syntax/yats/es6-reflect.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Reflect
|
||||
syntax keyword typescriptReflectMethod contained apply construct defineProperty deleteProperty nextgroup=typescriptFuncCallArg
|
||||
syntax keyword typescriptReflectMethod contained enumerate get getOwnPropertyDescriptor nextgroup=typescriptFuncCallArg
|
||||
@@ -763,14 +818,12 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptReflectMethod
|
||||
hi def link typescriptReflectMethod Keyword
|
||||
|
||||
"runtime syntax/yats/ecma-402.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Intl
|
||||
syntax keyword typescriptIntlMethod contained Collator DateTimeFormat NumberFormat nextgroup=typescriptFuncCallArg
|
||||
syntax keyword typescriptIntlMethod contained PluralRules nextgroup=typescriptFuncCallArg
|
||||
syntax cluster props add=typescriptIntlMethod
|
||||
hi def link typescriptIntlMethod Keyword
|
||||
|
||||
"runtime syntax/yats/node.vim
|
||||
syntax keyword typescriptNodeGlobal containedin=typescriptIdentifierName global process
|
||||
syntax keyword typescriptNodeGlobal containedin=typescriptIdentifierName console Buffer
|
||||
syntax keyword typescriptNodeGlobal containedin=typescriptIdentifierName module exports
|
||||
@@ -788,7 +841,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax keyword typescriptTestGlobal containedin=typescriptIdentifierName afterAll
|
||||
syntax keyword typescriptTestGlobal containedin=typescriptIdentifierName expect assert
|
||||
|
||||
"runtime syntax/yats/web.vim
|
||||
syntax keyword typescriptBOM containedin=typescriptIdentifierName AbortController
|
||||
syntax keyword typescriptBOM containedin=typescriptIdentifierName AbstractWorker AnalyserNode
|
||||
syntax keyword typescriptBOM containedin=typescriptIdentifierName App Apps ArrayBuffer
|
||||
@@ -1038,7 +1090,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax keyword typescriptBOM containedin=typescriptIdentifierName XMLHttpRequestEventTarget
|
||||
hi def link typescriptBOM Structure
|
||||
|
||||
"runtime syntax/yats/web-window.vim
|
||||
syntax keyword typescriptBOMWindowProp containedin=typescriptIdentifierName applicationCache
|
||||
syntax keyword typescriptBOMWindowProp containedin=typescriptIdentifierName closed
|
||||
syntax keyword typescriptBOMWindowProp containedin=typescriptIdentifierName Components
|
||||
@@ -1145,7 +1196,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax keyword typescriptBOMWindowCons containedin=typescriptIdentifierName XMLSerializer
|
||||
hi def link typescriptBOMWindowCons Structure
|
||||
|
||||
"runtime syntax/yats/web-navigator.vim
|
||||
syntax keyword typescriptBOMNavigatorProp contained battery buildID connection cookieEnabled
|
||||
syntax keyword typescriptBOMNavigatorProp contained doNotTrack maxTouchPoints oscpu
|
||||
syntax keyword typescriptBOMNavigatorProp contained productSub push serviceWorker
|
||||
@@ -1164,7 +1214,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptServiceWorkerMethod
|
||||
hi def link typescriptServiceWorkerMethod Keyword
|
||||
|
||||
"runtime syntax/yats/web-location.vim
|
||||
syntax keyword typescriptBOMLocationProp contained href protocol host hostname port
|
||||
syntax keyword typescriptBOMLocationProp contained pathname search hash username password
|
||||
syntax keyword typescriptBOMLocationProp contained origin
|
||||
@@ -1174,7 +1223,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptBOMLocationMethod
|
||||
hi def link typescriptBOMLocationMethod Keyword
|
||||
|
||||
"runtime syntax/yats/web-history.vim
|
||||
syntax keyword typescriptBOMHistoryProp contained length current next previous state
|
||||
syntax keyword typescriptBOMHistoryProp contained scrollRestoration
|
||||
syntax cluster props add=typescriptBOMHistoryProp
|
||||
@@ -1183,7 +1231,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptBOMHistoryMethod
|
||||
hi def link typescriptBOMHistoryMethod Keyword
|
||||
|
||||
"runtime syntax/yats/web-console.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName console
|
||||
syntax keyword typescriptConsoleMethod contained count dir error group groupCollapsed nextgroup=typescriptFuncCallArg
|
||||
syntax keyword typescriptConsoleMethod contained groupEnd info log time timeEnd trace nextgroup=typescriptFuncCallArg
|
||||
@@ -1191,7 +1238,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptConsoleMethod
|
||||
hi def link typescriptConsoleMethod Keyword
|
||||
|
||||
"runtime syntax/yats/web-xhr.vim
|
||||
syntax keyword typescriptXHRGlobal containedin=typescriptIdentifierName XMLHttpRequest
|
||||
hi def link typescriptXHRGlobal Structure
|
||||
syntax keyword typescriptXHRProp contained onreadystatechange readyState response
|
||||
@@ -1204,7 +1250,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptXHRMethod
|
||||
hi def link typescriptXHRMethod Keyword
|
||||
|
||||
"runtime syntax/yats/web-blob.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Blob BlobBuilder
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName File FileReader
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName FileReaderSync
|
||||
@@ -1236,7 +1281,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax keyword typescriptURLStaticMethod contained createObjectURL revokeObjectURL nextgroup=typescriptFuncCallArg
|
||||
hi def link typescriptURLStaticMethod Keyword
|
||||
|
||||
"runtime syntax/yats/web-crypto.vim
|
||||
syntax keyword typescriptCryptoGlobal containedin=typescriptIdentifierName crypto
|
||||
hi def link typescriptCryptoGlobal Structure
|
||||
syntax keyword typescriptSubtleCryptoMethod contained encrypt decrypt sign verify nextgroup=typescriptFuncCallArg
|
||||
@@ -1250,7 +1294,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptCryptoMethod
|
||||
hi def link typescriptCryptoMethod Keyword
|
||||
|
||||
"runtime syntax/yats/web-fetch.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Headers Request
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Response
|
||||
syntax keyword typescriptGlobalMethod containedin=typescriptIdentifierName fetch nextgroup=typescriptFuncCallArg
|
||||
@@ -1274,7 +1317,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptResponseMethod
|
||||
hi def link typescriptResponseMethod Keyword
|
||||
|
||||
"runtime syntax/yats/web-service-worker.vim
|
||||
syntax keyword typescriptServiceWorkerProp contained controller ready
|
||||
syntax cluster props add=typescriptServiceWorkerProp
|
||||
hi def link typescriptServiceWorkerProp Keyword
|
||||
@@ -1287,7 +1329,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptCacheMethod
|
||||
hi def link typescriptCacheMethod Keyword
|
||||
|
||||
"runtime syntax/yats/web-encoding.vim
|
||||
syntax keyword typescriptEncodingGlobal containedin=typescriptIdentifierName TextEncoder
|
||||
syntax keyword typescriptEncodingGlobal containedin=typescriptIdentifierName TextDecoder
|
||||
hi def link typescriptEncodingGlobal Structure
|
||||
@@ -1298,21 +1339,18 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptEncodingMethod
|
||||
hi def link typescriptEncodingMethod Keyword
|
||||
|
||||
"runtime syntax/yats/web-geo.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName Geolocation
|
||||
syntax keyword typescriptGeolocationMethod contained getCurrentPosition watchPosition nextgroup=typescriptFuncCallArg
|
||||
syntax keyword typescriptGeolocationMethod contained clearWatch nextgroup=typescriptFuncCallArg
|
||||
syntax cluster props add=typescriptGeolocationMethod
|
||||
hi def link typescriptGeolocationMethod Keyword
|
||||
|
||||
"runtime syntax/yats/web-network.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName NetworkInformation
|
||||
syntax keyword typescriptBOMNetworkProp contained downlink downlinkMax effectiveType
|
||||
syntax keyword typescriptBOMNetworkProp contained rtt type
|
||||
syntax cluster props add=typescriptBOMNetworkProp
|
||||
hi def link typescriptBOMNetworkProp Keyword
|
||||
|
||||
"runtime syntax/yats/web-payment.vim
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName PaymentRequest
|
||||
syntax keyword typescriptPaymentMethod contained show abort canMakePayment nextgroup=typescriptFuncCallArg
|
||||
syntax cluster props add=typescriptPaymentMethod
|
||||
@@ -1340,7 +1378,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptPaymentShippingOptionProp
|
||||
hi def link typescriptPaymentShippingOptionProp Keyword
|
||||
|
||||
"runtime syntax/yats/dom-node.vim
|
||||
syntax keyword typescriptDOMNodeProp contained attributes baseURI baseURIObject childNodes
|
||||
syntax keyword typescriptDOMNodeProp contained firstChild lastChild localName namespaceURI
|
||||
syntax keyword typescriptDOMNodeProp contained nextSibling nodeName nodePrincipal
|
||||
@@ -1364,7 +1401,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax keyword typescriptDOMNodeType contained DOCUMENT_FRAGMENT_NODE NOTATION_NODE
|
||||
hi def link typescriptDOMNodeType Keyword
|
||||
|
||||
"runtime syntax/yats/dom-elem.vim
|
||||
syntax keyword typescriptDOMElemAttrs contained accessKey clientHeight clientLeft
|
||||
syntax keyword typescriptDOMElemAttrs contained clientTop clientWidth id innerHTML
|
||||
syntax keyword typescriptDOMElemAttrs contained length onafterscriptexecute onbeforescriptexecute
|
||||
@@ -1387,7 +1423,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax keyword typescriptDOMElemFuncs contained getAttribute
|
||||
hi def link typescriptDOMElemFuncs Keyword
|
||||
|
||||
"runtime syntax/yats/dom-document.vim
|
||||
syntax keyword typescriptDOMDocProp contained activeElement body cookie defaultView
|
||||
syntax keyword typescriptDOMDocProp contained designMode dir domain embeds forms head
|
||||
syntax keyword typescriptDOMDocProp contained images lastModified links location plugins
|
||||
@@ -1419,7 +1454,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptDOMDocMethod
|
||||
hi def link typescriptDOMDocMethod Keyword
|
||||
|
||||
"runtime syntax/yats/dom-event.vim
|
||||
syntax keyword typescriptDOMEventTargetMethod contained addEventListener removeEventListener nextgroup=typescriptEventFuncCallArg
|
||||
syntax keyword typescriptDOMEventTargetMethod contained dispatchEvent waitUntil nextgroup=typescriptEventFuncCallArg
|
||||
syntax cluster props add=typescriptDOMEventTargetMethod
|
||||
@@ -1480,7 +1514,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptDOMEventMethod
|
||||
hi def link typescriptDOMEventMethod Keyword
|
||||
|
||||
"runtime syntax/yats/dom-storage.vim
|
||||
syntax keyword typescriptDOMStorage contained sessionStorage localStorage
|
||||
hi def link typescriptDOMStorage Keyword
|
||||
syntax keyword typescriptDOMStorageProp contained length
|
||||
@@ -1491,7 +1524,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptDOMStorageMethod
|
||||
hi def link typescriptDOMStorageMethod Keyword
|
||||
|
||||
"runtime syntax/yats/dom-form.vim
|
||||
syntax keyword typescriptDOMFormProp contained acceptCharset action elements encoding
|
||||
syntax keyword typescriptDOMFormProp contained enctype length method name target
|
||||
syntax cluster props add=typescriptDOMFormProp
|
||||
@@ -1500,7 +1532,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax cluster props add=typescriptDOMFormMethod
|
||||
hi def link typescriptDOMFormMethod Keyword
|
||||
|
||||
"runtime syntax/yats/css.vim
|
||||
syntax keyword typescriptDOMStyle contained alignContent alignItems alignSelf animation
|
||||
syntax keyword typescriptDOMStyle contained animationDelay animationDirection animationDuration
|
||||
syntax keyword typescriptDOMStyle contained animationFillMode animationIterationCount
|
||||
@@ -1575,8 +1606,6 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
|
||||
|
||||
let typescript_props = 1
|
||||
|
||||
"runtime syntax/yats/event.vim
|
||||
syntax keyword typescriptAnimationEvent contained animationend animationiteration
|
||||
syntax keyword typescriptAnimationEvent contained animationstart beginEvent endEvent
|
||||
syntax keyword typescriptAnimationEvent contained repeatEvent
|
||||
@@ -1710,14 +1739,12 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
endif
|
||||
|
||||
" patch
|
||||
"runtime syntax/basic/patch.vim
|
||||
" patch for generated code
|
||||
syntax keyword typescriptGlobal Promise
|
||||
\ nextgroup=typescriptGlobalPromiseDot,typescriptFuncCallArg,typescriptTypeArguments oneline
|
||||
syntax keyword typescriptGlobal Map WeakMap
|
||||
\ nextgroup=typescriptGlobalPromiseDot,typescriptFuncCallArg,typescriptTypeArguments oneline
|
||||
|
||||
"runtime syntax/basic/members.vim
|
||||
syntax keyword typescriptConstructor contained constructor
|
||||
\ nextgroup=@typescriptCallSignature
|
||||
\ skipwhite skipempty
|
||||
@@ -1725,7 +1752,7 @@ syntax keyword typescriptConstructor contained constructor
|
||||
|
||||
syntax cluster memberNextGroup contains=typescriptMemberOptionality,typescriptTypeAnnotation,@typescriptCallSignature
|
||||
|
||||
syntax match typescriptMember /\K\k*/
|
||||
syntax match typescriptMember /#\?\K\k*/
|
||||
\ nextgroup=@memberNextGroup
|
||||
\ contained skipwhite
|
||||
|
||||
@@ -1765,7 +1792,6 @@ syntax region typescriptComputedMember contained matchgroup=typescriptPropert
|
||||
\ nextgroup=@memberNextGroup
|
||||
\ skipwhite skipempty
|
||||
|
||||
"runtime syntax/basic/class.vim
|
||||
"don't add typescriptMembers to nextgroup, let outer scope match it
|
||||
" so we won't match abstract method outside abstract class
|
||||
syntax keyword typescriptAbstract abstract
|
||||
@@ -1781,7 +1807,7 @@ syntax match typescriptClassName contained /\K\k*/
|
||||
|
||||
syntax region typescriptClassTypeParameter
|
||||
\ start=/</ end=/>/
|
||||
\ contains=typescriptTypeParameter
|
||||
\ contains=@typescriptTypeParameterCluster
|
||||
\ nextgroup=typescriptClassBlock,typescriptClassExtends
|
||||
\ contained skipwhite skipnl
|
||||
|
||||
@@ -1813,7 +1839,7 @@ syntax match typescriptInterfaceName contained /\k\+/
|
||||
\ skipwhite skipnl
|
||||
syntax region typescriptInterfaceTypeParameter
|
||||
\ start=/</ end=/>/
|
||||
\ contains=typescriptTypeParameter
|
||||
\ contains=@typescriptTypeParameterCluster
|
||||
\ nextgroup=typescriptObjectType,typescriptInterfaceExtends
|
||||
\ contained
|
||||
\ skipwhite skipnl
|
||||
@@ -1832,7 +1858,6 @@ syntax region typescriptInterfaceTypeArguments matchgroup=typescriptTypeBrackets
|
||||
|
||||
syntax match typescriptInterfaceComma /,/ contained nextgroup=typescriptInterfaceHeritage skipwhite skipnl
|
||||
|
||||
"runtime syntax/basic/cluster.vim
|
||||
"Block VariableStatement EmptyStatement ExpressionStatement IfStatement IterationStatement ContinueStatement BreakStatement ReturnStatement WithStatement LabelledStatement SwitchStatement ThrowStatement TryStatement DebuggerStatement
|
||||
syntax cluster typescriptStatement
|
||||
\ contains=typescriptBlock,typescriptVariable,
|
||||
@@ -1872,7 +1897,6 @@ syntax cluster typescriptValue
|
||||
|
||||
syntax cluster typescriptEventExpression contains=typescriptArrowFuncDef,typescriptParenExp,@typescriptValue,typescriptRegexpString,@typescriptEventTypes,typescriptOperator,typescriptGlobal,jsxRegion
|
||||
|
||||
"runtime syntax/basic/function.vim
|
||||
syntax keyword typescriptAsyncFuncKeyword async
|
||||
\ nextgroup=typescriptFuncKeyword,typescriptArrowFuncDef
|
||||
\ skipwhite
|
||||
@@ -1894,7 +1918,7 @@ syntax match typescriptFuncName contained /\K\k*/
|
||||
\ skipwhite
|
||||
|
||||
" destructuring ({ a: ee }) =>
|
||||
syntax match typescriptArrowFuncDef contained /({\_[^}]*}\(:\_[^)]\)\?)\s*=>/
|
||||
syntax match typescriptArrowFuncDef contained /(\(\s*\({\_[^}]*}\|\k\+\)\(:\_[^)]\)\?,\?\)\+)\s*=>/
|
||||
\ contains=typescriptArrowFuncArg,typescriptArrowFunc
|
||||
\ nextgroup=@typescriptExpression,typescriptBlock
|
||||
\ skipwhite skipempty
|
||||
@@ -1913,7 +1937,7 @@ syntax match typescriptArrowFuncDef contained /\K\k*\s*=>/
|
||||
\ skipwhite skipempty
|
||||
|
||||
" TODO: optimize this pattern
|
||||
syntax region typescriptArrowFuncDef contained start=/(\_[^)]*):/ end=/=>/
|
||||
syntax region typescriptArrowFuncDef contained start=/(\_[^(^)]*):/ end=/=>/
|
||||
\ contains=typescriptArrowFuncArg,typescriptArrowFunc,typescriptTypeAnnotation
|
||||
\ nextgroup=@typescriptExpression,typescriptBlock
|
||||
\ skipwhite skipempty keepend
|
||||
@@ -1925,7 +1949,7 @@ syntax region typescriptArrowFuncArg contained start=/<\|(/ end=/\ze=>
|
||||
syntax region typescriptReturnAnnotation contained start=/:/ end=/{/me=e-1 contains=@typescriptType nextgroup=typescriptBlock
|
||||
|
||||
|
||||
syntax region typescriptFuncImpl contained start=/function/ end=/{/me=e-1
|
||||
syntax region typescriptFuncImpl contained start=/function\>/ end=/{/me=e-1
|
||||
\ contains=typescriptFuncKeyword
|
||||
\ nextgroup=typescriptBlock
|
||||
|
||||
@@ -1941,9 +1965,8 @@ syntax region typescriptParamImpl matchgroup=typescriptParens
|
||||
\ nextgroup=typescriptReturnAnnotation,typescriptBlock
|
||||
\ contained skipwhite skipnl
|
||||
|
||||
"runtime syntax/basic/decorator.vim
|
||||
syntax match typescriptDecorator /@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>/
|
||||
\ nextgroup=typescriptArgumentList,typescriptTypeArguments
|
||||
\ nextgroup=typescriptFuncCallArg,typescriptTypeArguments
|
||||
\ contains=@_semantic,typescriptDotNotation
|
||||
|
||||
" Define the default highlighting.
|
||||
@@ -1957,6 +1980,7 @@ hi def link typescriptComment Comment
|
||||
hi def link typescriptLineComment Comment
|
||||
hi def link typescriptDocComment Comment
|
||||
hi def link typescriptCommentTodo Todo
|
||||
hi def link typescriptMagicComment SpecialComment
|
||||
hi def link typescriptRef Include
|
||||
hi def link typescriptDocNotation SpecialComment
|
||||
hi def link typescriptDocTags SpecialComment
|
||||
@@ -1970,9 +1994,11 @@ hi def link typescriptDocParamType Type
|
||||
hi def link typescriptString String
|
||||
hi def link typescriptSpecial Special
|
||||
hi def link typescriptStringLiteralType String
|
||||
hi def link typescriptTemplateLiteralType String
|
||||
hi def link typescriptStringMember String
|
||||
hi def link typescriptTemplate String
|
||||
hi def link typescriptEventString String
|
||||
hi def link typescriptDestructureString String
|
||||
hi def link typescriptASCII Special
|
||||
hi def link typescriptTemplateSB Label
|
||||
hi def link typescriptRegexpString String
|
||||
@@ -1986,6 +2012,7 @@ hi def link typescriptDefault typescriptCase
|
||||
hi def link typescriptBranch Conditional
|
||||
hi def link typescriptIdentifier Structure
|
||||
hi def link typescriptVariable Identifier
|
||||
hi def link typescriptDestructureVariable PreProc
|
||||
hi def link typescriptEnumKeyword Identifier
|
||||
hi def link typescriptRepeat Repeat
|
||||
hi def link typescriptForOperator Repeat
|
||||
@@ -1997,14 +2024,17 @@ hi def link typescriptCastKeyword Special
|
||||
hi def link typescriptType Type
|
||||
hi def link typescriptNull Boolean
|
||||
hi def link typescriptNumber Number
|
||||
hi def link typescriptExponent Number
|
||||
hi def link typescriptBoolean Boolean
|
||||
hi def link typescriptObjectLabel typescriptLabel
|
||||
hi def link typescriptDestructureLabel Function
|
||||
hi def link typescriptLabel Label
|
||||
hi def link typescriptTupleLable Label
|
||||
hi def link typescriptStringProperty String
|
||||
hi def link typescriptImport Special
|
||||
hi def link typescriptImportType Special
|
||||
hi def link typescriptAmbientDeclaration Special
|
||||
hi def link typescriptExport Special
|
||||
hi def link typescriptExportType Special
|
||||
hi def link typescriptModule Special
|
||||
hi def link typescriptTry Special
|
||||
hi def link typescriptExceptions Special
|
||||
@@ -2013,6 +2043,7 @@ hi def link typescriptMember Function
|
||||
hi def link typescriptMethodAccessor Operator
|
||||
|
||||
hi def link typescriptAsyncFuncKeyword Keyword
|
||||
hi def link typescriptObjectAsyncKeyword Keyword
|
||||
hi def link typescriptAsyncFor Keyword
|
||||
hi def link typescriptFuncKeyword Keyword
|
||||
hi def link typescriptAsyncFunc Keyword
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" This is a GENERATED FILE. Please always refer to source file at the URI below.
|
||||
" Language: XKB (X Keyboard Extension) components
|
||||
" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
|
||||
" Last Change: 2020 Oct 06
|
||||
" Last Change: 2020 Oct 18
|
||||
" URL: http://trific.ath.cx/Ftp/vim/syntax/xkb.vim
|
||||
|
||||
" Setup
|
||||
@@ -41,7 +41,7 @@ syn match xkbPhysicalKey "<\w\+>"
|
||||
syn keyword xkbPreproc augment include replace
|
||||
syn keyword xkbConstant False True
|
||||
syn keyword xkbModif override replace
|
||||
syn keyword xkbIdentifier action affect alias allowExplicit approx baseColor button clearLocks color controls cornerRadius count ctrls description driveskbd font fontSize gap group groups height indicator indicatorDrivesKeyboard interpret key keys labelColor latchToLock latchMods left level_name map maximum minimum modifier_map modifiers name offColor onColor outline preserve priority repeat row section section setMods shape slant solid symbols text top type useModMapMods virtualModifier virtualMods virtual_modifiers weight whichModState width
|
||||
syn keyword xkbIdentifier action affect alias allowExplicit approx baseColor button clearLocks color controls cornerRadius count ctrls description driveskbd font fontSize gap group groups height indicator indicatorDrivesKeyboard interpret key keys labelColor latchToLock latchMods left level_name map maximum minimum modifier_map modifiers name offColor onColor outline preserve priority repeat row section setMods shape slant solid symbols text top type useModMapMods virtualModifier virtualMods virtual_modifiers weight whichModState width
|
||||
syn keyword xkbFunction AnyOf ISOLock LatchGroup LatchMods LockControls LockGroup LockMods LockPointerButton MovePtr NoAction PointerButton SetControls SetGroup SetMods SetPtrDflt Terminate
|
||||
syn keyword xkbTModif default hidden partial virtual
|
||||
syn keyword xkbSect alphanumeric_keys alternate_group function_keys keypad_keys modifier_keys xkb_compatibility xkb_geometry xkb_keycodes xkb_keymap xkb_semantics xkb_symbols xkb_types
|
||||
|
||||
@@ -319,7 +319,7 @@ NOTE: Pressing just the motion while in Normal mode without an operator will
|
||||
---> 6) Sugar is sweet
|
||||
---> 7) And so are you.
|
||||
|
||||
Doubling to operate on a line also works for operators mentioned below
|
||||
Doubling to operate on a line also works for operators mentioned below.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.7: THE UNDO COMMAND
|
||||
@@ -433,7 +433,7 @@ NOTE: Remember that you should be learning by doing, not memorization.
|
||||
---> This line has a few words that need changing using the change operator.
|
||||
|
||||
Notice that ce deletes the word and places you in Insert mode.
|
||||
cc does the same for the whole line
|
||||
cc does the same for the whole line.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -804,7 +804,7 @@ NOTE: Replace mode is like Insert mode, but every typed character deletes an
|
||||
b)
|
||||
|
||||
NOTE: You can also use y as an operator: yw yanks one word,
|
||||
yy yanks the whole line, then p puts that line
|
||||
yy yanks the whole line, then p puts that line.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 6.5: SET OPTION
|
||||
|
||||
|
||||
@@ -319,7 +319,7 @@ NOTE: Pressing just the motion while in Normal mode without an operator will
|
||||
---> 6) Sugar is sweet
|
||||
---> 7) And so are you.
|
||||
|
||||
Doubling to operate on a line also works for operators mentioned below
|
||||
Doubling to operate on a line also works for operators mentioned below.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.7: THE UNDO COMMAND
|
||||
@@ -433,7 +433,7 @@ NOTE: Remember that you should be learning by doing, not memorization.
|
||||
---> This line has a few words that need changing using the change operator.
|
||||
|
||||
Notice that ce deletes the word and places you in Insert mode.
|
||||
cc does the same for the whole line
|
||||
cc does the same for the whole line.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -804,7 +804,7 @@ NOTE: Replace mode is like Insert mode, but every typed character deletes an
|
||||
b)
|
||||
|
||||
NOTE: You can also use y as an operator: yw yanks one word,
|
||||
yy yanks the whole line, then p puts that line
|
||||
yy yanks the whole line, then p puts that line.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 6.5: SET OPTION
|
||||
|
||||
|
||||
@@ -161,7 +161,6 @@ static char *null_libintl_bindtextdomain(const char *, const char *);
|
||||
static int dyn_libintl_init(char *dir);
|
||||
static void dyn_libintl_end(void);
|
||||
|
||||
static wchar_t *oldenv = NULL;
|
||||
static HINSTANCE hLibintlDLL = 0;
|
||||
static char *(*dyn_libintl_gettext)(const char *) = null_libintl_gettext;
|
||||
static char *(*dyn_libintl_textdomain)(const char *) = null_libintl_textdomain;
|
||||
@@ -205,17 +204,17 @@ dyn_libintl_init(char *dir)
|
||||
if (buf != NULL && buf2 != NULL)
|
||||
{
|
||||
GetEnvironmentVariableW(L"PATH", buf, len);
|
||||
#ifdef _WIN64
|
||||
# ifdef _WIN64
|
||||
_snwprintf(buf2, len2, L"%S\\GvimExt64;%s", dir, buf);
|
||||
#else
|
||||
# else
|
||||
_snwprintf(buf2, len2, L"%S\\GvimExt32;%s", dir, buf);
|
||||
#endif
|
||||
# endif
|
||||
SetEnvironmentVariableW(L"PATH", buf2);
|
||||
hLibintlDLL = LoadLibrary(GETTEXT_DLL);
|
||||
#ifdef GETTEXT_DLL_ALT
|
||||
# ifdef GETTEXT_DLL_ALT
|
||||
if (!hLibintlDLL)
|
||||
hLibintlDLL = LoadLibrary(GETTEXT_DLL_ALT);
|
||||
#endif
|
||||
# endif
|
||||
SetEnvironmentVariableW(L"PATH", buf);
|
||||
}
|
||||
free(buf);
|
||||
@@ -273,56 +272,7 @@ null_libintl_textdomain(const char* /* domainname */)
|
||||
dyn_gettext_load(void)
|
||||
{
|
||||
char szBuff[BUFSIZE];
|
||||
char szLang[BUFSIZE];
|
||||
DWORD len;
|
||||
HKEY keyhandle;
|
||||
int gotlang = 0;
|
||||
|
||||
strcpy(szLang, "LANG=");
|
||||
|
||||
// First try getting the language from the registry, this can be
|
||||
// used to overrule the system language.
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Vim\\Gvim", 0,
|
||||
KEY_READ, &keyhandle) == ERROR_SUCCESS)
|
||||
{
|
||||
len = BUFSIZE;
|
||||
if (RegQueryValueEx(keyhandle, "lang", 0, NULL, (BYTE*)szBuff, &len)
|
||||
== ERROR_SUCCESS)
|
||||
{
|
||||
szBuff[len] = 0;
|
||||
strcat(szLang, szBuff);
|
||||
gotlang = 1;
|
||||
}
|
||||
RegCloseKey(keyhandle);
|
||||
}
|
||||
|
||||
if (!gotlang && getenv("LANG") == NULL)
|
||||
{
|
||||
// Get the language from the system.
|
||||
// Could use LOCALE_SISO639LANGNAME, but it's not in Win95.
|
||||
// LOCALE_SABBREVLANGNAME gives us three letters, like "enu", we use
|
||||
// only the first two.
|
||||
len = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVLANGNAME,
|
||||
(LPTSTR)szBuff, BUFSIZE);
|
||||
if (len >= 2 && _strnicmp(szBuff, "en", 2) != 0)
|
||||
{
|
||||
// There are a few exceptions (probably more)
|
||||
if (_strnicmp(szBuff, "cht", 3) == 0
|
||||
|| _strnicmp(szBuff, "zht", 3) == 0)
|
||||
strcpy(szBuff, "zh_TW");
|
||||
else if (_strnicmp(szBuff, "chs", 3) == 0
|
||||
|| _strnicmp(szBuff, "zhc", 3) == 0)
|
||||
strcpy(szBuff, "zh_CN");
|
||||
else if (_strnicmp(szBuff, "jp", 2) == 0)
|
||||
strcpy(szBuff, "ja");
|
||||
else
|
||||
szBuff[2] = 0; // truncate to two-letter code
|
||||
strcat(szLang, szBuff);
|
||||
gotlang = 1;
|
||||
}
|
||||
}
|
||||
if (gotlang)
|
||||
putenv(szLang);
|
||||
|
||||
// Try to locate the runtime files. The path is used to find libintl.dll
|
||||
// and the vim.mo files.
|
||||
@@ -378,10 +328,8 @@ DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /* lpReserved */)
|
||||
inc_cRefThisDLL()
|
||||
{
|
||||
#ifdef FEAT_GETTEXT
|
||||
if (g_cRefThisDll == 0) {
|
||||
if (g_cRefThisDll == 0)
|
||||
dyn_gettext_load();
|
||||
oldenv = GetEnvironmentStringsW();
|
||||
}
|
||||
#endif
|
||||
InterlockedIncrement((LPLONG)&g_cRefThisDll);
|
||||
}
|
||||
@@ -390,13 +338,8 @@ inc_cRefThisDLL()
|
||||
dec_cRefThisDLL()
|
||||
{
|
||||
#ifdef FEAT_GETTEXT
|
||||
if (InterlockedDecrement((LPLONG)&g_cRefThisDll) == 0) {
|
||||
if (InterlockedDecrement((LPLONG)&g_cRefThisDll) == 0)
|
||||
dyn_gettext_free();
|
||||
if (oldenv != NULL) {
|
||||
FreeEnvironmentStringsW(oldenv);
|
||||
oldenv = NULL;
|
||||
}
|
||||
}
|
||||
#else
|
||||
InterlockedDecrement((LPLONG)&g_cRefThisDll);
|
||||
#endif
|
||||
@@ -967,8 +910,8 @@ STDMETHODIMP CShellExt::InvokeGvim(HWND hParent,
|
||||
NULL, // Process handle not inheritable.
|
||||
NULL, // Thread handle not inheritable.
|
||||
FALSE, // Set handle inheritance to FALSE.
|
||||
oldenv == NULL ? 0 : CREATE_UNICODE_ENVIRONMENT,
|
||||
oldenv, // Use unmodified environment block.
|
||||
0, // No creation flags.
|
||||
NULL, // Use parent's environment block.
|
||||
NULL, // Use parent's starting directory.
|
||||
&si, // Pointer to STARTUPINFO structure.
|
||||
&pi) // Pointer to PROCESS_INFORMATION structure.
|
||||
@@ -1057,8 +1000,8 @@ STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent,
|
||||
NULL, // Process handle not inheritable.
|
||||
NULL, // Thread handle not inheritable.
|
||||
FALSE, // Set handle inheritance to FALSE.
|
||||
oldenv == NULL ? 0 : CREATE_UNICODE_ENVIRONMENT,
|
||||
oldenv, // Use unmodified environment block.
|
||||
0, // No creation flags.
|
||||
NULL, // Use parent's environment block.
|
||||
NULL, // Use parent's starting directory.
|
||||
&si, // Pointer to STARTUPINFO structure.
|
||||
&pi) // Pointer to PROCESS_INFORMATION structure.
|
||||
|
||||
@@ -264,11 +264,6 @@ For building 64 bit binaries you also need to install the SDK:
|
||||
"Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1"
|
||||
You don't need the examples and documentation.
|
||||
|
||||
If you get an error that Win32.mak can't be found, you have to set the
|
||||
variable SDK_INCLUDE_DIR. For example, on Windows 10, installation of MSVC
|
||||
puts include files in the following directory:
|
||||
set SDK_INCLUDE_DIR=C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
|
||||
|
||||
|
||||
2. MSYS2 with MinGW
|
||||
===================
|
||||
|
||||
@@ -1055,17 +1055,23 @@ install.exe: dosinst.c dosinst.h version.h
|
||||
uninstall.exe: uninstall.c dosinst.h version.h
|
||||
$(CC) $(CFLAGS) -o uninstall.exe uninstall.c $(LIB) -lole32
|
||||
|
||||
$(OBJ): | $(OUTDIR)
|
||||
|
||||
$(EXEOBJG): | $(OUTDIR)
|
||||
|
||||
$(EXEOBJC): | $(OUTDIR)
|
||||
|
||||
ifeq ($(VIMDLL),yes)
|
||||
$(TARGET): $(OUTDIR) $(OBJ)
|
||||
$(TARGET): $(OBJ)
|
||||
$(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid -lgdi32 $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
|
||||
|
||||
$(GVIMEXE): $(OUTDIR) $(EXEOBJG) $(VIMDLLBASE).dll
|
||||
$(GVIMEXE): $(EXEOBJG) $(VIMDLLBASE).dll
|
||||
$(CC) -L. $(EXELFLAGS) -mwindows -o $@ $(EXEOBJG) -l$(VIMDLLBASE)
|
||||
|
||||
$(VIMEXE): $(OUTDIR) $(EXEOBJC) $(VIMDLLBASE).dll
|
||||
$(VIMEXE): $(EXEOBJC) $(VIMDLLBASE).dll
|
||||
$(CC) -L. $(EXELFLAGS) -o $@ $(EXEOBJC) -l$(VIMDLLBASE)
|
||||
else
|
||||
$(TARGET): $(OUTDIR) $(OBJ)
|
||||
$(TARGET): $(OBJ)
|
||||
$(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
|
||||
endif
|
||||
|
||||
@@ -1280,7 +1286,7 @@ $(OUTDIR)/%.o : xdiff/%.c $(XDIFF_DEPS)
|
||||
$(CC) -c $(CFLAGS) $< -o $@
|
||||
|
||||
|
||||
$(PATHDEF_SRC): Make_cyg_ming.mak Make_cyg.mak Make_ming.mak
|
||||
$(PATHDEF_SRC): Make_cyg_ming.mak Make_cyg.mak Make_ming.mak | $(OUTDIR)
|
||||
ifneq (sh.exe, $(SHELL))
|
||||
@echo creating $(PATHDEF_SRC)
|
||||
@echo '/* pathdef.c */' > $(PATHDEF_SRC)
|
||||
|
||||
@@ -15,11 +15,7 @@
|
||||
# This will build the console version of Vim with no additional interfaces.
|
||||
# To add features, define any of the following:
|
||||
#
|
||||
# For MSVC 11, if you want to include Win32.mak, you need to specify
|
||||
# where the file is, e.g.:
|
||||
# SDK_INCLUDE_DIR="C:\Program Files\Microsoft SDKs\Windows\v7.1\Include"
|
||||
#
|
||||
# !!!! After changing features do "nmake clean" first !!!!
|
||||
# !!!! After changing any features do "nmake clean" first !!!!
|
||||
#
|
||||
# Feature Set: FEATURES=[TINY, SMALL, NORMAL, BIG, HUGE] (default is HUGE)
|
||||
#
|
||||
@@ -209,9 +205,6 @@ OBJDIR = $(OBJDIR)V
|
||||
OBJDIR = $(OBJDIR)d
|
||||
!endif
|
||||
|
||||
# If you include Win32.mak, it requires that CPU be set appropriately.
|
||||
# To cross-compile for Win64, set CPU=AMD64 or CPU=IA64.
|
||||
|
||||
!ifdef PROCESSOR_ARCHITECTURE
|
||||
# We're on Windows NT or using VC 6+
|
||||
! ifdef CPU
|
||||
@@ -251,18 +244,7 @@ NODEBUG = 1
|
||||
MAKEFLAGS_GVIMEXT = DEBUG=yes
|
||||
!endif
|
||||
|
||||
|
||||
# Get all sorts of useful, standard macros from the Platform SDK,
|
||||
# if SDK_INCLUDE_DIR is set or USE_WIN32MAK is set to "yes".
|
||||
|
||||
!ifdef SDK_INCLUDE_DIR
|
||||
! include $(SDK_INCLUDE_DIR)\Win32.mak
|
||||
!elseif "$(USE_WIN32MAK)"=="yes"
|
||||
! include <Win32.mak>
|
||||
!else
|
||||
link = link
|
||||
!endif
|
||||
|
||||
|
||||
# Check VC version.
|
||||
!if [echo MSVCVER=_MSC_VER> msvcver.c && $(CC) /EP msvcver.c > msvcver.~ 2> nul]
|
||||
|
||||
@@ -657,7 +657,7 @@ do_argfile(exarg_T *eap, int argn)
|
||||
#endif
|
||||
|
||||
// split window or create new tab page first
|
||||
if (*eap->cmd == 's' || cmdmod.tab != 0)
|
||||
if (*eap->cmd == 's' || cmdmod.cmod_tab != 0)
|
||||
{
|
||||
if (win_split(0, 0) == FAIL)
|
||||
return;
|
||||
@@ -878,7 +878,7 @@ do_arg_all(
|
||||
alist_T *alist; // argument list to be used
|
||||
buf_T *buf;
|
||||
tabpage_T *tpnext;
|
||||
int had_tab = cmdmod.tab;
|
||||
int had_tab = cmdmod.cmod_tab;
|
||||
win_T *old_curwin, *last_curwin;
|
||||
tabpage_T *old_curtab, *last_curtab;
|
||||
win_T *new_curwin = NULL;
|
||||
@@ -1116,7 +1116,7 @@ do_arg_all(
|
||||
|
||||
// When ":tab" was used open a new tab for a new window repeatedly.
|
||||
if (had_tab > 0 && tabpage_index(NULL) <= p_tpm)
|
||||
cmdmod.tab = 9999;
|
||||
cmdmod.cmod_tab = 9999;
|
||||
}
|
||||
|
||||
// Remove the "lock" on the argument list.
|
||||
|
||||
@@ -1433,9 +1433,9 @@ aucmd_prepbuf(
|
||||
// window. Expect a few side effects...
|
||||
win = curwin;
|
||||
|
||||
aco->save_curwin = curwin;
|
||||
aco->save_curwin_id = curwin->w_id;
|
||||
aco->save_curbuf = curbuf;
|
||||
aco->save_prevwin = prevwin;
|
||||
aco->save_prevwin_id = prevwin == NULL ? 0 : prevwin->w_id;
|
||||
if (win != NULL)
|
||||
{
|
||||
// There is a window for "buf" in the current tab page, make it the
|
||||
@@ -1481,7 +1481,7 @@ aucmd_prepbuf(
|
||||
curwin = aucmd_win;
|
||||
}
|
||||
curbuf = buf;
|
||||
aco->new_curwin = curwin;
|
||||
aco->new_curwin_id = curwin->w_id;
|
||||
set_bufref(&aco->new_curbuf, curbuf);
|
||||
}
|
||||
|
||||
@@ -1493,7 +1493,8 @@ aucmd_prepbuf(
|
||||
aucmd_restbuf(
|
||||
aco_save_T *aco) // structure holding saved values
|
||||
{
|
||||
int dummy;
|
||||
int dummy;
|
||||
win_T *save_curwin;
|
||||
|
||||
if (aco->use_aucmd_win)
|
||||
{
|
||||
@@ -1533,8 +1534,9 @@ win_found:
|
||||
(void)win_comp_pos(); // recompute window positions
|
||||
unblock_autocmds();
|
||||
|
||||
if (win_valid(aco->save_curwin))
|
||||
curwin = aco->save_curwin;
|
||||
save_curwin = win_find_by_id(aco->save_curwin_id);
|
||||
if (save_curwin != NULL)
|
||||
curwin = save_curwin;
|
||||
else
|
||||
// Hmm, original window disappeared. Just use the first one.
|
||||
curwin = firstwin;
|
||||
@@ -1543,9 +1545,7 @@ win_found:
|
||||
// May need to restore insert mode for a prompt buffer.
|
||||
entering_window(curwin);
|
||||
#endif
|
||||
|
||||
if (win_valid(aco->save_prevwin))
|
||||
prevwin = aco->save_prevwin;
|
||||
prevwin = win_find_by_id(aco->save_prevwin_id);
|
||||
#ifdef FEAT_EVAL
|
||||
vars_clear(&aucmd_win->w_vars->dv_hashtab); // free all w: variables
|
||||
hash_init(&aucmd_win->w_vars->dv_hashtab); // re-use the hashtab
|
||||
@@ -1571,13 +1571,15 @@ win_found:
|
||||
}
|
||||
else
|
||||
{
|
||||
// restore curwin
|
||||
if (win_valid(aco->save_curwin))
|
||||
// Restore curwin. Use the window ID, a window may have been closed
|
||||
// and the memory re-used for another one.
|
||||
save_curwin = win_find_by_id(aco->save_curwin_id);
|
||||
if (save_curwin != NULL)
|
||||
{
|
||||
// Restore the buffer which was previously edited by curwin, if
|
||||
// it was changed, we are still the same window and the buffer is
|
||||
// valid.
|
||||
if (curwin == aco->new_curwin
|
||||
if (curwin->w_id == aco->new_curwin_id
|
||||
&& curbuf != aco->new_curbuf.br_buf
|
||||
&& bufref_valid(&aco->new_curbuf)
|
||||
&& aco->new_curbuf.br_buf->b_ml.ml_mfp != NULL)
|
||||
@@ -1592,10 +1594,9 @@ win_found:
|
||||
++curbuf->b_nwindows;
|
||||
}
|
||||
|
||||
curwin = aco->save_curwin;
|
||||
curwin = save_curwin;
|
||||
curbuf = curwin->w_buffer;
|
||||
if (win_valid(aco->save_prevwin))
|
||||
prevwin = aco->save_prevwin;
|
||||
prevwin = win_find_by_id(aco->save_prevwin_id);
|
||||
// In case the autocommand moves the cursor to a position that
|
||||
// does not exist in curbuf.
|
||||
check_cursor();
|
||||
|
||||
325
src/buffer.c
325
src/buffer.c
@@ -552,6 +552,11 @@ close_buffer(
|
||||
unload_buf = FALSE;
|
||||
}
|
||||
}
|
||||
else if (buf->b_p_bh[0] == 'h' && !del_buf)
|
||||
{
|
||||
// Hide a terminal buffer.
|
||||
unload_buf = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// A terminal buffer is wiped out if the job has finished.
|
||||
@@ -673,7 +678,7 @@ aucmd_abort:
|
||||
buf->b_nwindows = nwindows;
|
||||
|
||||
buf_freeall(buf, (del_buf ? BFA_DEL : 0)
|
||||
+ (wipe_buf ? BFA_WIPE : 0)
|
||||
+ (wipe_buf ? BFA_WIPE : 0)
|
||||
+ (ignore_abort ? BFA_IGNORE_ABORT : 0));
|
||||
|
||||
// Autocommands may have deleted the buffer.
|
||||
@@ -1005,6 +1010,22 @@ free_buffer_stuff(
|
||||
VIM_CLEAR(buf->b_start_fenc);
|
||||
}
|
||||
|
||||
/*
|
||||
* Free one wininfo_T.
|
||||
*/
|
||||
void
|
||||
free_wininfo(wininfo_T *wip)
|
||||
{
|
||||
if (wip->wi_optset)
|
||||
{
|
||||
clear_winopt(&wip->wi_opt);
|
||||
#ifdef FEAT_FOLDING
|
||||
deleteFoldRecurse(&wip->wi_folds);
|
||||
#endif
|
||||
}
|
||||
vim_free(wip);
|
||||
}
|
||||
|
||||
/*
|
||||
* Free the b_wininfo list for buffer "buf".
|
||||
*/
|
||||
@@ -1017,14 +1038,7 @@ clear_wininfo(buf_T *buf)
|
||||
{
|
||||
wip = buf->b_wininfo;
|
||||
buf->b_wininfo = wip->wi_next;
|
||||
if (wip->wi_optset)
|
||||
{
|
||||
clear_winopt(&wip->wi_opt);
|
||||
#ifdef FEAT_FOLDING
|
||||
deleteFoldRecurse(&wip->wi_folds);
|
||||
#endif
|
||||
}
|
||||
vim_free(wip);
|
||||
free_wininfo(wip);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1444,7 +1458,7 @@ do_buffer(
|
||||
if (!forceit && bufIsChanged(buf))
|
||||
{
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
if ((p_confirm || cmdmod.confirm) && p_write)
|
||||
if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM)) && p_write)
|
||||
{
|
||||
dialog_changed(buf, FALSE);
|
||||
if (!bufref_valid(&bufref))
|
||||
@@ -1634,7 +1648,7 @@ do_buffer(
|
||||
if (action == DOBUF_GOTO && !can_abandon(curbuf, forceit))
|
||||
{
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
if ((p_confirm || cmdmod.confirm) && p_write)
|
||||
if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM)) && p_write)
|
||||
{
|
||||
bufref_T bufref;
|
||||
|
||||
@@ -1689,7 +1703,7 @@ set_curbuf(buf_T *buf, int action)
|
||||
bufref_T prevbufref;
|
||||
|
||||
setpcmark();
|
||||
if (!cmdmod.keepalt)
|
||||
if ((cmdmod.cmod_flags & CMOD_KEEPALT) == 0)
|
||||
curwin->w_alt_fnum = curbuf->b_fnum; // remember alternate file
|
||||
buflist_altfpos(curwin); // remember curpos
|
||||
|
||||
@@ -1974,7 +1988,8 @@ buflist_new(
|
||||
{
|
||||
vim_free(ffname);
|
||||
if (lnum != 0)
|
||||
buflist_setfpos(buf, curwin, lnum, (colnr_T)0, FALSE);
|
||||
buflist_setfpos(buf, (flags & BLN_NOCURWIN) ? NULL : curwin,
|
||||
lnum, (colnr_T)0, FALSE);
|
||||
|
||||
if ((flags & BLN_NOOPT) == 0)
|
||||
// copy the options now, if 'cpo' doesn't have 's' and not done
|
||||
@@ -2144,7 +2159,7 @@ buflist_new(
|
||||
if (top_file_num < 0) // wrap around (may cause duplicates)
|
||||
{
|
||||
emsg(_("W14: Warning: List of file names overflow"));
|
||||
if (emsg_silent == 0)
|
||||
if (emsg_silent == 0 && !in_assert_fails)
|
||||
{
|
||||
out_flush();
|
||||
ui_delay(3001L, TRUE); // make sure it is noticed
|
||||
@@ -2908,7 +2923,7 @@ buflist_nr2name(
|
||||
void
|
||||
buflist_setfpos(
|
||||
buf_T *buf,
|
||||
win_T *win,
|
||||
win_T *win, // may be NULL when using :badd
|
||||
linenr_T lnum,
|
||||
colnr_T col,
|
||||
int copy_options)
|
||||
@@ -2950,7 +2965,7 @@ buflist_setfpos(
|
||||
wip->wi_fpos.lnum = lnum;
|
||||
wip->wi_fpos.col = col;
|
||||
}
|
||||
if (copy_options)
|
||||
if (copy_options && win != NULL)
|
||||
{
|
||||
// Save the window-specific option values.
|
||||
copy_winopt(&win->w_onebuf_opt, &wip->wi_opt);
|
||||
@@ -2997,6 +3012,7 @@ wininfo_other_tab_diff(wininfo_T *wip)
|
||||
/*
|
||||
* Find info for the current window in buffer "buf".
|
||||
* If not found, return the info for the most recently used window.
|
||||
* When "need_options" is TRUE skip entries where wi_optset is FALSE.
|
||||
* When "skip_diff_buffer" is TRUE avoid windows with 'diff' set that is in
|
||||
* another tab page.
|
||||
* Returns NULL when there isn't any info.
|
||||
@@ -3004,6 +3020,7 @@ wininfo_other_tab_diff(wininfo_T *wip)
|
||||
static wininfo_T *
|
||||
find_wininfo(
|
||||
buf_T *buf,
|
||||
int need_options,
|
||||
int skip_diff_buffer UNUSED)
|
||||
{
|
||||
wininfo_T *wip;
|
||||
@@ -3013,18 +3030,25 @@ find_wininfo(
|
||||
#ifdef FEAT_DIFF
|
||||
&& (!skip_diff_buffer || !wininfo_other_tab_diff(wip))
|
||||
#endif
|
||||
)
|
||||
|
||||
&& (!need_options || wip->wi_optset))
|
||||
break;
|
||||
|
||||
// If no wininfo for curwin, use the first in the list (that doesn't have
|
||||
// 'diff' set and is in another tab page).
|
||||
// If "need_options" is TRUE skip entries that don't have options set,
|
||||
// unless the window is editing "buf", so we can copy from the window
|
||||
// itself.
|
||||
if (wip == NULL)
|
||||
{
|
||||
#ifdef FEAT_DIFF
|
||||
if (skip_diff_buffer)
|
||||
{
|
||||
FOR_ALL_BUF_WININFO(buf, wip)
|
||||
if (!wininfo_other_tab_diff(wip))
|
||||
if (!wininfo_other_tab_diff(wip)
|
||||
&& (!need_options || wip->wi_optset
|
||||
|| (wip->wi_win != NULL
|
||||
&& wip->wi_win->w_buffer == buf)))
|
||||
break;
|
||||
}
|
||||
else
|
||||
@@ -3050,7 +3074,7 @@ get_winopts(buf_T *buf)
|
||||
clearFolding(curwin);
|
||||
#endif
|
||||
|
||||
wip = find_wininfo(buf, TRUE);
|
||||
wip = find_wininfo(buf, TRUE, TRUE);
|
||||
if (wip != NULL && wip->wi_win != NULL
|
||||
&& wip->wi_win != curwin && wip->wi_win->w_buffer == buf)
|
||||
{
|
||||
@@ -3097,7 +3121,7 @@ buflist_findfpos(buf_T *buf)
|
||||
wininfo_T *wip;
|
||||
static pos_T no_position = {1, 0, 0};
|
||||
|
||||
wip = find_wininfo(buf, FALSE);
|
||||
wip = find_wininfo(buf, FALSE, FALSE);
|
||||
if (wip != NULL)
|
||||
return &(wip->wi_fpos);
|
||||
else
|
||||
@@ -3435,7 +3459,7 @@ setaltfname(
|
||||
|
||||
// Create a buffer. 'buflisted' is not set if it's a new buffer
|
||||
buf = buflist_new(ffname, sfname, lnum, 0);
|
||||
if (buf != NULL && !cmdmod.keepalt)
|
||||
if (buf != NULL && (cmdmod.cmod_flags & CMOD_KEEPALT) == 0)
|
||||
curwin->w_alt_fnum = buf->b_fnum;
|
||||
return buf;
|
||||
}
|
||||
@@ -3998,6 +4022,32 @@ free_titles(void)
|
||||
#endif // FEAT_TITLE
|
||||
|
||||
#if defined(FEAT_STL_OPT) || defined(FEAT_GUI_TABLINE) || defined(PROTO)
|
||||
|
||||
/*
|
||||
* Used for building in the status line.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
char_u *stl_start;
|
||||
int stl_minwid;
|
||||
int stl_maxwid;
|
||||
enum {
|
||||
Normal,
|
||||
Empty,
|
||||
Group,
|
||||
Middle,
|
||||
Highlight,
|
||||
TabPage,
|
||||
Trunc
|
||||
} stl_type;
|
||||
} stl_item_T;
|
||||
|
||||
static size_t stl_items_len = 20; // Initial value, grows as needed.
|
||||
static stl_item_T *stl_items = NULL;
|
||||
static int *stl_groupitem = NULL;
|
||||
static stl_hlrec_T *stl_hltab = NULL;
|
||||
static stl_hlrec_T *stl_tabtab = NULL;
|
||||
|
||||
/*
|
||||
* Build a string from the status line items in "fmt".
|
||||
* Return length of string in screen cells.
|
||||
@@ -4021,8 +4071,8 @@ build_stl_str_hl(
|
||||
int use_sandbox UNUSED, // "fmt" was set insecurely, use sandbox
|
||||
int fillchar,
|
||||
int maxwidth,
|
||||
struct stl_hlrec *hltab, // return: HL attributes (can be NULL)
|
||||
struct stl_hlrec *tabtab) // return: tab page nrs (can be NULL)
|
||||
stl_hlrec_T **hltab, // return: HL attributes (can be NULL)
|
||||
stl_hlrec_T **tabtab) // return: tab page nrs (can be NULL)
|
||||
{
|
||||
linenr_T lnum;
|
||||
size_t len;
|
||||
@@ -4050,24 +4100,7 @@ build_stl_str_hl(
|
||||
int curitem;
|
||||
int group_end_userhl;
|
||||
int group_start_userhl;
|
||||
int groupitem[STL_MAX_ITEM];
|
||||
int groupdepth;
|
||||
struct stl_item
|
||||
{
|
||||
char_u *start;
|
||||
int minwid;
|
||||
int maxwid;
|
||||
enum
|
||||
{
|
||||
Normal,
|
||||
Empty,
|
||||
Group,
|
||||
Middle,
|
||||
Highlight,
|
||||
TabPage,
|
||||
Trunc
|
||||
} type;
|
||||
} item[STL_MAX_ITEM];
|
||||
int minwid;
|
||||
int maxwid;
|
||||
int zeropad;
|
||||
@@ -4077,10 +4110,18 @@ build_stl_str_hl(
|
||||
char_u buf_tmp[TMPLEN];
|
||||
char_u win_tmp[TMPLEN];
|
||||
char_u *usefmt = fmt;
|
||||
struct stl_hlrec *sp;
|
||||
stl_hlrec_T *sp;
|
||||
int save_must_redraw = must_redraw;
|
||||
int save_redr_type = curwin->w_redr_type;
|
||||
|
||||
if (stl_items == NULL)
|
||||
{
|
||||
stl_items = ALLOC_MULT(stl_item_T, stl_items_len);
|
||||
stl_groupitem = ALLOC_MULT(int, stl_items_len);
|
||||
stl_hltab = ALLOC_MULT(stl_hlrec_T, stl_items_len);
|
||||
stl_tabtab = ALLOC_MULT(stl_hlrec_T, stl_items_len);
|
||||
}
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
/*
|
||||
* When the format starts with "%!" then evaluate it as an expression and
|
||||
@@ -4143,16 +4184,30 @@ build_stl_str_hl(
|
||||
prevchar_isitem = FALSE;
|
||||
for (s = usefmt; *s; )
|
||||
{
|
||||
if (curitem == STL_MAX_ITEM)
|
||||
if (curitem == (int)stl_items_len)
|
||||
{
|
||||
// There are too many items. Add the error code to the statusline
|
||||
// to give the user a hint about what went wrong.
|
||||
if (p + 6 < out + outlen)
|
||||
{
|
||||
mch_memmove(p, " E541", (size_t)5);
|
||||
p += 5;
|
||||
}
|
||||
break;
|
||||
size_t new_len = stl_items_len * 3 / 2;
|
||||
stl_item_T *new_items;
|
||||
int *new_groupitem;
|
||||
stl_hlrec_T *new_hlrec;
|
||||
|
||||
new_items = vim_realloc(stl_items, sizeof(stl_item_T) * new_len);
|
||||
if (new_items == NULL)
|
||||
break;
|
||||
stl_items = new_items;
|
||||
new_groupitem = vim_realloc(stl_groupitem, sizeof(int) * new_len);
|
||||
if (new_groupitem == NULL)
|
||||
break;
|
||||
stl_groupitem = new_groupitem;
|
||||
new_hlrec = vim_realloc(stl_hltab, sizeof(stl_hlrec_T) * new_len);
|
||||
if (new_hlrec == NULL)
|
||||
break;
|
||||
stl_hltab = new_hlrec;
|
||||
new_hlrec = vim_realloc(stl_tabtab, sizeof(stl_hlrec_T) * new_len);
|
||||
if (new_hlrec == NULL)
|
||||
break;
|
||||
stl_tabtab = new_hlrec;
|
||||
stl_items_len = new_len;
|
||||
}
|
||||
|
||||
if (*s != NUL && *s != '%')
|
||||
@@ -4185,15 +4240,15 @@ build_stl_str_hl(
|
||||
s++;
|
||||
if (groupdepth > 0)
|
||||
continue;
|
||||
item[curitem].type = Middle;
|
||||
item[curitem++].start = p;
|
||||
stl_items[curitem].stl_type = Middle;
|
||||
stl_items[curitem++].stl_start = p;
|
||||
continue;
|
||||
}
|
||||
if (*s == STL_TRUNCMARK)
|
||||
{
|
||||
s++;
|
||||
item[curitem].type = Trunc;
|
||||
item[curitem++].start = p;
|
||||
stl_items[curitem].stl_type = Trunc;
|
||||
stl_items[curitem++].stl_start = p;
|
||||
continue;
|
||||
}
|
||||
if (*s == ')')
|
||||
@@ -4203,83 +4258,85 @@ build_stl_str_hl(
|
||||
continue;
|
||||
groupdepth--;
|
||||
|
||||
t = item[groupitem[groupdepth]].start;
|
||||
t = stl_items[stl_groupitem[groupdepth]].stl_start;
|
||||
*p = NUL;
|
||||
l = vim_strsize(t);
|
||||
if (curitem > groupitem[groupdepth] + 1
|
||||
&& item[groupitem[groupdepth]].minwid == 0)
|
||||
if (curitem > stl_groupitem[groupdepth] + 1
|
||||
&& stl_items[stl_groupitem[groupdepth]].stl_minwid == 0)
|
||||
{
|
||||
// remove group if all items are empty and highlight group
|
||||
// doesn't change
|
||||
group_start_userhl = group_end_userhl = 0;
|
||||
for (n = groupitem[groupdepth] - 1; n >= 0; n--)
|
||||
for (n = stl_groupitem[groupdepth] - 1; n >= 0; n--)
|
||||
{
|
||||
if (item[n].type == Highlight)
|
||||
if (stl_items[n].stl_type == Highlight)
|
||||
{
|
||||
group_start_userhl = group_end_userhl = item[n].minwid;
|
||||
group_start_userhl = group_end_userhl =
|
||||
stl_items[n].stl_minwid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (n = groupitem[groupdepth] + 1; n < curitem; n++)
|
||||
for (n = stl_groupitem[groupdepth] + 1; n < curitem; n++)
|
||||
{
|
||||
if (item[n].type == Normal)
|
||||
if (stl_items[n].stl_type == Normal)
|
||||
break;
|
||||
if (item[n].type == Highlight)
|
||||
group_end_userhl = item[n].minwid;
|
||||
if (stl_items[n].stl_type == Highlight)
|
||||
group_end_userhl = stl_items[n].stl_minwid;
|
||||
}
|
||||
if (n == curitem && group_start_userhl == group_end_userhl)
|
||||
{
|
||||
// empty group
|
||||
p = t;
|
||||
l = 0;
|
||||
for (n = groupitem[groupdepth] + 1; n < curitem; n++)
|
||||
for (n = stl_groupitem[groupdepth] + 1; n < curitem; n++)
|
||||
{
|
||||
// do not use the highlighting from the removed group
|
||||
if (item[n].type == Highlight)
|
||||
item[n].type = Empty;
|
||||
if (stl_items[n].stl_type == Highlight)
|
||||
stl_items[n].stl_type = Empty;
|
||||
// adjust the start position of TabPage to the next
|
||||
// item position
|
||||
if (item[n].type == TabPage)
|
||||
item[n].start = p;
|
||||
if (stl_items[n].stl_type == TabPage)
|
||||
stl_items[n].stl_start = p;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (l > item[groupitem[groupdepth]].maxwid)
|
||||
if (l > stl_items[stl_groupitem[groupdepth]].stl_maxwid)
|
||||
{
|
||||
// truncate, remove n bytes of text at the start
|
||||
if (has_mbyte)
|
||||
{
|
||||
// Find the first character that should be included.
|
||||
n = 0;
|
||||
while (l >= item[groupitem[groupdepth]].maxwid)
|
||||
while (l >= stl_items[stl_groupitem[groupdepth]].stl_maxwid)
|
||||
{
|
||||
l -= ptr2cells(t + n);
|
||||
n += (*mb_ptr2len)(t + n);
|
||||
}
|
||||
}
|
||||
else
|
||||
n = (long)(p - t) - item[groupitem[groupdepth]].maxwid + 1;
|
||||
n = (long)(p - t) - stl_items[stl_groupitem[groupdepth]]
|
||||
.stl_maxwid + 1;
|
||||
|
||||
*t = '<';
|
||||
mch_memmove(t + 1, t + n, (size_t)(p - (t + n)));
|
||||
p = p - n + 1;
|
||||
|
||||
// Fill up space left over by half a double-wide char.
|
||||
while (++l < item[groupitem[groupdepth]].minwid)
|
||||
while (++l < stl_items[stl_groupitem[groupdepth]].stl_minwid)
|
||||
*p++ = fillchar;
|
||||
|
||||
// correct the start of the items for the truncation
|
||||
for (l = groupitem[groupdepth] + 1; l < curitem; l++)
|
||||
for (l = stl_groupitem[groupdepth] + 1; l < curitem; l++)
|
||||
{
|
||||
item[l].start -= n;
|
||||
if (item[l].start < t)
|
||||
item[l].start = t;
|
||||
stl_items[l].stl_start -= n;
|
||||
if (stl_items[l].stl_start < t)
|
||||
stl_items[l].stl_start = t;
|
||||
}
|
||||
}
|
||||
else if (abs(item[groupitem[groupdepth]].minwid) > l)
|
||||
else if (abs(stl_items[stl_groupitem[groupdepth]].stl_minwid) > l)
|
||||
{
|
||||
// fill
|
||||
n = item[groupitem[groupdepth]].minwid;
|
||||
n = stl_items[stl_groupitem[groupdepth]].stl_minwid;
|
||||
if (n < 0)
|
||||
{
|
||||
// fill by appending characters
|
||||
@@ -4295,8 +4352,8 @@ build_stl_str_hl(
|
||||
if (p + l >= out + outlen)
|
||||
l = (long)((out + outlen) - p - 1);
|
||||
p += l;
|
||||
for (n = groupitem[groupdepth] + 1; n < curitem; n++)
|
||||
item[n].start += l;
|
||||
for (n = stl_groupitem[groupdepth] + 1; n < curitem; n++)
|
||||
stl_items[n].stl_start += l;
|
||||
for ( ; l > 0; l--)
|
||||
*t++ = fillchar;
|
||||
}
|
||||
@@ -4325,9 +4382,9 @@ build_stl_str_hl(
|
||||
}
|
||||
if (*s == STL_USER_HL)
|
||||
{
|
||||
item[curitem].type = Highlight;
|
||||
item[curitem].start = p;
|
||||
item[curitem].minwid = minwid > 9 ? 1 : minwid;
|
||||
stl_items[curitem].stl_type = Highlight;
|
||||
stl_items[curitem].stl_start = p;
|
||||
stl_items[curitem].stl_minwid = minwid > 9 ? 1 : minwid;
|
||||
s++;
|
||||
curitem++;
|
||||
continue;
|
||||
@@ -4341,9 +4398,10 @@ build_stl_str_hl(
|
||||
// %X ends the close label, go back to the previously
|
||||
// define tab label nr.
|
||||
for (n = curitem - 1; n >= 0; --n)
|
||||
if (item[n].type == TabPage && item[n].minwid >= 0)
|
||||
if (stl_items[n].stl_type == TabPage
|
||||
&& stl_items[n].stl_minwid >= 0)
|
||||
{
|
||||
minwid = item[n].minwid;
|
||||
minwid = stl_items[n].stl_minwid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -4351,9 +4409,9 @@ build_stl_str_hl(
|
||||
// close nrs are stored as negative values
|
||||
minwid = - minwid;
|
||||
}
|
||||
item[curitem].type = TabPage;
|
||||
item[curitem].start = p;
|
||||
item[curitem].minwid = minwid;
|
||||
stl_items[curitem].stl_type = TabPage;
|
||||
stl_items[curitem].stl_start = p;
|
||||
stl_items[curitem].stl_minwid = minwid;
|
||||
s++;
|
||||
curitem++;
|
||||
continue;
|
||||
@@ -4371,11 +4429,11 @@ build_stl_str_hl(
|
||||
minwid = (minwid > 50 ? 50 : minwid) * l;
|
||||
if (*s == '(')
|
||||
{
|
||||
groupitem[groupdepth++] = curitem;
|
||||
item[curitem].type = Group;
|
||||
item[curitem].start = p;
|
||||
item[curitem].minwid = minwid;
|
||||
item[curitem].maxwid = maxwid;
|
||||
stl_groupitem[groupdepth++] = curitem;
|
||||
stl_items[curitem].stl_type = Group;
|
||||
stl_items[curitem].stl_start = p;
|
||||
stl_items[curitem].stl_minwid = minwid;
|
||||
stl_items[curitem].stl_maxwid = maxwid;
|
||||
s++;
|
||||
curitem++;
|
||||
continue;
|
||||
@@ -4628,9 +4686,9 @@ build_stl_str_hl(
|
||||
++s;
|
||||
if (*s == '#')
|
||||
{
|
||||
item[curitem].type = Highlight;
|
||||
item[curitem].start = p;
|
||||
item[curitem].minwid = -syn_namen2id(t, (int)(s - t));
|
||||
stl_items[curitem].stl_type = Highlight;
|
||||
stl_items[curitem].stl_start = p;
|
||||
stl_items[curitem].stl_minwid = -syn_namen2id(t, (int)(s - t));
|
||||
curitem++;
|
||||
}
|
||||
if (*s != NUL)
|
||||
@@ -4638,8 +4696,8 @@ build_stl_str_hl(
|
||||
continue;
|
||||
}
|
||||
|
||||
item[curitem].start = p;
|
||||
item[curitem].type = Normal;
|
||||
stl_items[curitem].stl_start = p;
|
||||
stl_items[curitem].stl_type = Normal;
|
||||
if (str != NULL && *str)
|
||||
{
|
||||
t = str;
|
||||
@@ -4738,7 +4796,7 @@ build_stl_str_hl(
|
||||
p += STRLEN(p);
|
||||
}
|
||||
else
|
||||
item[curitem].type = Empty;
|
||||
stl_items[curitem].stl_type = Empty;
|
||||
|
||||
if (opt == STL_VIM_EXPR)
|
||||
vim_free(str);
|
||||
@@ -4765,16 +4823,16 @@ build_stl_str_hl(
|
||||
else
|
||||
{
|
||||
for ( ; l < itemcnt; l++)
|
||||
if (item[l].type == Trunc)
|
||||
if (stl_items[l].stl_type == Trunc)
|
||||
{
|
||||
// Truncate at %< item.
|
||||
s = item[l].start;
|
||||
s = stl_items[l].stl_start;
|
||||
break;
|
||||
}
|
||||
if (l == itemcnt)
|
||||
{
|
||||
// No %< item, truncate first item.
|
||||
s = item[0].start;
|
||||
s = stl_items[0].stl_start;
|
||||
l = 0;
|
||||
}
|
||||
}
|
||||
@@ -4800,7 +4858,7 @@ build_stl_str_hl(
|
||||
else
|
||||
s = out + maxwidth - 1;
|
||||
for (l = 0; l < itemcnt; l++)
|
||||
if (item[l].start > s)
|
||||
if (stl_items[l].stl_start > s)
|
||||
break;
|
||||
itemcnt = l;
|
||||
*s++ = '>';
|
||||
@@ -4834,10 +4892,10 @@ build_stl_str_hl(
|
||||
--n; // count the '<'
|
||||
for (; l < itemcnt; l++)
|
||||
{
|
||||
if (item[l].start - n >= s)
|
||||
item[l].start -= n;
|
||||
if (stl_items[l].stl_start - n >= s)
|
||||
stl_items[l].stl_start -= n;
|
||||
else
|
||||
item[l].start = s;
|
||||
stl_items[l].stl_start = s;
|
||||
}
|
||||
}
|
||||
width = maxwidth;
|
||||
@@ -4846,16 +4904,16 @@ build_stl_str_hl(
|
||||
{
|
||||
// Apply STL_MIDDLE if any
|
||||
for (l = 0; l < itemcnt; l++)
|
||||
if (item[l].type == Middle)
|
||||
if (stl_items[l].stl_type == Middle)
|
||||
break;
|
||||
if (l < itemcnt)
|
||||
{
|
||||
p = item[l].start + maxwidth - width;
|
||||
STRMOVE(p, item[l].start);
|
||||
for (s = item[l].start; s < p; s++)
|
||||
p = stl_items[l].stl_start + maxwidth - width;
|
||||
STRMOVE(p, stl_items[l].stl_start);
|
||||
for (s = stl_items[l].stl_start; s < p; s++)
|
||||
*s = fillchar;
|
||||
for (l++; l < itemcnt; l++)
|
||||
item[l].start += maxwidth - width;
|
||||
stl_items[l].stl_start += maxwidth - width;
|
||||
width = maxwidth;
|
||||
}
|
||||
}
|
||||
@@ -4863,13 +4921,14 @@ build_stl_str_hl(
|
||||
// Store the info about highlighting.
|
||||
if (hltab != NULL)
|
||||
{
|
||||
sp = hltab;
|
||||
*hltab = stl_hltab;
|
||||
sp = stl_hltab;
|
||||
for (l = 0; l < itemcnt; l++)
|
||||
{
|
||||
if (item[l].type == Highlight)
|
||||
if (stl_items[l].stl_type == Highlight)
|
||||
{
|
||||
sp->start = item[l].start;
|
||||
sp->userhl = item[l].minwid;
|
||||
sp->start = stl_items[l].stl_start;
|
||||
sp->userhl = stl_items[l].stl_minwid;
|
||||
sp++;
|
||||
}
|
||||
}
|
||||
@@ -4880,13 +4939,14 @@ build_stl_str_hl(
|
||||
// Store the info about tab pages labels.
|
||||
if (tabtab != NULL)
|
||||
{
|
||||
sp = tabtab;
|
||||
*tabtab = stl_tabtab;
|
||||
sp = stl_tabtab;
|
||||
for (l = 0; l < itemcnt; l++)
|
||||
{
|
||||
if (item[l].type == TabPage)
|
||||
if (stl_items[l].stl_type == TabPage)
|
||||
{
|
||||
sp->start = item[l].start;
|
||||
sp->userhl = item[l].minwid;
|
||||
sp->start = stl_items[l].stl_start;
|
||||
sp->userhl = stl_items[l].stl_minwid;
|
||||
sp++;
|
||||
}
|
||||
}
|
||||
@@ -5068,7 +5128,7 @@ ex_buffer_all(exarg_T *eap)
|
||||
int r;
|
||||
int count; // Maximum number of windows to open.
|
||||
int all; // When TRUE also load inactive buffers.
|
||||
int had_tab = cmdmod.tab;
|
||||
int had_tab = cmdmod.cmod_tab;
|
||||
tabpage_T *tpnext;
|
||||
|
||||
if (eap->addr_count == 0) // make as many windows as possible
|
||||
@@ -5099,7 +5159,7 @@ ex_buffer_all(exarg_T *eap)
|
||||
{
|
||||
wpnext = wp->w_next;
|
||||
if ((wp->w_buffer->b_nwindows > 1
|
||||
|| ((cmdmod.split & WSP_VERT)
|
||||
|| ((cmdmod.cmod_split & WSP_VERT)
|
||||
? wp->w_height + wp->w_status_height < Rows - p_ch
|
||||
- tabline_height()
|
||||
: wp->w_width != Columns)
|
||||
@@ -5220,7 +5280,7 @@ ex_buffer_all(exarg_T *eap)
|
||||
#endif
|
||||
// When ":tab" was used open a new tab for a new window repeatedly.
|
||||
if (had_tab > 0 && tabpage_index(NULL) <= p_tpm)
|
||||
cmdmod.tab = 9999;
|
||||
cmdmod.cmod_tab = 9999;
|
||||
}
|
||||
--autocmd_no_enter;
|
||||
win_enter(firstwin, FALSE); // back to first window
|
||||
@@ -5515,8 +5575,8 @@ bt_nofile(buf_T *buf)
|
||||
bt_dontwrite(buf_T *buf)
|
||||
{
|
||||
return buf != NULL && (buf->b_p_bt[0] == 'n'
|
||||
|| buf->b_p_bt[0] == 't'
|
||||
|| buf->b_p_bt[0] == 'p');
|
||||
|| buf->b_p_bt[0] == 't'
|
||||
|| buf->b_p_bt[0] == 'p');
|
||||
}
|
||||
|
||||
#if defined(FEAT_QUICKFIX) || defined(PROTO)
|
||||
@@ -5547,7 +5607,7 @@ buf_hide(buf_T *buf)
|
||||
case 'd': return FALSE; // "delete"
|
||||
case 'h': return TRUE; // "hide"
|
||||
}
|
||||
return (p_hid || cmdmod.hide);
|
||||
return (p_hid || (cmdmod.cmod_flags & CMOD_HIDE));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5593,10 +5653,21 @@ buf_spname(buf_T *buf)
|
||||
}
|
||||
|
||||
if (buf->b_fname == NULL)
|
||||
return (char_u *)_("[No Name]");
|
||||
return buf_get_fname(buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get "buf->b_fname", use "[No Name]" if it is NULL.
|
||||
*/
|
||||
char_u *
|
||||
buf_get_fname(buf_T *buf)
|
||||
{
|
||||
if (buf->b_fname == NULL)
|
||||
return (char_u *)_("[No Name]");
|
||||
return buf->b_fname;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set 'buflisted' for curbuf to "on" and trigger autocommands if it changed.
|
||||
*/
|
||||
|
||||
@@ -883,7 +883,7 @@ buf_write(
|
||||
#endif
|
||||
)
|
||||
{
|
||||
if (buf != NULL && cmdmod.lockmarks)
|
||||
if (buf != NULL && (cmdmod.cmod_flags & CMOD_LOCKMARKS))
|
||||
{
|
||||
// restore the original '[ and '] positions
|
||||
buf->b_op_start = orig_start;
|
||||
@@ -967,7 +967,7 @@ buf_write(
|
||||
fname = buf->b_sfname;
|
||||
}
|
||||
|
||||
if (cmdmod.lockmarks)
|
||||
if (cmdmod.cmod_flags & CMOD_LOCKMARKS)
|
||||
{
|
||||
// restore the original '[ and '] positions
|
||||
buf->b_op_start = orig_start;
|
||||
@@ -2579,6 +2579,12 @@ nofail:
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef FEAT_VIMINFO
|
||||
// Make sure marks will be written out to the viminfo file later, even when
|
||||
// the file is new.
|
||||
curbuf->b_marks_read = TRUE;
|
||||
#endif
|
||||
|
||||
got_int |= prev_got_int;
|
||||
|
||||
return retval;
|
||||
|
||||
@@ -115,7 +115,7 @@ changed(void)
|
||||
// Wait two seconds, to make sure the user reads this unexpected
|
||||
// message. Since we could be anywhere, call wait_return() now,
|
||||
// and don't let the emsg() set msg_scroll.
|
||||
if (need_wait_return && emsg_silent == 0)
|
||||
if (need_wait_return && emsg_silent == 0 && !in_assert_fails)
|
||||
{
|
||||
out_flush();
|
||||
ui_delay(2002L, TRUE);
|
||||
@@ -453,7 +453,7 @@ changed_common(
|
||||
#endif
|
||||
|
||||
// set the '. mark
|
||||
if (!cmdmod.keepjumps)
|
||||
if ((cmdmod.cmod_flags & CMOD_KEEPJUMPS) == 0)
|
||||
{
|
||||
curbuf->b_last_change.lnum = lnum;
|
||||
curbuf->b_last_change.col = col;
|
||||
|
||||
@@ -304,7 +304,7 @@ add_to_history(
|
||||
if (hislen == 0) // no history
|
||||
return;
|
||||
|
||||
if (cmdmod.keeppatterns && histype == HIST_SEARCH)
|
||||
if ((cmdmod.cmod_flags & CMOD_KEEPPATTERNS) && histype == HIST_SEARCH)
|
||||
return;
|
||||
|
||||
// Searches inside the same mapping overwrite each other, so that only
|
||||
|
||||
34
src/dict.c
34
src/dict.c
@@ -22,6 +22,7 @@ static dict_T *first_dict = NULL;
|
||||
|
||||
/*
|
||||
* Allocate an empty header for a dictionary.
|
||||
* Caller should take care of the reference count.
|
||||
*/
|
||||
dict_T *
|
||||
dict_alloc(void)
|
||||
@@ -110,6 +111,7 @@ dict_free_contents(dict_T *d)
|
||||
|
||||
/*
|
||||
* Clear hashtab "ht" and dict items it contains.
|
||||
* If "ht" is not freed then you should call hash_init() next!
|
||||
*/
|
||||
void
|
||||
hashtab_free_contents(hashtab_T *ht)
|
||||
@@ -849,10 +851,32 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
|
||||
*arg = skipwhite_and_linebreak(*arg + 1, evalarg);
|
||||
while (**arg != '}' && **arg != NUL)
|
||||
{
|
||||
if ((literal
|
||||
? get_literal_key(arg, &tvkey)
|
||||
: eval1(arg, &tvkey, evalarg)) == FAIL) // recursive!
|
||||
goto failret;
|
||||
char_u *p = to_name_end(*arg, FALSE);
|
||||
|
||||
if (literal || (vim9script && *p == ':'))
|
||||
{
|
||||
if (get_literal_key(arg, &tvkey) == FAIL)
|
||||
goto failret;
|
||||
}
|
||||
else
|
||||
{
|
||||
int has_bracket = vim9script && **arg == '[';
|
||||
|
||||
if (has_bracket)
|
||||
*arg = skipwhite(*arg + 1);
|
||||
if (eval1(arg, &tvkey, evalarg) == FAIL) // recursive!
|
||||
goto failret;
|
||||
if (has_bracket)
|
||||
{
|
||||
*arg = skipwhite(*arg);
|
||||
if (**arg != ']')
|
||||
{
|
||||
emsg(_(e_missing_matching_bracket_after_dict_key));
|
||||
return FAIL;
|
||||
}
|
||||
++*arg;
|
||||
}
|
||||
}
|
||||
|
||||
// the colon should come right after the key, but this wasn't checked
|
||||
// previously, so only require it in Vim9 script.
|
||||
@@ -950,7 +974,7 @@ failret:
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
*arg = skipwhite(*arg + 1);
|
||||
*arg = *arg + 1;
|
||||
if (evaluate)
|
||||
rettv_dict_set(rettv, d);
|
||||
|
||||
|
||||
20
src/diff.c
20
src/diff.c
@@ -775,7 +775,7 @@ diff_write(buf_T *buf, diffin_T *din)
|
||||
{
|
||||
int r;
|
||||
char_u *save_ff;
|
||||
int save_lockmarks;
|
||||
int save_cmod_flags;
|
||||
|
||||
if (din->din_fname == NULL)
|
||||
return diff_write_buffer(buf, din);
|
||||
@@ -783,14 +783,14 @@ diff_write(buf_T *buf, diffin_T *din)
|
||||
// Always use 'fileformat' set to "unix".
|
||||
save_ff = buf->b_p_ff;
|
||||
buf->b_p_ff = vim_strsave((char_u *)FF_UNIX);
|
||||
save_lockmarks = cmdmod.lockmarks;
|
||||
save_cmod_flags = cmdmod.cmod_flags;
|
||||
// Writing the buffer is an implementation detail of performing the diff,
|
||||
// so it shouldn't update the '[ and '] marks.
|
||||
cmdmod.lockmarks = TRUE;
|
||||
cmdmod.cmod_flags |= CMOD_LOCKMARKS;
|
||||
r = buf_write(buf, din->din_fname, NULL,
|
||||
(linenr_T)1, buf->b_ml.ml_line_count,
|
||||
NULL, FALSE, FALSE, FALSE, TRUE);
|
||||
cmdmod.lockmarks = save_lockmarks;
|
||||
cmdmod.cmod_flags = save_cmod_flags;
|
||||
free_string_option(buf->b_p_ff);
|
||||
buf->b_p_ff = save_ff;
|
||||
return r;
|
||||
@@ -1187,13 +1187,13 @@ ex_diffpatch(exarg_T *eap)
|
||||
#endif
|
||||
#ifdef FEAT_BROWSE
|
||||
char_u *browseFile = NULL;
|
||||
int browse_flag = cmdmod.browse;
|
||||
int save_cmod_flags = cmdmod.cmod_flags;
|
||||
#endif
|
||||
stat_T st;
|
||||
char_u *esc_name = NULL;
|
||||
|
||||
#ifdef FEAT_BROWSE
|
||||
if (cmdmod.browse)
|
||||
if (cmdmod.cmod_flags & CMOD_BROWSE)
|
||||
{
|
||||
browseFile = do_browse(0, (char_u *)_("Patch file"),
|
||||
eap->arg, NULL, NULL,
|
||||
@@ -1201,7 +1201,7 @@ ex_diffpatch(exarg_T *eap)
|
||||
if (browseFile == NULL)
|
||||
return; // operation cancelled
|
||||
eap->arg = browseFile;
|
||||
cmdmod.browse = FALSE; // don't let do_ecmd() browse again
|
||||
cmdmod.cmod_flags &= ~CMOD_BROWSE; // don't let do_ecmd() browse again
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1310,7 +1310,7 @@ ex_diffpatch(exarg_T *eap)
|
||||
need_mouse_correct = TRUE;
|
||||
#endif
|
||||
// don't use a new tab page, each tab page has its own diffs
|
||||
cmdmod.tab = 0;
|
||||
cmdmod.cmod_tab = 0;
|
||||
|
||||
if (win_split(0, (diff_flags & DIFF_VERTICAL) ? WSP_VERT : 0) != FAIL)
|
||||
{
|
||||
@@ -1355,7 +1355,7 @@ theend:
|
||||
vim_free(esc_name);
|
||||
#ifdef FEAT_BROWSE
|
||||
vim_free(browseFile);
|
||||
cmdmod.browse = browse_flag;
|
||||
cmdmod.cmod_flags = save_cmod_flags;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1377,7 +1377,7 @@ ex_diffsplit(exarg_T *eap)
|
||||
set_fraction(curwin);
|
||||
|
||||
// don't use a new tab page, each tab page has its own diffs
|
||||
cmdmod.tab = 0;
|
||||
cmdmod.cmod_tab = 0;
|
||||
|
||||
if (win_split(0, (diff_flags & DIFF_VERTICAL) ? WSP_VERT : 0) != FAIL)
|
||||
{
|
||||
|
||||
@@ -641,7 +641,7 @@ win_line(
|
||||
else
|
||||
tocol = MAXCOL;
|
||||
// do at least one character; happens when past end of line
|
||||
if (fromcol == tocol)
|
||||
if (fromcol == tocol && search_match_endcol)
|
||||
tocol = fromcol + 1;
|
||||
area_highlighting = TRUE;
|
||||
vi_attr = HL_ATTR(HLF_I);
|
||||
@@ -1873,6 +1873,7 @@ win_line(
|
||||
char_u *prev_ptr, *p;
|
||||
int len;
|
||||
hlf_T spell_hlf = HLF_COUNT;
|
||||
|
||||
if (has_mbyte)
|
||||
{
|
||||
prev_ptr = ptr - mb_l;
|
||||
@@ -2445,15 +2446,18 @@ win_line(
|
||||
&& conceal_cursor_line(wp)
|
||||
&& (int)wp->w_virtcol <= vcol + n_skip)
|
||||
{
|
||||
# ifdef FEAT_RIGHTLEFT
|
||||
# ifdef FEAT_RIGHTLEFT
|
||||
if (wp->w_p_rl)
|
||||
wp->w_wcol = wp->w_width - col + boguscols - 1;
|
||||
else
|
||||
# endif
|
||||
# endif
|
||||
wp->w_wcol = col - boguscols;
|
||||
wp->w_wrow = row;
|
||||
did_wcol = TRUE;
|
||||
curwin->w_valid |= VALID_WCOL|VALID_WROW|VALID_VIRTCOL;
|
||||
# ifdef FEAT_PROP_POPUP
|
||||
curwin->w_flags &= ~(WFLAG_WCOL_OFF_ADDED | WFLAG_WROW_OFF_ADDED);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2778,10 +2782,14 @@ win_line(
|
||||
// Also highlight the 'colorcolumn' if 'breakindent' and/or 'showbreak'
|
||||
// options are set
|
||||
vcol_save_attr = -1;
|
||||
if ((draw_state == WL_LINE ||
|
||||
if (((draw_state == WL_LINE ||
|
||||
draw_state == WL_BRI ||
|
||||
draw_state == WL_SBR) && !lnum_in_visual_area
|
||||
&& search_attr == 0 && area_attr == 0)
|
||||
# ifdef FEAT_DIFF
|
||||
&& filler_todo <= 0
|
||||
# endif
|
||||
)
|
||||
{
|
||||
if (wp->w_p_cuc && VCOL_HLC == (long)wp->w_virtcol
|
||||
&& lnum != wp->w_cursor.lnum)
|
||||
|
||||
18
src/edit.c
18
src/edit.c
@@ -1031,6 +1031,15 @@ doESCkey:
|
||||
case K_IGNORE: // Something mapped to nothing
|
||||
break;
|
||||
|
||||
case K_COMMAND: // <Cmd>command<CR>
|
||||
do_cmdline(NULL, getcmdkeycmd, NULL, 0);
|
||||
#ifdef FEAT_TERMINAL
|
||||
if (term_use_loop())
|
||||
// Started a terminal that gets the input, exit Insert mode.
|
||||
goto doESCkey;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case K_CURSORHOLD: // Didn't type something for a while.
|
||||
ins_apply_autocmds(EVENT_CURSORHOLDI);
|
||||
did_cursorhold = TRUE;
|
||||
@@ -3616,7 +3625,7 @@ ins_esc(
|
||||
curwin->w_set_curswant = TRUE;
|
||||
|
||||
// Remember the last Insert position in the '^ mark.
|
||||
if (!cmdmod.keepjumps)
|
||||
if ((cmdmod.cmod_flags & CMOD_KEEPJUMPS) == 0)
|
||||
curbuf->b_last_insert = curwin->w_cursor;
|
||||
|
||||
/*
|
||||
@@ -3946,8 +3955,11 @@ ins_bs(
|
||||
#endif
|
||||
((curwin->w_cursor.lnum == 1 && curwin->w_cursor.col == 0)
|
||||
|| (!can_bs(BS_START)
|
||||
&& (arrow_used
|
||||
|| (curwin->w_cursor.lnum == Insstart_orig.lnum
|
||||
&& ((arrow_used
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
&& !bt_prompt(curbuf)
|
||||
#endif
|
||||
) || (curwin->w_cursor.lnum == Insstart_orig.lnum
|
||||
&& curwin->w_cursor.col <= Insstart_orig.col)))
|
||||
|| (!can_bs(BS_INDENT) && !arrow_used && ai_col > 0
|
||||
&& curwin->w_cursor.col <= ai_col)
|
||||
|
||||
32
src/errors.h
32
src/errors.h
@@ -21,14 +21,18 @@ EXTERN char e_invalid_command[]
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char e_invalid_command_str[]
|
||||
INIT(= N_("E476: Invalid command: %s"));
|
||||
EXTERN char e_list_value_has_more_items_than_targets[]
|
||||
INIT(= N_("E710: List value has more items than targets"));
|
||||
EXTERN char e_list_value_does_not_have_enough_items[]
|
||||
INIT(= N_("E711: List value does not have enough items"));
|
||||
EXTERN char e_cannot_slice_dictionary[]
|
||||
INIT(= N_("E719: Cannot slice a Dictionary"));
|
||||
EXTERN char e_assert_fails_second_arg[]
|
||||
INIT(= N_("E856: \"assert_fails()\" second argument must be a string or a list with one or two strings"));
|
||||
EXTERN char e_cannot_index_special_variable[]
|
||||
INIT(= N_("E909: Cannot index a special variable"));
|
||||
EXTERN char e_missing_let_str[]
|
||||
INIT(= N_("E1100: Missing :let: %s"));
|
||||
EXTERN char e_missing_var_str[]
|
||||
INIT(= N_("E1100: Missing :var: %s"));
|
||||
EXTERN char e_variable_not_found_str[]
|
||||
INIT(= N_("E1001: Variable not found: %s"));
|
||||
EXTERN char e_syntax_error_at_str[]
|
||||
@@ -89,8 +93,8 @@ EXTERN char e_compiling_def_function_failed[]
|
||||
INIT(= N_("E1028: Compiling :def function failed"));
|
||||
EXTERN char e_expected_str_but_got_str[]
|
||||
INIT(= N_("E1029: Expected %s but got %s"));
|
||||
EXTERN char e_using_string_as_number[]
|
||||
INIT(= N_("E1030: Using a String as a Number"));
|
||||
EXTERN char e_using_string_as_number_str[]
|
||||
INIT(= N_("E1030: Using a String as a Number: \"%s\""));
|
||||
EXTERN char e_cannot_use_void_value[]
|
||||
INIT(= N_("E1031: Cannot use void value"));
|
||||
EXTERN char e_missing_catch_or_finally[]
|
||||
@@ -286,4 +290,24 @@ EXTERN char e_cannot_add_to_null_list[]
|
||||
INIT(= N_("E1130: Cannot add to null list"));
|
||||
EXTERN char e_cannot_add_to_null_blob[]
|
||||
INIT(= N_("E1131: Cannot add to null blob"));
|
||||
EXTERN char e_missing_function_argument[]
|
||||
INIT(= N_("E1132: Missing function argument"));
|
||||
EXTERN char e_cannot_extend_null_dict[]
|
||||
INIT(= N_("E1133: Cannot extend a null dict"));
|
||||
EXTERN char e_cannot_extend_null_list[]
|
||||
INIT(= N_("E1134: Cannot extend a null list"));
|
||||
EXTERN char e_using_string_as_bool_str[]
|
||||
INIT(= N_("E1135: Using a String as a Bool: \"%s\""));
|
||||
#endif
|
||||
EXTERN char e_cmd_mapping_must_end_with_cr[]
|
||||
INIT(=N_("E1135: <Cmd> mapping must end with <CR>"));
|
||||
EXTERN char e_cmd_mapping_must_end_with_cr_before_second_cmd[]
|
||||
INIT(=N_("E1136: <Cmd> mapping must end with <CR> before second <Cmd>"));
|
||||
EXTERN char e_cmd_maping_must_not_include_str_key[]
|
||||
INIT(= N_("E1137: <Cmd> mapping must not include %s key"));
|
||||
EXTERN char e_using_bool_as_number[]
|
||||
INIT(= N_("E1138: Using a Bool as a 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"));
|
||||
|
||||
57
src/eval.c
57
src/eval.c
@@ -368,12 +368,12 @@ eval_to_string_skip(
|
||||
* Return FAIL for an error, OK otherwise.
|
||||
*/
|
||||
int
|
||||
skip_expr(char_u **pp)
|
||||
skip_expr(char_u **pp, evalarg_T *evalarg)
|
||||
{
|
||||
typval_T rettv;
|
||||
|
||||
*pp = skipwhite(*pp);
|
||||
return eval1(pp, &rettv, NULL);
|
||||
return eval1(pp, &rettv, evalarg);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -474,9 +474,10 @@ skip_expr_concatenate(
|
||||
* Return pointer to allocated memory, or NULL for failure.
|
||||
*/
|
||||
char_u *
|
||||
eval_to_string(
|
||||
eval_to_string_eap(
|
||||
char_u *arg,
|
||||
int convert)
|
||||
int convert,
|
||||
exarg_T *eap)
|
||||
{
|
||||
typval_T tv;
|
||||
char_u *retval;
|
||||
@@ -484,8 +485,10 @@ eval_to_string(
|
||||
#ifdef FEAT_FLOAT
|
||||
char_u numbuf[NUMBUFLEN];
|
||||
#endif
|
||||
evalarg_T evalarg;
|
||||
|
||||
if (eval0(arg, &tv, NULL, &EVALARG_EVALUATE) == FAIL)
|
||||
fill_evalarg_from_eap(&evalarg, eap, eap != NULL && eap->skip);
|
||||
if (eval0(arg, &tv, NULL, &evalarg) == FAIL)
|
||||
retval = NULL;
|
||||
else
|
||||
{
|
||||
@@ -512,11 +515,19 @@ eval_to_string(
|
||||
retval = vim_strsave(tv_get_string(&tv));
|
||||
clear_tv(&tv);
|
||||
}
|
||||
clear_evalarg(&EVALARG_EVALUATE, NULL);
|
||||
clear_evalarg(&evalarg, NULL);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
char_u *
|
||||
eval_to_string(
|
||||
char_u *arg,
|
||||
int convert)
|
||||
{
|
||||
return eval_to_string_eap(arg, convert, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Call eval_to_string() without using current local variables and using
|
||||
* textwinlock. When "use_sandbox" is TRUE use the sandbox.
|
||||
@@ -780,7 +791,7 @@ get_lval(
|
||||
listitem_T *ni;
|
||||
char_u *key = NULL;
|
||||
int len;
|
||||
hashtab_T *ht;
|
||||
hashtab_T *ht = NULL;
|
||||
int quiet = flags & GLV_QUIET;
|
||||
|
||||
// Clear everything in "lp".
|
||||
@@ -1386,11 +1397,11 @@ set_var_lval(
|
||||
++lp->ll_n1;
|
||||
}
|
||||
if (ri != NULL)
|
||||
emsg(_("E710: List value has more items than target"));
|
||||
emsg(_(e_list_value_has_more_items_than_targets));
|
||||
else if (lp->ll_empty2
|
||||
? (lp->ll_li != NULL && lp->ll_li->li_next != NULL)
|
||||
: lp->ll_n1 != lp->ll_n2)
|
||||
emsg(_("E711: List value has not enough items"));
|
||||
emsg(_(e_list_value_does_not_have_enough_items));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2679,6 +2690,9 @@ eval4(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make a copy of blob "tv1" and append blob "tv2".
|
||||
*/
|
||||
void
|
||||
eval_addblob(typval_T *tv1, typval_T *tv2)
|
||||
{
|
||||
@@ -2699,6 +2713,9 @@ eval_addblob(typval_T *tv1, typval_T *tv2)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Make a copy of list "tv1" and append list "tv2".
|
||||
*/
|
||||
int
|
||||
eval_addlist(typval_T *tv1, typval_T *tv2)
|
||||
{
|
||||
@@ -2777,8 +2794,10 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
|
||||
#ifdef FEAT_FLOAT
|
||||
&& (op == '.' || rettv->v_type != VAR_FLOAT)
|
||||
#endif
|
||||
)
|
||||
&& evaluate)
|
||||
{
|
||||
int error = FALSE;
|
||||
|
||||
// For "list + ...", an illegal use of the first operand as
|
||||
// a number cannot be determined before evaluating the 2nd
|
||||
// operand: if this is also a list, all is ok.
|
||||
@@ -2786,7 +2805,9 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
|
||||
// we know that the first operand needs to be a string or number
|
||||
// without evaluating the 2nd operand. So check before to avoid
|
||||
// side effects after an error.
|
||||
if (evaluate && tv_get_string_chk(rettv) == NULL)
|
||||
if (op != '.')
|
||||
tv_get_number_chk(rettv, &error);
|
||||
if ((op == '.' && tv_get_string_chk(rettv) == NULL) || error)
|
||||
{
|
||||
clear_tv(rettv);
|
||||
return FAIL;
|
||||
@@ -3245,7 +3266,7 @@ eval7(
|
||||
* Lambda: {arg, arg -> expr}
|
||||
* Dictionary: {'key': val, 'key': val}
|
||||
*/
|
||||
case '{': ret = get_lambda_tv(arg, rettv, evalarg);
|
||||
case '{': ret = get_lambda_tv(arg, rettv, FALSE, evalarg);
|
||||
if (ret == NOTDONE)
|
||||
ret = eval_dict(arg, rettv, evalarg, FALSE);
|
||||
break;
|
||||
@@ -3417,7 +3438,15 @@ eval7_leader(
|
||||
}
|
||||
#ifdef FEAT_FLOAT
|
||||
if (rettv->v_type == VAR_FLOAT)
|
||||
f = !f;
|
||||
{
|
||||
if (in_vim9script())
|
||||
{
|
||||
rettv->v_type = VAR_BOOL;
|
||||
val = f == 0.0 ? VVAL_TRUE : VVAL_FALSE;
|
||||
}
|
||||
else
|
||||
f = !f;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
@@ -3533,7 +3562,7 @@ eval_lambda(
|
||||
*arg += 2;
|
||||
rettv->v_type = VAR_UNKNOWN;
|
||||
|
||||
ret = get_lambda_tv(arg, rettv, evalarg);
|
||||
ret = get_lambda_tv(arg, rettv, FALSE, evalarg);
|
||||
if (ret != OK)
|
||||
return FAIL;
|
||||
else if (**arg != '(')
|
||||
|
||||
@@ -717,17 +717,19 @@ get_buffer_lines(
|
||||
void
|
||||
f_getbufline(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
linenr_T lnum;
|
||||
linenr_T end;
|
||||
linenr_T lnum = 1;
|
||||
linenr_T end = 1;
|
||||
buf_T *buf;
|
||||
|
||||
buf = tv_get_buf_from_arg(&argvars[0]);
|
||||
|
||||
lnum = tv_get_lnum_buf(&argvars[1], buf);
|
||||
if (argvars[2].v_type == VAR_UNKNOWN)
|
||||
end = lnum;
|
||||
else
|
||||
end = tv_get_lnum_buf(&argvars[2], buf);
|
||||
if (buf != NULL)
|
||||
{
|
||||
lnum = tv_get_lnum_buf(&argvars[1], buf);
|
||||
if (argvars[2].v_type == VAR_UNKNOWN)
|
||||
end = lnum;
|
||||
else
|
||||
end = tv_get_lnum_buf(&argvars[2], buf);
|
||||
}
|
||||
|
||||
get_buffer_lines(buf, lnum, end, TRUE, rettv);
|
||||
}
|
||||
|
||||
163
src/evalfunc.c
163
src/evalfunc.c
@@ -276,6 +276,9 @@ typedef struct {
|
||||
// E.g. if "arg_idx" is 1, then (type - 1) is the first argument type.
|
||||
typedef int (*argcheck_T)(type_T *, argcontext_T *);
|
||||
|
||||
/*
|
||||
* Check "type" is a float or a number.
|
||||
*/
|
||||
static int
|
||||
arg_float_or_nr(type_T *type, argcontext_T *context)
|
||||
{
|
||||
@@ -286,12 +289,27 @@ arg_float_or_nr(type_T *type, argcontext_T *context)
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check "type" is a number.
|
||||
*/
|
||||
static int
|
||||
arg_number(type_T *type, argcontext_T *context)
|
||||
{
|
||||
return check_type(&t_number, type, TRUE, context->arg_idx + 1);
|
||||
return check_arg_type(&t_number, type, context->arg_idx + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check "type" is a string.
|
||||
*/
|
||||
static int
|
||||
arg_string(type_T *type, argcontext_T *context)
|
||||
{
|
||||
return check_arg_type(&t_string, type, context->arg_idx + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check "type" is a list or a blob.
|
||||
*/
|
||||
static int
|
||||
arg_list_or_blob(type_T *type, argcontext_T *context)
|
||||
{
|
||||
@@ -303,7 +321,32 @@ arg_list_or_blob(type_T *type, argcontext_T *context)
|
||||
}
|
||||
|
||||
/*
|
||||
* Check the type is an item of the list or blob of the previous arg.
|
||||
* Check "type" is a list or a dict.
|
||||
*/
|
||||
static int
|
||||
arg_list_or_dict(type_T *type, argcontext_T *context)
|
||||
{
|
||||
if (type->tt_type == VAR_ANY
|
||||
|| type->tt_type == VAR_LIST || type->tt_type == VAR_DICT)
|
||||
return OK;
|
||||
arg_type_mismatch(&t_list_any, type, context->arg_idx + 1);
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check "type" is the same type as the previous argument
|
||||
* Must not be used for the first argcheck_T entry.
|
||||
*/
|
||||
static int
|
||||
arg_same_as_prev(type_T *type, argcontext_T *context)
|
||||
{
|
||||
type_T *prev_type = context->arg_types[context->arg_idx - 1];
|
||||
|
||||
return check_arg_type(prev_type, type, context->arg_idx + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check "type" is an item of the list or blob of the previous arg.
|
||||
* Must not be used for the first argcheck_T entry.
|
||||
*/
|
||||
static int
|
||||
@@ -320,17 +363,36 @@ arg_item_of_prev(type_T *type, argcontext_T *context)
|
||||
// probably VAR_ANY, can't check
|
||||
return OK;
|
||||
|
||||
return check_type(expected, type, TRUE, context->arg_idx + 1);
|
||||
return check_arg_type(expected, type, context->arg_idx + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check "type" which is the third argument of extend().
|
||||
*/
|
||||
static int
|
||||
arg_extend3(type_T *type, argcontext_T *context)
|
||||
{
|
||||
type_T *first_type = context->arg_types[context->arg_idx - 2];
|
||||
|
||||
if (first_type->tt_type == VAR_LIST)
|
||||
return arg_number(type, context);
|
||||
if (first_type->tt_type == VAR_DICT)
|
||||
return arg_string(type, context);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Lists of functions that check the argument types of a builtin function.
|
||||
*/
|
||||
argcheck_T arg1_float_or_nr[] = {arg_float_or_nr};
|
||||
argcheck_T arg2_listblob_item[] = {arg_list_or_blob, arg_item_of_prev};
|
||||
argcheck_T arg23_extend[] = {arg_list_or_dict, arg_same_as_prev, arg_extend3};
|
||||
argcheck_T arg3_insert[] = {arg_list_or_blob, arg_item_of_prev, arg_number};
|
||||
|
||||
/*
|
||||
* Functions that return the return type of a builtin function.
|
||||
* Note that "argtypes" is NULL if "argcount" is zero.
|
||||
*/
|
||||
static type_T *
|
||||
ret_void(int argcount UNUSED, type_T **argtypes UNUSED)
|
||||
@@ -417,7 +479,6 @@ ret_job(int argcount UNUSED, type_T **argtypes UNUSED)
|
||||
{
|
||||
return &t_job;
|
||||
}
|
||||
|
||||
static type_T *
|
||||
ret_first_arg(int argcount, type_T **argtypes)
|
||||
{
|
||||
@@ -425,6 +486,18 @@ ret_first_arg(int argcount, type_T **argtypes)
|
||||
return argtypes[0];
|
||||
return &t_void;
|
||||
}
|
||||
// for map(): returns first argument but item type may differ
|
||||
static type_T *
|
||||
ret_first_cont(int argcount UNUSED, type_T **argtypes)
|
||||
{
|
||||
if (argtypes[0]->tt_type == VAR_LIST)
|
||||
return &t_list_any;
|
||||
if (argtypes[0]->tt_type == VAR_DICT)
|
||||
return &t_dict_any;
|
||||
if (argtypes[0]->tt_type == VAR_BLOB)
|
||||
return argtypes[0];
|
||||
return &t_any;
|
||||
}
|
||||
|
||||
/*
|
||||
* Used for getqflist(): returns list if there is no argument, dict if there is
|
||||
@@ -566,7 +639,7 @@ static funcentry_T global_functions[] =
|
||||
ret_any, FLOAT_FUNC(f_abs)},
|
||||
{"acos", 1, 1, FEARG_1, NULL,
|
||||
ret_float, FLOAT_FUNC(f_acos)},
|
||||
{"add", 2, 2, FEARG_1, NULL,
|
||||
{"add", 2, 2, FEARG_1, NULL /* arg2_listblob_item */,
|
||||
ret_first_arg, f_add},
|
||||
{"and", 2, 2, FEARG_1, NULL,
|
||||
ret_number, f_and},
|
||||
@@ -792,7 +865,7 @@ static funcentry_T global_functions[] =
|
||||
ret_any, f_expand},
|
||||
{"expandcmd", 1, 1, FEARG_1, NULL,
|
||||
ret_string, f_expandcmd},
|
||||
{"extend", 2, 3, FEARG_1, NULL,
|
||||
{"extend", 2, 3, FEARG_1, arg23_extend,
|
||||
ret_first_arg, f_extend},
|
||||
{"feedkeys", 1, 2, FEARG_1, NULL,
|
||||
ret_void, f_feedkeys},
|
||||
@@ -1053,11 +1126,13 @@ static funcentry_T global_functions[] =
|
||||
#endif
|
||||
},
|
||||
{"map", 2, 2, FEARG_1, NULL,
|
||||
ret_any, f_map},
|
||||
ret_first_cont, f_map},
|
||||
{"maparg", 1, 4, FEARG_1, NULL,
|
||||
ret_maparg, f_maparg},
|
||||
{"mapcheck", 1, 3, FEARG_1, NULL,
|
||||
ret_string, f_mapcheck},
|
||||
{"mapnew", 2, 2, FEARG_1, NULL,
|
||||
ret_first_cont, f_mapnew},
|
||||
{"mapset", 3, 3, FEARG_1, NULL,
|
||||
ret_void, f_mapset},
|
||||
{"match", 2, 4, FEARG_1, NULL,
|
||||
@@ -1825,6 +1900,11 @@ internal_func_check_arg_types(type_T **types, int idx, int argcount)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Call the "f_retfunc" function to obtain the return type of function "idx".
|
||||
* "argtypes" is the list of argument types or NULL when there are no
|
||||
* arguments.
|
||||
*/
|
||||
type_T *
|
||||
internal_func_ret_type(int idx, int argcount, type_T **argtypes)
|
||||
{
|
||||
@@ -5416,6 +5496,73 @@ f_has(typval_T *argvars, typval_T *rettv)
|
||||
rettv->vval.v_number = n;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "feature" can change later.
|
||||
* Also when checking for the feature has side effects, such as loading a DLL.
|
||||
*/
|
||||
int
|
||||
dynamic_feature(char_u *feature)
|
||||
{
|
||||
return (feature == NULL
|
||||
#if defined(FEAT_BEVAL) && defined(FEAT_GUI_MSWIN)
|
||||
|| STRICMP(feature, "balloon_multiline") == 0
|
||||
#endif
|
||||
#if defined(FEAT_GUI) && defined(FEAT_BROWSE)
|
||||
|| (STRICMP(feature, "browse") == 0 && !gui.in_use)
|
||||
#endif
|
||||
#ifdef VIMDLL
|
||||
|| STRICMP(feature, "filterpipe") == 0
|
||||
#endif
|
||||
#if defined(FEAT_GUI) && !defined(ALWAYS_USE_GUI) && !defined(VIMDLL)
|
||||
// this can only change on Unix where the ":gui" command could be
|
||||
// used.
|
||||
|| (STRICMP(feature, "gui_running") == 0 && !gui.in_use)
|
||||
#endif
|
||||
#if defined(USE_ICONV) && defined(DYNAMIC_ICONV)
|
||||
|| STRICMP(feature, "iconv") == 0
|
||||
#endif
|
||||
#ifdef DYNAMIC_LUA
|
||||
|| STRICMP(feature, "lua") == 0
|
||||
#endif
|
||||
#ifdef FEAT_MOUSE_GPM
|
||||
|| (STRICMP(feature, "mouse_gpm_enabled") == 0 && !gpm_enabled())
|
||||
#endif
|
||||
#ifdef DYNAMIC_MZSCHEME
|
||||
|| STRICMP(feature, "mzscheme") == 0
|
||||
#endif
|
||||
#ifdef FEAT_NETBEANS_INTG
|
||||
|| STRICMP(feature, "netbeans_enabled") == 0
|
||||
#endif
|
||||
#ifdef DYNAMIC_PERL
|
||||
|| STRICMP(feature, "perl") == 0
|
||||
#endif
|
||||
#ifdef DYNAMIC_PYTHON
|
||||
|| STRICMP(feature, "python") == 0
|
||||
#endif
|
||||
#ifdef DYNAMIC_PYTHON3
|
||||
|| STRICMP(feature, "python3") == 0
|
||||
#endif
|
||||
#if defined(DYNAMIC_PYTHON) || defined(DYNAMIC_PYTHON3)
|
||||
|| STRICMP(feature, "pythonx") == 0
|
||||
#endif
|
||||
#ifdef DYNAMIC_RUBY
|
||||
|| STRICMP(feature, "ruby") == 0
|
||||
#endif
|
||||
#ifdef FEAT_SYN_HL
|
||||
|| STRICMP(feature, "syntax_items") == 0
|
||||
#endif
|
||||
#ifdef DYNAMIC_TCL
|
||||
|| STRICMP(feature, "tcl") == 0
|
||||
#endif
|
||||
// once "starting" is zero it will stay that way
|
||||
|| (STRICMP(feature, "vim_starting") == 0 && starting != 0)
|
||||
|| STRICMP(feature, "multi_byte_encoding") == 0
|
||||
#if defined(FEAT_TERMINAL) && defined(MSWIN)
|
||||
|| STRICMP(feature, "conpty") == 0
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
* "haslocaldir()" function
|
||||
*/
|
||||
@@ -6806,7 +6953,7 @@ f_rand(typval_T *argvars, typval_T *rettv)
|
||||
static UINT32_T gx, gy, gz, gw;
|
||||
static int initialized = FALSE;
|
||||
listitem_T *lx, *ly, *lz, *lw;
|
||||
UINT32_T x, y, z, w, t, result;
|
||||
UINT32_T x = 0, y, z, w, t, result;
|
||||
|
||||
if (argvars[0].v_type == VAR_UNKNOWN)
|
||||
{
|
||||
|
||||
@@ -146,7 +146,6 @@ static struct vimvar
|
||||
{VV_NAME("echospace", VAR_NUMBER), VV_RO},
|
||||
{VV_NAME("argv", VAR_LIST), VV_RO},
|
||||
{VV_NAME("collate", VAR_STRING), VV_RO},
|
||||
{VV_NAME("disallow_let", VAR_NUMBER), 0}, // TODO: remove
|
||||
};
|
||||
|
||||
// shorthand
|
||||
@@ -243,9 +242,6 @@ evalvars_init(void)
|
||||
|
||||
set_vim_var_nr(VV_ECHOSPACE, sc_col - 1);
|
||||
|
||||
// TODO: remove later
|
||||
set_vim_var_nr(VV_DISALLOW_LET, 1);
|
||||
|
||||
// Default for v:register is not 0 but '"'. This is adjusted once the
|
||||
// clipboard has been setup by calling reset_reg_var().
|
||||
set_reg_var(0);
|
||||
@@ -749,8 +745,7 @@ ex_let(exarg_T *eap)
|
||||
ex_finally(eap);
|
||||
return;
|
||||
}
|
||||
if (get_vim_var_nr(VV_DISALLOW_LET)
|
||||
&& eap->cmdidx == CMD_let && vim9script)
|
||||
if (eap->cmdidx == CMD_let && vim9script)
|
||||
{
|
||||
emsg(_(e_cannot_use_let_in_vim9_script));
|
||||
return;
|
||||
@@ -1986,7 +1981,13 @@ get_user_var_name(expand_T *xp, int idx)
|
||||
}
|
||||
|
||||
// b: variables
|
||||
ht = &curbuf->b_vars->dv_hashtab;
|
||||
ht =
|
||||
#ifdef FEAT_CMDWIN
|
||||
// In cmdwin, the alternative buffer should be used.
|
||||
(cmdwin_type != 0 && get_cmdline_type() == NUL) ?
|
||||
&prevwin->w_buffer->b_vars->dv_hashtab :
|
||||
#endif
|
||||
&curbuf->b_vars->dv_hashtab;
|
||||
if (bdone < ht->ht_used)
|
||||
{
|
||||
if (bdone++ == 0)
|
||||
@@ -1999,7 +2000,13 @@ get_user_var_name(expand_T *xp, int idx)
|
||||
}
|
||||
|
||||
// w: variables
|
||||
ht = &curwin->w_vars->dv_hashtab;
|
||||
ht =
|
||||
#ifdef FEAT_CMDWIN
|
||||
// In cmdwin, the alternative window should be used.
|
||||
(cmdwin_type != 0 && get_cmdline_type() == NUL) ?
|
||||
&prevwin->w_vars->dv_hashtab :
|
||||
#endif
|
||||
&curwin->w_vars->dv_hashtab;
|
||||
if (wdone < ht->ht_used)
|
||||
{
|
||||
if (wdone++ == 0)
|
||||
@@ -2546,7 +2553,22 @@ eval_variable(
|
||||
ret = FAIL;
|
||||
}
|
||||
else if (rettv != NULL)
|
||||
{
|
||||
// If a list or dict variable wasn't initialized, do it now.
|
||||
if (tv->v_type == VAR_DICT && tv->vval.v_dict == NULL)
|
||||
{
|
||||
tv->vval.v_dict = dict_alloc();
|
||||
if (tv->vval.v_dict != NULL)
|
||||
++tv->vval.v_dict->dv_refcount;
|
||||
}
|
||||
else if (tv->v_type == VAR_LIST && tv->vval.v_list == NULL)
|
||||
{
|
||||
tv->vval.v_list = list_alloc();
|
||||
if (tv->vval.v_list != NULL)
|
||||
++tv->vval.v_list->lv_refcount;
|
||||
}
|
||||
copy_tv(tv, rettv);
|
||||
}
|
||||
}
|
||||
|
||||
name[len] = cc;
|
||||
@@ -2606,7 +2628,28 @@ find_var(char_u *name, hashtab_T **htp, int no_autoload)
|
||||
return ret;
|
||||
|
||||
// Search in parent scope for lambda
|
||||
return find_var_in_scoped_ht(name, no_autoload || htp != NULL);
|
||||
ret = find_var_in_scoped_ht(name, no_autoload || htp != NULL);
|
||||
if (ret != NULL)
|
||||
return ret;
|
||||
|
||||
// in Vim9 script items without a scope can be script-local
|
||||
if (in_vim9script() && name[0] != NUL && name[1] != ':')
|
||||
{
|
||||
ht = get_script_local_ht();
|
||||
if (ht != NULL)
|
||||
{
|
||||
ret = find_var_in_ht(ht, *name, varname,
|
||||
no_autoload || htp != NULL);
|
||||
if (ret != NULL)
|
||||
{
|
||||
if (htp != NULL)
|
||||
*htp = ht;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3582,9 +3625,11 @@ var_redir_start(char_u *name, int append)
|
||||
tv.v_type = VAR_STRING;
|
||||
tv.vval.v_string = (char_u *)"";
|
||||
if (append)
|
||||
set_var_lval(redir_lval, redir_endp, &tv, TRUE, 0, (char_u *)".");
|
||||
set_var_lval(redir_lval, redir_endp, &tv, TRUE,
|
||||
ASSIGN_NO_DECL, (char_u *)".");
|
||||
else
|
||||
set_var_lval(redir_lval, redir_endp, &tv, TRUE, 0, (char_u *)"=");
|
||||
set_var_lval(redir_lval, redir_endp, &tv, TRUE,
|
||||
ASSIGN_NO_DECL, (char_u *)"=");
|
||||
clear_lval(redir_lval);
|
||||
if (called_emsg > called_emsg_before)
|
||||
{
|
||||
|
||||
@@ -7,30 +7,30 @@ static const unsigned short cmdidxs1[26] =
|
||||
{
|
||||
/* a */ 0,
|
||||
/* b */ 19,
|
||||
/* c */ 42,
|
||||
/* d */ 108,
|
||||
/* e */ 133,
|
||||
/* f */ 156,
|
||||
/* g */ 173,
|
||||
/* h */ 179,
|
||||
/* i */ 188,
|
||||
/* j */ 207,
|
||||
/* k */ 209,
|
||||
/* l */ 214,
|
||||
/* m */ 276,
|
||||
/* n */ 294,
|
||||
/* o */ 314,
|
||||
/* p */ 326,
|
||||
/* q */ 365,
|
||||
/* r */ 368,
|
||||
/* s */ 388,
|
||||
/* t */ 457,
|
||||
/* u */ 502,
|
||||
/* v */ 513,
|
||||
/* w */ 533,
|
||||
/* x */ 547,
|
||||
/* y */ 557,
|
||||
/* z */ 558
|
||||
/* c */ 43,
|
||||
/* d */ 109,
|
||||
/* e */ 134,
|
||||
/* f */ 157,
|
||||
/* g */ 174,
|
||||
/* h */ 180,
|
||||
/* i */ 189,
|
||||
/* j */ 208,
|
||||
/* k */ 210,
|
||||
/* l */ 215,
|
||||
/* m */ 277,
|
||||
/* n */ 295,
|
||||
/* o */ 315,
|
||||
/* p */ 327,
|
||||
/* q */ 366,
|
||||
/* r */ 369,
|
||||
/* s */ 389,
|
||||
/* t */ 458,
|
||||
/* u */ 503,
|
||||
/* v */ 514,
|
||||
/* w */ 534,
|
||||
/* x */ 548,
|
||||
/* y */ 558,
|
||||
/* z */ 559
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -42,7 +42,7 @@ static const unsigned short cmdidxs1[26] =
|
||||
static const unsigned char cmdidxs2[26][26] =
|
||||
{ /* a b c d e f g h i j k l m n o p q r s t u v w x y z */
|
||||
/* a */ { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 7, 15, 0, 16, 0, 0, 0, 0, 0 },
|
||||
/* b */ { 2, 0, 0, 4, 5, 7, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 0, 13, 0, 0, 0, 0, 22, 0, 0, 0 },
|
||||
/* b */ { 2, 0, 0, 5, 6, 8, 0, 0, 0, 0, 0, 9, 10, 11, 12, 13, 0, 14, 0, 0, 0, 0, 23, 0, 0, 0 },
|
||||
/* c */ { 3, 12, 16, 18, 20, 22, 25, 0, 0, 0, 0, 33, 37, 40, 46, 56, 58, 59, 60, 0, 62, 0, 65, 0, 0, 0 },
|
||||
/* d */ { 0, 0, 0, 0, 0, 0, 0, 0, 8, 18, 0, 19, 0, 0, 20, 0, 0, 22, 23, 0, 0, 0, 0, 0, 0, 0 },
|
||||
/* e */ { 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 10, 0, 0, 0, 0, 0, 0, 0, 17, 0, 18, 0, 0 },
|
||||
@@ -69,4 +69,4 @@ static const unsigned char cmdidxs2[26][26] =
|
||||
/* z */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const int command_count = 573;
|
||||
static const int command_count = 574;
|
||||
|
||||
113
src/ex_cmds.c
113
src/ex_cmds.c
@@ -277,6 +277,7 @@ linelen(int *has_tab)
|
||||
static char_u *sortbuf1;
|
||||
static char_u *sortbuf2;
|
||||
|
||||
static int sort_lc; // sort using locale
|
||||
static int sort_ic; // ignore case
|
||||
static int sort_nr; // sort on number
|
||||
static int sort_rx; // sort on regex instead of skipping it
|
||||
@@ -307,7 +308,13 @@ typedef struct
|
||||
} st_u;
|
||||
} sorti_T;
|
||||
|
||||
static int sort_compare(const void *s1, const void *s2);
|
||||
static int
|
||||
string_compare(const void *s1, const void *s2)
|
||||
{
|
||||
if (sort_lc)
|
||||
return strcoll((char *)s1, (char *)s2);
|
||||
return sort_ic ? STRICMP(s1, s2) : STRCMP(s1, s2);
|
||||
}
|
||||
|
||||
static int
|
||||
sort_compare(const void *s1, const void *s2)
|
||||
@@ -350,8 +357,7 @@ sort_compare(const void *s1, const void *s2)
|
||||
l2.st_u.line.end_col_nr - l2.st_u.line.start_col_nr + 1);
|
||||
sortbuf2[l2.st_u.line.end_col_nr - l2.st_u.line.start_col_nr] = 0;
|
||||
|
||||
result = sort_ic ? STRICMP(sortbuf1, sortbuf2)
|
||||
: STRCMP(sortbuf1, sortbuf2);
|
||||
result = string_compare(sortbuf1, sortbuf2);
|
||||
}
|
||||
|
||||
// If two lines have the same value, preserve the original line order.
|
||||
@@ -398,7 +404,7 @@ ex_sort(exarg_T *eap)
|
||||
if (nrs == NULL)
|
||||
goto sortend;
|
||||
|
||||
sort_abort = sort_ic = sort_rx = sort_nr = 0;
|
||||
sort_abort = sort_ic = sort_lc = sort_rx = sort_nr = 0;
|
||||
#ifdef FEAT_FLOAT
|
||||
sort_flt = 0;
|
||||
#endif
|
||||
@@ -409,6 +415,8 @@ ex_sort(exarg_T *eap)
|
||||
;
|
||||
else if (*p == 'i')
|
||||
sort_ic = TRUE;
|
||||
else if (*p == 'l')
|
||||
sort_lc = TRUE;
|
||||
else if (*p == 'r')
|
||||
sort_rx = TRUE;
|
||||
else if (*p == 'n')
|
||||
@@ -614,8 +622,7 @@ ex_sort(exarg_T *eap)
|
||||
change_occurred = TRUE;
|
||||
|
||||
s = ml_get(get_lnum);
|
||||
if (!unique || i == 0
|
||||
|| (sort_ic ? STRICMP(s, sortbuf1) : STRCMP(s, sortbuf1)) != 0)
|
||||
if (!unique || i == 0 || string_compare(s, sortbuf1) != 0)
|
||||
{
|
||||
// Copy the line into a buffer, it may become invalid in
|
||||
// ml_append(). And it's needed for "unique".
|
||||
@@ -744,7 +751,7 @@ do_move(linenr_T line1, linenr_T line2, linenr_T dest)
|
||||
foldMoveRange(&win->w_folds, line1, line2, dest);
|
||||
}
|
||||
#endif
|
||||
if (!cmdmod.lockmarks)
|
||||
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
|
||||
{
|
||||
curbuf->b_op_start.lnum = dest - num_lines + 1;
|
||||
curbuf->b_op_end.lnum = dest;
|
||||
@@ -759,13 +766,13 @@ do_move(linenr_T line1, linenr_T line2, linenr_T dest)
|
||||
foldMoveRange(&win->w_folds, dest + 1, line1 - 1, line2);
|
||||
}
|
||||
#endif
|
||||
if (!cmdmod.lockmarks)
|
||||
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
|
||||
{
|
||||
curbuf->b_op_start.lnum = dest + 1;
|
||||
curbuf->b_op_end.lnum = dest + num_lines;
|
||||
}
|
||||
}
|
||||
if (!cmdmod.lockmarks)
|
||||
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
|
||||
curbuf->b_op_start.col = curbuf->b_op_end.col = 0;
|
||||
mark_adjust_nofold(last_line - num_lines + 1, last_line,
|
||||
-(last_line - dest - extra), 0L);
|
||||
@@ -815,7 +822,7 @@ ex_copy(linenr_T line1, linenr_T line2, linenr_T n)
|
||||
char_u *p;
|
||||
|
||||
count = line2 - line1 + 1;
|
||||
if (!cmdmod.lockmarks)
|
||||
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
|
||||
{
|
||||
curbuf->b_op_start.lnum = n + 1;
|
||||
curbuf->b_op_end.lnum = n + count;
|
||||
@@ -1062,7 +1069,7 @@ do_filter(
|
||||
int shell_flags = 0;
|
||||
pos_T orig_start = curbuf->b_op_start;
|
||||
pos_T orig_end = curbuf->b_op_end;
|
||||
int save_lockmarks = cmdmod.lockmarks;
|
||||
int save_cmod_flags = cmdmod.cmod_flags;
|
||||
#ifdef FEAT_FILTERPIPE
|
||||
int stmp = p_stmp;
|
||||
#endif
|
||||
@@ -1072,7 +1079,7 @@ do_filter(
|
||||
|
||||
// Temporarily disable lockmarks since that's needed to propagate changed
|
||||
// regions of the buffer for foldUpdate(), linecount, etc.
|
||||
cmdmod.lockmarks = 0;
|
||||
cmdmod.cmod_flags &= ~CMOD_LOCKMARKS;
|
||||
|
||||
cursor_save = curwin->w_cursor;
|
||||
linecount = line2 - line1 + 1;
|
||||
@@ -1241,11 +1248,22 @@ do_filter(
|
||||
|
||||
if (do_in)
|
||||
{
|
||||
if (cmdmod.keepmarks || vim_strchr(p_cpo, CPO_REMMARK) == NULL)
|
||||
if ((cmdmod.cmod_flags & CMOD_KEEPMARKS)
|
||||
|| vim_strchr(p_cpo, CPO_REMMARK) == NULL)
|
||||
{
|
||||
if (read_linecount >= linecount)
|
||||
// move all marks from old lines to new lines
|
||||
mark_adjust(line1, line2, linecount, 0L);
|
||||
else if (save_cmod_flags & CMOD_LOCKMARKS)
|
||||
{
|
||||
// Move marks from the lines below the new lines down by
|
||||
// the number of lines lost.
|
||||
// Move marks from the lines that will be deleted to the
|
||||
// new lines and below.
|
||||
mark_adjust(line2 + 1, (linenr_T)MAXLNUM,
|
||||
linecount - read_linecount, 0L);
|
||||
mark_adjust(line1, line2, linecount, 0L);
|
||||
}
|
||||
else
|
||||
{
|
||||
// move marks from old lines to new lines, delete marks
|
||||
@@ -1307,13 +1325,13 @@ error:
|
||||
|
||||
filterend:
|
||||
|
||||
cmdmod.lockmarks = save_lockmarks;
|
||||
cmdmod.cmod_flags = save_cmod_flags;
|
||||
if (curbuf != old_curbuf)
|
||||
{
|
||||
--no_wait_return;
|
||||
emsg(_("E135: *Filter* Autocommands must not change current buffer"));
|
||||
}
|
||||
else if (cmdmod.lockmarks)
|
||||
else if (cmdmod.cmod_flags & CMOD_LOCKMARKS)
|
||||
{
|
||||
curbuf->b_op_start = orig_start;
|
||||
curbuf->b_op_end = orig_end;
|
||||
@@ -1543,6 +1561,9 @@ make_filter_cmd(
|
||||
int is_fish_shell;
|
||||
char_u *shell_name = get_isolated_shell_name();
|
||||
|
||||
if (shell_name == NULL)
|
||||
return NULL;
|
||||
|
||||
// Account for fish's different syntax for subshells
|
||||
is_fish_shell = (fnamecmp(shell_name, "fish") == 0);
|
||||
vim_free(shell_name);
|
||||
@@ -1769,7 +1790,7 @@ rename_buffer(char_u *new_fname)
|
||||
if (xfname != NULL && *xfname != NUL)
|
||||
{
|
||||
buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0);
|
||||
if (buf != NULL && !cmdmod.keepalt)
|
||||
if (buf != NULL && (cmdmod.cmod_flags & CMOD_KEEPALT) == 0)
|
||||
curwin->w_alt_fnum = buf->b_fnum;
|
||||
}
|
||||
vim_free(fname);
|
||||
@@ -1866,7 +1887,7 @@ do_write(exarg_T *eap)
|
||||
|
||||
ffname = eap->arg;
|
||||
#ifdef FEAT_BROWSE
|
||||
if (cmdmod.browse && !exiting)
|
||||
if ((cmdmod.cmod_flags & CMOD_BROWSE) && !exiting)
|
||||
{
|
||||
browse_file = do_browse(BROWSE_SAVE, (char_u *)_("Save As"), ffname,
|
||||
NULL, NULL, NULL, curbuf);
|
||||
@@ -1942,7 +1963,7 @@ do_write(exarg_T *eap)
|
||||
&& !p_wa)
|
||||
{
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
if (p_confirm || cmdmod.confirm)
|
||||
if (p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM))
|
||||
{
|
||||
if (vim_dialog_yesno(VIM_QUESTION, NULL,
|
||||
(char_u *)_("Write partial file?"), 2) != VIM_YES)
|
||||
@@ -2091,7 +2112,7 @@ check_overwrite(
|
||||
}
|
||||
#endif
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
if (p_confirm || cmdmod.confirm)
|
||||
if (p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM))
|
||||
{
|
||||
char_u buff[DIALOG_MSG_SIZE];
|
||||
|
||||
@@ -2142,7 +2163,7 @@ check_overwrite(
|
||||
if (r)
|
||||
{
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
if (p_confirm || cmdmod.confirm)
|
||||
if (p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM))
|
||||
{
|
||||
char_u buff[DIALOG_MSG_SIZE];
|
||||
|
||||
@@ -2229,12 +2250,13 @@ do_wqall(exarg_T *eap)
|
||||
}
|
||||
#ifdef FEAT_BROWSE
|
||||
// ":browse wall": ask for file name if there isn't one
|
||||
if (buf->b_ffname == NULL && cmdmod.browse)
|
||||
if (buf->b_ffname == NULL && (cmdmod.cmod_flags & CMOD_BROWSE))
|
||||
browse_save_fname(buf);
|
||||
#endif
|
||||
if (buf->b_ffname == NULL)
|
||||
{
|
||||
semsg(_("E141: No file name for buffer %ld"), (long)buf->b_fnum);
|
||||
semsg(_("E141: No file name for buffer %ld"),
|
||||
(long)buf->b_fnum);
|
||||
++error;
|
||||
}
|
||||
else if (check_readonly(&eap->forceit, buf)
|
||||
@@ -2297,7 +2319,8 @@ check_readonly(int *forceit, buf_T *buf)
|
||||
&& check_file_readonly(buf->b_ffname, 0777))))
|
||||
{
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
if ((p_confirm || cmdmod.confirm) && buf->b_fname != NULL)
|
||||
if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM))
|
||||
&& buf->b_fname != NULL)
|
||||
{
|
||||
char_u buff[DIALOG_MSG_SIZE];
|
||||
|
||||
@@ -2436,6 +2459,7 @@ theend:
|
||||
* ECMD_OLDBUF: use existing buffer if it exists
|
||||
* ECMD_FORCEIT: ! used for Ex command
|
||||
* ECMD_ADDBUF: don't edit, just add to buffer list
|
||||
* ECMD_ALTBUF: like ECMD_ADDBUF and also set the alternate file
|
||||
* oldwin: Should be "curwin" when editing a new buffer in the current
|
||||
* window, NULL when splitting the window first. When not NULL info
|
||||
* of the previous buffer for "oldwin" is stored.
|
||||
@@ -2501,7 +2525,7 @@ do_ecmd(
|
||||
else
|
||||
{
|
||||
#ifdef FEAT_BROWSE
|
||||
if (cmdmod.browse && !exiting)
|
||||
if ((cmdmod.cmod_flags & CMOD_BROWSE) && !exiting)
|
||||
{
|
||||
if (
|
||||
# ifdef FEAT_GUI
|
||||
@@ -2532,7 +2556,8 @@ do_ecmd(
|
||||
fname_case(sfname, 0); // set correct case for sfname
|
||||
#endif
|
||||
|
||||
if ((flags & ECMD_ADDBUF) && (ffname == NULL || *ffname == NUL))
|
||||
if ((flags & (ECMD_ADDBUF | ECMD_ALTBUF))
|
||||
&& (ffname == NULL || *ffname == NUL))
|
||||
goto theend;
|
||||
|
||||
if (ffname == NULL)
|
||||
@@ -2561,7 +2586,7 @@ do_ecmd(
|
||||
*/
|
||||
if ( ((!other_file && !(flags & ECMD_OLDBUF))
|
||||
|| (curbuf->b_nwindows == 1
|
||||
&& !(flags & (ECMD_HIDE | ECMD_ADDBUF))))
|
||||
&& !(flags & (ECMD_HIDE | ECMD_ADDBUF | ECMD_ALTBUF))))
|
||||
&& check_changed(curbuf, (p_awa ? CCGD_AW : 0)
|
||||
| (other_file ? 0 : CCGD_MULTWIN)
|
||||
| ((flags & ECMD_FORCEIT) ? CCGD_FORCEIT : 0)
|
||||
@@ -2610,9 +2635,9 @@ do_ecmd(
|
||||
*/
|
||||
if (other_file)
|
||||
{
|
||||
if (!(flags & ECMD_ADDBUF))
|
||||
if (!(flags & (ECMD_ADDBUF | ECMD_ALTBUF)))
|
||||
{
|
||||
if (!cmdmod.keepalt)
|
||||
if ((cmdmod.cmod_flags & CMOD_KEEPALT) == 0)
|
||||
curwin->w_alt_fnum = curbuf->b_fnum;
|
||||
if (oldwin != NULL)
|
||||
buflist_altfpos(oldwin);
|
||||
@@ -2622,9 +2647,12 @@ do_ecmd(
|
||||
buf = buflist_findnr(fnum);
|
||||
else
|
||||
{
|
||||
if (flags & ECMD_ADDBUF)
|
||||
if (flags & (ECMD_ADDBUF | ECMD_ALTBUF))
|
||||
{
|
||||
linenr_T tlnum = 1L;
|
||||
// Default the line number to zero to avoid that a wininfo item
|
||||
// is added for the current window.
|
||||
linenr_T tlnum = 0;
|
||||
buf_T *newbuf;
|
||||
|
||||
if (command != NULL)
|
||||
{
|
||||
@@ -2632,7 +2660,12 @@ do_ecmd(
|
||||
if (tlnum <= 0)
|
||||
tlnum = 1L;
|
||||
}
|
||||
(void)buflist_new(ffname, sfname, tlnum, BLN_LISTED);
|
||||
// Add BLN_NOCURWIN to avoid a new wininfo items are assocated
|
||||
// with the current window.
|
||||
newbuf = buflist_new(ffname, sfname, tlnum,
|
||||
BLN_LISTED | BLN_NOCURWIN);
|
||||
if (newbuf != NULL && (flags & ECMD_ALTBUF))
|
||||
curwin->w_alt_fnum = newbuf->b_fnum;
|
||||
goto theend;
|
||||
}
|
||||
buf = buflist_new(ffname, sfname, 0L,
|
||||
@@ -2790,7 +2823,7 @@ do_ecmd(
|
||||
}
|
||||
else // !other_file
|
||||
{
|
||||
if ((flags & ECMD_ADDBUF) || check_fname() == FAIL)
|
||||
if ((flags & (ECMD_ADDBUF | ECMD_ALTBUF)) || check_fname() == FAIL)
|
||||
goto theend;
|
||||
|
||||
oldbuf = (flags & ECMD_OLDBUF);
|
||||
@@ -3090,7 +3123,7 @@ do_ecmd(
|
||||
#endif
|
||||
|
||||
if (command != NULL)
|
||||
do_cmdline(command, NULL, NULL, DOCMD_VERBOSE);
|
||||
do_cmdline(command, NULL, NULL, DOCMD_VERBOSE|DOCMD_RANGEOK);
|
||||
|
||||
#ifdef FEAT_KEYMAP
|
||||
if (curbuf->b_kmap_state & KEYMAP_INIT)
|
||||
@@ -3299,14 +3332,14 @@ ex_append(exarg_T *eap)
|
||||
// eap->line2 pointed to the end of the buffer and nothing was appended)
|
||||
// "end" is set to lnum when something has been appended, otherwise
|
||||
// it is the same than "start" -- Acevedo
|
||||
if (!cmdmod.lockmarks)
|
||||
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
|
||||
{
|
||||
curbuf->b_op_start.lnum = (eap->line2 < curbuf->b_ml.ml_line_count) ?
|
||||
eap->line2 + 1 : curbuf->b_ml.ml_line_count;
|
||||
if (eap->cmdidx != CMD_append)
|
||||
--curbuf->b_op_start.lnum;
|
||||
curbuf->b_op_end.lnum = (eap->line2 < lnum)
|
||||
? lnum : curbuf->b_op_start.lnum;
|
||||
? lnum : curbuf->b_op_start.lnum;
|
||||
curbuf->b_op_start.col = curbuf->b_op_end.col = 0;
|
||||
}
|
||||
curwin->w_cursor.lnum = lnum;
|
||||
@@ -3729,7 +3762,7 @@ ex_substitute(exarg_T *eap)
|
||||
ex_may_print(eap);
|
||||
}
|
||||
|
||||
if (!cmdmod.keeppatterns)
|
||||
if ((cmdmod.cmod_flags & CMOD_KEEPPATTERNS) == 0)
|
||||
save_re_pat(RE_SUBST, pat, p_magic);
|
||||
// put pattern in history
|
||||
add_to_history(HIST_SEARCH, pat, TRUE, NUL);
|
||||
@@ -4619,7 +4652,7 @@ outofmem:
|
||||
|
||||
if (sub_nsubs > start_nsubs)
|
||||
{
|
||||
if (!cmdmod.lockmarks)
|
||||
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
|
||||
{
|
||||
// Set the '[ and '] marks.
|
||||
curbuf->b_op_start.lnum = eap->line1;
|
||||
@@ -5108,7 +5141,7 @@ ex_drop(exarg_T *eap)
|
||||
if (ARGCOUNT == 0)
|
||||
return;
|
||||
|
||||
if (cmdmod.tab)
|
||||
if (cmdmod.cmod_tab)
|
||||
{
|
||||
// ":tab drop file ...": open a tab for each argument that isn't
|
||||
// edited in a window yet. It's like ":tab all" but without closing
|
||||
@@ -5247,7 +5280,7 @@ ex_oldfiles(exarg_T *eap UNUSED)
|
||||
got_int = FALSE;
|
||||
|
||||
# ifdef FEAT_BROWSE_CMD
|
||||
if (cmdmod.browse)
|
||||
if (cmdmod.cmod_flags & CMOD_BROWSE)
|
||||
{
|
||||
quit_more = FALSE;
|
||||
nr = prompt_for_number(FALSE);
|
||||
@@ -5262,7 +5295,7 @@ ex_oldfiles(exarg_T *eap UNUSED)
|
||||
p = expand_env_save(p);
|
||||
eap->arg = p;
|
||||
eap->cmdidx = CMD_edit;
|
||||
cmdmod.browse = FALSE;
|
||||
cmdmod.cmod_flags &= ~CMOD_BROWSE;
|
||||
do_exedit(eap, NULL);
|
||||
vim_free(p);
|
||||
}
|
||||
|
||||
@@ -178,6 +178,9 @@ EXCMD(CMD_ball, "ball", ex_buffer_all,
|
||||
EXCMD(CMD_badd, "badd", ex_edit,
|
||||
EX_NEEDARG|EX_FILE1|EX_CMDARG|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
|
||||
ADDR_NONE),
|
||||
EXCMD(CMD_balt, "balt", ex_edit,
|
||||
EX_NEEDARG|EX_FILE1|EX_CMDARG|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
|
||||
ADDR_NONE),
|
||||
EXCMD(CMD_bdelete, "bdelete", ex_bunload,
|
||||
EX_BANG|EX_RANGE|EX_BUFNAME|EX_COUNT|EX_EXTRA|EX_TRLBAR,
|
||||
ADDR_BUFFERS),
|
||||
@@ -926,10 +929,10 @@ EXCMD(CMD_luafile, "luafile", ex_luafile,
|
||||
EX_RANGE|EX_FILE1|EX_NEEDARG|EX_CMDWIN|EX_LOCK_OK|EX_RESTRICT,
|
||||
ADDR_LINES),
|
||||
EXCMD(CMD_lvimgrep, "lvimgrep", ex_vimgrep,
|
||||
EX_RANGE|EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_TRLBAR|EX_XFILE,
|
||||
EX_RANGE|EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_TRLBAR|EX_XFILE|EX_LOCK_OK,
|
||||
ADDR_OTHER),
|
||||
EXCMD(CMD_lvimgrepadd, "lvimgrepadd", ex_vimgrep,
|
||||
EX_RANGE|EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_TRLBAR|EX_XFILE,
|
||||
EX_RANGE|EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_TRLBAR|EX_XFILE|EX_LOCK_OK,
|
||||
ADDR_OTHER),
|
||||
EXCMD(CMD_lwindow, "lwindow", ex_cwindow,
|
||||
EX_RANGE|EX_COUNT|EX_TRLBAR,
|
||||
@@ -1670,10 +1673,10 @@ EXCMD(CMD_view, "view", ex_edit,
|
||||
EX_BANG|EX_FILE1|EX_CMDARG|EX_ARGOPT|EX_TRLBAR,
|
||||
ADDR_NONE),
|
||||
EXCMD(CMD_vimgrep, "vimgrep", ex_vimgrep,
|
||||
EX_RANGE|EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_TRLBAR|EX_XFILE,
|
||||
EX_RANGE|EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_TRLBAR|EX_XFILE|EX_LOCK_OK,
|
||||
ADDR_OTHER),
|
||||
EXCMD(CMD_vimgrepadd, "vimgrepadd", ex_vimgrep,
|
||||
EX_RANGE|EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_TRLBAR|EX_XFILE,
|
||||
EX_RANGE|EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_TRLBAR|EX_XFILE|EX_LOCK_OK,
|
||||
ADDR_OTHER),
|
||||
EXCMD(CMD_vim9script, "vim9script", ex_vim9script,
|
||||
EX_CMDWIN|EX_LOCK_OK,
|
||||
@@ -1883,12 +1886,6 @@ struct exarg
|
||||
void *cookie; // argument for getline()
|
||||
#ifdef FEAT_EVAL
|
||||
cstack_T *cstack; // condition stack for ":if" etc.
|
||||
#endif
|
||||
long verbose_save; // saved value of p_verbose
|
||||
int save_msg_silent; // saved value of msg_silent
|
||||
int did_esilent; // how many times emsg_silent was incremented
|
||||
#ifdef HAVE_SANDBOX
|
||||
int did_sandbox; // when TRUE did ++sandbox
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ check_changed(buf_T *buf, int flags)
|
||||
&& (!(flags & CCGD_AW) || autowrite(buf, forceit) == FAIL))
|
||||
{
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
if ((p_confirm || cmdmod.confirm) && p_write)
|
||||
if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM)) && p_write)
|
||||
{
|
||||
buf_T *buf2;
|
||||
int count = 0;
|
||||
@@ -96,7 +96,7 @@ check_changed(buf_T *buf, int flags)
|
||||
if (bufIsChanged(buf2)
|
||||
&& (buf2->b_ffname != NULL
|
||||
# ifdef FEAT_BROWSE
|
||||
|| cmdmod.browse
|
||||
|| (cmdmod.cmod_flags & CMOD_BROWSE)
|
||||
# endif
|
||||
))
|
||||
++count;
|
||||
@@ -197,7 +197,7 @@ dialog_changed(
|
||||
if (bufIsChanged(buf2)
|
||||
&& (buf2->b_ffname != NULL
|
||||
#ifdef FEAT_BROWSE
|
||||
|| cmdmod.browse
|
||||
|| (cmdmod.cmod_flags & CMOD_BROWSE)
|
||||
#endif
|
||||
)
|
||||
&& !buf2->b_p_ro)
|
||||
@@ -347,7 +347,7 @@ check_changed_any(
|
||||
/*
|
||||
* When ":confirm" used, don't give an error message.
|
||||
*/
|
||||
if (!(p_confirm || cmdmod.confirm))
|
||||
if (!(p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM)))
|
||||
#endif
|
||||
{
|
||||
// There must be a wait_return for this message, do_buffer()
|
||||
|
||||
388
src/ex_docmd.c
388
src/ex_docmd.c
@@ -274,7 +274,6 @@ static void ex_tag_cmd(exarg_T *eap, char_u *name);
|
||||
# define ex_continue ex_ni
|
||||
# define ex_debug ex_ni
|
||||
# define ex_debuggreedy ex_ni
|
||||
# define ex_def ex_ni
|
||||
# define ex_defcompile ex_ni
|
||||
# define ex_delfunction ex_ni
|
||||
# define ex_disassemble ex_ni
|
||||
@@ -595,6 +594,17 @@ do_cmdline_cmd(char_u *cmd)
|
||||
DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED);
|
||||
}
|
||||
|
||||
/*
|
||||
* Execute the "+cmd" argument of "edit +cmd fname" and the like.
|
||||
* This allows for using a range without ":" in Vim9 script.
|
||||
*/
|
||||
int
|
||||
do_cmd_argument(char_u *cmd)
|
||||
{
|
||||
return do_cmdline(cmd, NULL, NULL,
|
||||
DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED|DOCMD_RANGEOK);
|
||||
}
|
||||
|
||||
/*
|
||||
* do_cmdline(): execute one Ex command line
|
||||
*
|
||||
@@ -640,7 +650,7 @@ do_cmdline(
|
||||
struct dbg_stuff debug_saved; // saved things for debug mode
|
||||
int initial_trylevel;
|
||||
msglist_T **saved_msg_list = NULL;
|
||||
msglist_T *private_msg_list;
|
||||
msglist_T *private_msg_list = NULL;
|
||||
|
||||
// "fgetline" and "cookie" passed to do_one_cmd()
|
||||
char_u *(*cmd_getline)(int, void *, int, getline_opt_T);
|
||||
@@ -664,7 +674,6 @@ do_cmdline(
|
||||
// BufWritePost autocommands are executed after a write error.
|
||||
saved_msg_list = msg_list;
|
||||
msg_list = &private_msg_list;
|
||||
private_msg_list = NULL;
|
||||
#endif
|
||||
|
||||
// It's possible to create an endless loop with ":execute", catch that
|
||||
@@ -748,6 +757,9 @@ do_cmdline(
|
||||
* cancel the whole command line, and any if/endif or loop.
|
||||
* If force_abort is set, we cancel everything.
|
||||
*/
|
||||
#ifdef FEAT_EVAL
|
||||
did_emsg_cumul += did_emsg;
|
||||
#endif
|
||||
did_emsg = FALSE;
|
||||
|
||||
/*
|
||||
@@ -779,7 +791,12 @@ do_cmdline(
|
||||
&& !(getline_is_func && func_has_abort(real_cookie))
|
||||
#endif
|
||||
)
|
||||
{
|
||||
#ifdef FEAT_EVAL
|
||||
did_emsg_cumul += did_emsg;
|
||||
#endif
|
||||
did_emsg = FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* 1. If repeating a line in a loop, get a line from lines_ga.
|
||||
@@ -983,7 +1000,7 @@ do_cmdline(
|
||||
* "cmdline_copy" can change, e.g. for '%' and '#' expansion.
|
||||
*/
|
||||
++recursive;
|
||||
next_cmdline = do_one_cmd(&cmdline_copy, flags & DOCMD_VERBOSE,
|
||||
next_cmdline = do_one_cmd(&cmdline_copy, flags,
|
||||
#ifdef FEAT_EVAL
|
||||
&cstack,
|
||||
#endif
|
||||
@@ -1027,7 +1044,10 @@ do_cmdline(
|
||||
if (did_emsg && !force_abort
|
||||
&& getline_equal(fgetline, cookie, get_func_line)
|
||||
&& !func_has_abort(real_cookie))
|
||||
{
|
||||
// did_emsg_cumul is not set here
|
||||
did_emsg = FALSE;
|
||||
}
|
||||
|
||||
if (cstack.cs_looplevel > 0)
|
||||
{
|
||||
@@ -1676,7 +1696,8 @@ comment_start(char_u *p, int starts_with_colon UNUSED)
|
||||
/*
|
||||
* Execute one Ex command.
|
||||
*
|
||||
* If 'sourcing' is TRUE, the command will be included in the error message.
|
||||
* If "flags" has DOCMD_VERBOSE, the command will be included in the error
|
||||
* message.
|
||||
*
|
||||
* 1. skip comment lines and leading space
|
||||
* 2. handle command modifiers
|
||||
@@ -1699,7 +1720,7 @@ comment_start(char_u *p, int starts_with_colon UNUSED)
|
||||
static char_u *
|
||||
do_one_cmd(
|
||||
char_u **cmdlinep,
|
||||
int sourcing,
|
||||
int flags,
|
||||
#ifdef FEAT_EVAL
|
||||
cstack_T *cstack,
|
||||
#endif
|
||||
@@ -1712,7 +1733,6 @@ do_one_cmd(
|
||||
char *errormsg = NULL; // error message
|
||||
char_u *after_modifier = NULL;
|
||||
exarg_T ea; // Ex command arguments
|
||||
int save_msg_scroll = msg_scroll;
|
||||
cmdmod_T save_cmdmod;
|
||||
int save_reg_executing = reg_executing;
|
||||
int ni; // set when Not Implemented
|
||||
@@ -1721,7 +1741,9 @@ do_one_cmd(
|
||||
#ifdef FEAT_EVAL
|
||||
int may_have_range;
|
||||
int vim9script = in_vim9script();
|
||||
int did_set_expr_line = FALSE;
|
||||
#endif
|
||||
int sourcing = flags & DOCMD_VERBOSE;
|
||||
|
||||
CLEAR_FIELD(ea);
|
||||
ea.line1 = 1;
|
||||
@@ -1763,8 +1785,9 @@ do_one_cmd(
|
||||
ea.cstack = cstack;
|
||||
starts_with_colon = *skipwhite(ea.cmd) == ':';
|
||||
#endif
|
||||
if (parse_command_modifiers(&ea, &errormsg, FALSE) == FAIL)
|
||||
if (parse_command_modifiers(&ea, &errormsg, &cmdmod, FALSE) == FAIL)
|
||||
goto doend;
|
||||
apply_cmdmod(&cmdmod);
|
||||
|
||||
after_modifier = ea.cmd;
|
||||
|
||||
@@ -1782,24 +1805,44 @@ do_one_cmd(
|
||||
*/
|
||||
cmd = ea.cmd;
|
||||
#ifdef FEAT_EVAL
|
||||
// In Vim9 script a colon is required before the range.
|
||||
may_have_range = !vim9script || starts_with_colon;
|
||||
// In Vim9 script a colon is required before the range. This may also be
|
||||
// after command modifiers.
|
||||
if (vim9script && (flags & DOCMD_RANGEOK) == 0)
|
||||
{
|
||||
may_have_range = FALSE;
|
||||
for (p = ea.cmd; p >= *cmdlinep; --p)
|
||||
{
|
||||
if (*p == ':')
|
||||
may_have_range = TRUE;
|
||||
if (p < ea.cmd && !VIM_ISWHITE(*p))
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
may_have_range = TRUE;
|
||||
if (may_have_range)
|
||||
#endif
|
||||
ea.cmd = skip_range(ea.cmd, TRUE, NULL);
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
if (vim9script && !starts_with_colon)
|
||||
if (vim9script && !may_have_range)
|
||||
{
|
||||
if (ea.cmd == cmd + 1 && *cmd == '$')
|
||||
// should be "$VAR = val"
|
||||
--ea.cmd;
|
||||
else if (ea.cmd > cmd)
|
||||
{
|
||||
emsg(_(e_colon_required_before_a_range));
|
||||
goto doend;
|
||||
}
|
||||
p = find_ex_command(&ea, NULL, lookup_scriptvar, NULL);
|
||||
if (ea.cmdidx == CMD_SIZE)
|
||||
{
|
||||
char_u *ar = skip_range(ea.cmd, TRUE, NULL);
|
||||
|
||||
// If a ':' before the range is missing, give a clearer error
|
||||
// message.
|
||||
if (ar > ea.cmd)
|
||||
{
|
||||
emsg(_(e_colon_required_before_a_range));
|
||||
goto doend;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@@ -2316,8 +2359,9 @@ do_one_cmd(
|
||||
// for '=' register: accept the rest of the line as an expression
|
||||
if (ea.arg[-1] == '=' && ea.arg[0] != NUL)
|
||||
{
|
||||
set_expr_line(vim_strsave(ea.arg));
|
||||
set_expr_line(vim_strsave(ea.arg), &ea);
|
||||
ea.arg += STRLEN(ea.arg);
|
||||
did_set_expr_line = TRUE;
|
||||
}
|
||||
#endif
|
||||
ea.arg = skipwhite(ea.arg);
|
||||
@@ -2516,12 +2560,12 @@ do_one_cmd(
|
||||
|
||||
// The :try command saves the emsg_silent flag, reset it here when
|
||||
// ":silent! try" was used, it should only apply to :try itself.
|
||||
if (ea.cmdidx == CMD_try && ea.did_esilent > 0)
|
||||
if (ea.cmdidx == CMD_try && cmdmod.cmod_did_esilent > 0)
|
||||
{
|
||||
emsg_silent -= ea.did_esilent;
|
||||
emsg_silent -= cmdmod.cmod_did_esilent;
|
||||
if (emsg_silent < 0)
|
||||
emsg_silent = 0;
|
||||
ea.did_esilent = 0;
|
||||
cmdmod.cmod_did_esilent = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2596,17 +2640,15 @@ doend:
|
||||
do_errthrow(cstack,
|
||||
(ea.cmdidx != CMD_SIZE && !IS_USER_CMDIDX(ea.cmdidx))
|
||||
? cmdnames[(int)ea.cmdidx].cmd_name : (char_u *)NULL);
|
||||
|
||||
if (did_set_expr_line)
|
||||
set_expr_line(NULL, NULL);
|
||||
#endif
|
||||
|
||||
undo_cmdmod(&ea, save_msg_scroll);
|
||||
undo_cmdmod(&cmdmod);
|
||||
cmdmod = save_cmdmod;
|
||||
reg_executing = save_reg_executing;
|
||||
|
||||
#ifdef HAVE_SANDBOX
|
||||
if (ea.did_sandbox)
|
||||
--sandbox;
|
||||
#endif
|
||||
|
||||
if (ea.nextcmd && *ea.nextcmd == NUL) // not really a next command
|
||||
ea.nextcmd = NULL;
|
||||
|
||||
@@ -2638,26 +2680,31 @@ ex_errmsg(char *msg, char_u *arg)
|
||||
/*
|
||||
* Parse and skip over command modifiers:
|
||||
* - update eap->cmd
|
||||
* - store flags in "cmdmod".
|
||||
* - store flags in "cmod".
|
||||
* - Set ex_pressedreturn for an empty command line.
|
||||
* - set msg_silent for ":silent"
|
||||
* - set 'eventignore' to "all" for ":noautocmd"
|
||||
* - set p_verbose for ":verbose"
|
||||
* - Increment "sandbox" for ":sandbox"
|
||||
* When "skip_only" is TRUE the global variables are not changed, except for
|
||||
* "cmdmod".
|
||||
* When "skip_only" is FALSE then undo_cmdmod() must be called later to free
|
||||
* any cmod_filter_regmatch.regprog.
|
||||
* Call apply_cmdmod() to get the side effects of the modifiers:
|
||||
* - Increment "sandbox" for ":sandbox"
|
||||
* - set p_verbose for ":verbose"
|
||||
* - set msg_silent for ":silent"
|
||||
* - set 'eventignore' to "all" for ":noautocmd"
|
||||
* Return FAIL when the command is not to be executed.
|
||||
* May set "errormsg" to an error message.
|
||||
*/
|
||||
int
|
||||
parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
|
||||
parse_command_modifiers(
|
||||
exarg_T *eap,
|
||||
char **errormsg,
|
||||
cmdmod_T *cmod,
|
||||
int skip_only)
|
||||
{
|
||||
char_u *p;
|
||||
int starts_with_colon = FALSE;
|
||||
|
||||
CLEAR_FIELD(cmdmod);
|
||||
eap->verbose_save = -1;
|
||||
eap->save_msg_silent = -1;
|
||||
CLEAR_POINTER(cmod);
|
||||
|
||||
// Repeat until no more command modifiers are found.
|
||||
for (;;)
|
||||
@@ -2696,51 +2743,51 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
|
||||
// When adding an entry, also modify cmd_exists().
|
||||
case 'a': if (!checkforcmd(&eap->cmd, "aboveleft", 3))
|
||||
break;
|
||||
cmdmod.split |= WSP_ABOVE;
|
||||
cmod->cmod_split |= WSP_ABOVE;
|
||||
continue;
|
||||
|
||||
case 'b': if (checkforcmd(&eap->cmd, "belowright", 3))
|
||||
{
|
||||
cmdmod.split |= WSP_BELOW;
|
||||
cmod->cmod_split |= WSP_BELOW;
|
||||
continue;
|
||||
}
|
||||
if (checkforcmd(&eap->cmd, "browse", 3))
|
||||
{
|
||||
#ifdef FEAT_BROWSE_CMD
|
||||
cmdmod.browse = TRUE;
|
||||
cmod->cmod_flags |= CMOD_BROWSE;
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
if (!checkforcmd(&eap->cmd, "botright", 2))
|
||||
break;
|
||||
cmdmod.split |= WSP_BOT;
|
||||
cmod->cmod_split |= WSP_BOT;
|
||||
continue;
|
||||
|
||||
case 'c': if (!checkforcmd(&eap->cmd, "confirm", 4))
|
||||
break;
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
cmdmod.confirm = TRUE;
|
||||
cmod->cmod_flags |= CMOD_CONFIRM;
|
||||
#endif
|
||||
continue;
|
||||
|
||||
case 'k': if (checkforcmd(&eap->cmd, "keepmarks", 3))
|
||||
{
|
||||
cmdmod.keepmarks = TRUE;
|
||||
cmod->cmod_flags |= CMOD_KEEPMARKS;
|
||||
continue;
|
||||
}
|
||||
if (checkforcmd(&eap->cmd, "keepalt", 5))
|
||||
{
|
||||
cmdmod.keepalt = TRUE;
|
||||
cmod->cmod_flags |= CMOD_KEEPALT;
|
||||
continue;
|
||||
}
|
||||
if (checkforcmd(&eap->cmd, "keeppatterns", 5))
|
||||
{
|
||||
cmdmod.keeppatterns = TRUE;
|
||||
cmod->cmod_flags |= CMOD_KEEPPATTERNS;
|
||||
continue;
|
||||
}
|
||||
if (!checkforcmd(&eap->cmd, "keepjumps", 5))
|
||||
break;
|
||||
cmdmod.keepjumps = TRUE;
|
||||
cmod->cmod_flags |= CMOD_KEEPJUMPS;
|
||||
continue;
|
||||
|
||||
case 'f': // only accept ":filter {pat} cmd"
|
||||
@@ -2752,14 +2799,14 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
|
||||
break;
|
||||
if (*p == '!')
|
||||
{
|
||||
cmdmod.filter_force = TRUE;
|
||||
cmod->cmod_filter_force = TRUE;
|
||||
p = skipwhite(p + 1);
|
||||
if (*p == NUL || ends_excmd(*p))
|
||||
break;
|
||||
}
|
||||
#ifdef FEAT_EVAL
|
||||
// Avoid that "filter(arg)" is recognized.
|
||||
if (in_vim9script() && !VIM_ISWHITE(*p))
|
||||
if (in_vim9script() && !VIM_ISWHITE(p[-1]))
|
||||
break;
|
||||
#endif
|
||||
if (skip_only)
|
||||
@@ -2771,9 +2818,9 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
|
||||
break;
|
||||
if (!skip_only)
|
||||
{
|
||||
cmdmod.filter_regmatch.regprog =
|
||||
cmod->cmod_filter_regmatch.regprog =
|
||||
vim_regcomp(reg_pat, RE_MAGIC);
|
||||
if (cmdmod.filter_regmatch.regprog == NULL)
|
||||
if (cmod->cmod_filter_regmatch.regprog == NULL)
|
||||
break;
|
||||
}
|
||||
eap->cmd = p;
|
||||
@@ -2785,71 +2832,48 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
|
||||
|| *p == NUL || ends_excmd(*p))
|
||||
break;
|
||||
eap->cmd = p;
|
||||
cmdmod.hide = TRUE;
|
||||
cmod->cmod_flags |= CMOD_HIDE;
|
||||
continue;
|
||||
|
||||
case 'l': if (checkforcmd(&eap->cmd, "lockmarks", 3))
|
||||
{
|
||||
cmdmod.lockmarks = TRUE;
|
||||
cmod->cmod_flags |= CMOD_LOCKMARKS;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!checkforcmd(&eap->cmd, "leftabove", 5))
|
||||
break;
|
||||
cmdmod.split |= WSP_ABOVE;
|
||||
cmod->cmod_split |= WSP_ABOVE;
|
||||
continue;
|
||||
|
||||
case 'n': if (checkforcmd(&eap->cmd, "noautocmd", 3))
|
||||
{
|
||||
if (cmdmod.save_ei == NULL && !skip_only)
|
||||
{
|
||||
// Set 'eventignore' to "all". Restore the
|
||||
// existing option value later.
|
||||
cmdmod.save_ei = vim_strsave(p_ei);
|
||||
set_string_option_direct((char_u *)"ei", -1,
|
||||
(char_u *)"all", OPT_FREE, SID_NONE);
|
||||
}
|
||||
cmod->cmod_flags |= CMOD_NOAUTOCMD;
|
||||
continue;
|
||||
}
|
||||
if (!checkforcmd(&eap->cmd, "noswapfile", 3))
|
||||
break;
|
||||
cmdmod.noswapfile = TRUE;
|
||||
cmod->cmod_flags |= CMOD_NOSWAPFILE;
|
||||
continue;
|
||||
|
||||
case 'r': if (!checkforcmd(&eap->cmd, "rightbelow", 6))
|
||||
break;
|
||||
cmdmod.split |= WSP_BELOW;
|
||||
cmod->cmod_split |= WSP_BELOW;
|
||||
continue;
|
||||
|
||||
case 's': if (checkforcmd(&eap->cmd, "sandbox", 3))
|
||||
{
|
||||
#ifdef HAVE_SANDBOX
|
||||
if (!skip_only)
|
||||
{
|
||||
if (!eap->did_sandbox)
|
||||
++sandbox;
|
||||
eap->did_sandbox = TRUE;
|
||||
}
|
||||
#endif
|
||||
cmod->cmod_flags |= CMOD_SANDBOX;
|
||||
continue;
|
||||
}
|
||||
if (!checkforcmd(&eap->cmd, "silent", 3))
|
||||
break;
|
||||
if (!skip_only)
|
||||
{
|
||||
if (eap->save_msg_silent == -1)
|
||||
eap->save_msg_silent = msg_silent;
|
||||
++msg_silent;
|
||||
}
|
||||
cmod->cmod_flags |= CMOD_SILENT;
|
||||
if (*eap->cmd == '!' && !VIM_ISWHITE(eap->cmd[-1]))
|
||||
{
|
||||
// ":silent!", but not "silent !cmd"
|
||||
eap->cmd = skipwhite(eap->cmd + 1);
|
||||
if (!skip_only)
|
||||
{
|
||||
++emsg_silent;
|
||||
++eap->did_esilent;
|
||||
}
|
||||
cmod->cmod_flags |= CMOD_ERRSILENT;
|
||||
}
|
||||
continue;
|
||||
|
||||
@@ -2861,7 +2885,7 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
|
||||
ADDR_TABS, eap->skip,
|
||||
skip_only, FALSE, 1);
|
||||
if (tabnr == MAXLNUM)
|
||||
cmdmod.tab = tabpage_index(curtab) + 1;
|
||||
cmod->cmod_tab = tabpage_index(curtab) + 1;
|
||||
else
|
||||
{
|
||||
if (tabnr < 0 || tabnr > LAST_TAB_NR)
|
||||
@@ -2869,7 +2893,7 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
|
||||
*errormsg = _(e_invrange);
|
||||
return FAIL;
|
||||
}
|
||||
cmdmod.tab = tabnr + 1;
|
||||
cmod->cmod_tab = tabnr + 1;
|
||||
}
|
||||
}
|
||||
eap->cmd = p;
|
||||
@@ -2877,35 +2901,25 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
|
||||
}
|
||||
if (!checkforcmd(&eap->cmd, "topleft", 2))
|
||||
break;
|
||||
cmdmod.split |= WSP_TOP;
|
||||
cmod->cmod_split |= WSP_TOP;
|
||||
continue;
|
||||
|
||||
case 'u': if (!checkforcmd(&eap->cmd, "unsilent", 3))
|
||||
break;
|
||||
if (!skip_only)
|
||||
{
|
||||
if (eap->save_msg_silent == -1)
|
||||
eap->save_msg_silent = msg_silent;
|
||||
msg_silent = 0;
|
||||
}
|
||||
cmod->cmod_flags |= CMOD_UNSILENT;
|
||||
continue;
|
||||
|
||||
case 'v': if (checkforcmd(&eap->cmd, "vertical", 4))
|
||||
{
|
||||
cmdmod.split |= WSP_VERT;
|
||||
cmod->cmod_split |= WSP_VERT;
|
||||
continue;
|
||||
}
|
||||
if (!checkforcmd(&p, "verbose", 4))
|
||||
break;
|
||||
if (!skip_only)
|
||||
{
|
||||
if (eap->verbose_save < 0)
|
||||
eap->verbose_save = p_verbose;
|
||||
if (vim_isdigit(*eap->cmd))
|
||||
p_verbose = atoi((char *)eap->cmd);
|
||||
else
|
||||
p_verbose = 1;
|
||||
}
|
||||
if (vim_isdigit(*eap->cmd))
|
||||
cmod->cmod_verbose = atoi((char *)eap->cmd);
|
||||
else
|
||||
cmod->cmod_verbose = 1;
|
||||
eap->cmd = p;
|
||||
continue;
|
||||
}
|
||||
@@ -2916,42 +2930,104 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
|
||||
}
|
||||
|
||||
/*
|
||||
* Undo and free contents of "cmdmod".
|
||||
* Apply the command modifiers. Saves current state in "cmdmod", call
|
||||
* undo_cmdmod() later.
|
||||
*/
|
||||
void
|
||||
undo_cmdmod(exarg_T *eap, int save_msg_scroll)
|
||||
apply_cmdmod(cmdmod_T *cmod)
|
||||
{
|
||||
if (eap->verbose_save >= 0)
|
||||
p_verbose = eap->verbose_save;
|
||||
|
||||
if (cmdmod.save_ei != NULL)
|
||||
#ifdef HAVE_SANDBOX
|
||||
if ((cmod->cmod_flags & CMOD_SANDBOX) && !cmod->cmod_did_sandbox)
|
||||
{
|
||||
// Restore 'eventignore' to the value before ":noautocmd".
|
||||
set_string_option_direct((char_u *)"ei", -1, cmdmod.save_ei,
|
||||
OPT_FREE, SID_NONE);
|
||||
free_string_option(cmdmod.save_ei);
|
||||
++sandbox;
|
||||
cmod->cmod_did_sandbox = TRUE;
|
||||
}
|
||||
#endif
|
||||
if (cmod->cmod_verbose > 0)
|
||||
{
|
||||
if (cmod->cmod_verbose_save == 0)
|
||||
cmod->cmod_verbose_save = p_verbose + 1;
|
||||
p_verbose = cmod->cmod_verbose;
|
||||
}
|
||||
|
||||
if (cmdmod.filter_regmatch.regprog != NULL)
|
||||
vim_regfree(cmdmod.filter_regmatch.regprog);
|
||||
if ((cmod->cmod_flags & (CMOD_SILENT | CMOD_UNSILENT))
|
||||
&& cmod->cmod_save_msg_silent == 0)
|
||||
{
|
||||
cmod->cmod_save_msg_silent = msg_silent + 1;
|
||||
cmod->cmod_save_msg_scroll = msg_scroll;
|
||||
}
|
||||
if (cmod->cmod_flags & CMOD_SILENT)
|
||||
++msg_silent;
|
||||
if (cmod->cmod_flags & CMOD_UNSILENT)
|
||||
msg_silent = 0;
|
||||
|
||||
if (eap->save_msg_silent != -1)
|
||||
if (cmod->cmod_flags & CMOD_ERRSILENT)
|
||||
{
|
||||
++emsg_silent;
|
||||
++cmod->cmod_did_esilent;
|
||||
}
|
||||
|
||||
if ((cmod->cmod_flags & CMOD_NOAUTOCMD) && cmod->cmod_save_ei == NULL)
|
||||
{
|
||||
// Set 'eventignore' to "all".
|
||||
// First save the existing option value for restoring it later.
|
||||
cmod->cmod_save_ei = vim_strsave(p_ei);
|
||||
set_string_option_direct((char_u *)"ei", -1,
|
||||
(char_u *)"all", OPT_FREE, SID_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Undo and free contents of "cmod".
|
||||
*/
|
||||
void
|
||||
undo_cmdmod(cmdmod_T *cmod)
|
||||
{
|
||||
if (cmod->cmod_verbose_save > 0)
|
||||
{
|
||||
p_verbose = cmod->cmod_verbose_save - 1;
|
||||
cmod->cmod_verbose_save = 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_SANDBOX
|
||||
if (cmod->cmod_did_sandbox)
|
||||
{
|
||||
--sandbox;
|
||||
cmod->cmod_did_sandbox = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (cmod->cmod_save_ei != NULL)
|
||||
{
|
||||
// Restore 'eventignore' to the value before ":noautocmd".
|
||||
set_string_option_direct((char_u *)"ei", -1, cmod->cmod_save_ei,
|
||||
OPT_FREE, SID_NONE);
|
||||
free_string_option(cmod->cmod_save_ei);
|
||||
cmod->cmod_save_ei = NULL;
|
||||
}
|
||||
|
||||
vim_regfree(cmod->cmod_filter_regmatch.regprog);
|
||||
|
||||
if (cmod->cmod_save_msg_silent > 0)
|
||||
{
|
||||
// messages could be enabled for a serious error, need to check if the
|
||||
// counters don't become negative
|
||||
if (!did_emsg || msg_silent > eap->save_msg_silent)
|
||||
msg_silent = eap->save_msg_silent;
|
||||
emsg_silent -= eap->did_esilent;
|
||||
if (!did_emsg || msg_silent > cmod->cmod_save_msg_silent - 1)
|
||||
msg_silent = cmod->cmod_save_msg_silent - 1;
|
||||
emsg_silent -= cmod->cmod_did_esilent;
|
||||
if (emsg_silent < 0)
|
||||
emsg_silent = 0;
|
||||
// Restore msg_scroll, it's set by file I/O commands, even when no
|
||||
// message is actually displayed.
|
||||
msg_scroll = save_msg_scroll;
|
||||
msg_scroll = cmod->cmod_save_msg_scroll;
|
||||
|
||||
// "silent reg" or "silent echo x" inside "redir" leaves msg_col
|
||||
// somewhere in the line. Put it back in the first column.
|
||||
if (redirecting())
|
||||
msg_col = 0;
|
||||
|
||||
cmod->cmod_save_msg_silent = 0;
|
||||
cmod->cmod_did_esilent = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3256,7 +3332,7 @@ find_ex_command(
|
||||
|
||||
// When followed by "=" or "+=" then it is an assignment.
|
||||
++emsg_silent;
|
||||
if (skip_expr(&after) == OK
|
||||
if (skip_expr(&after, NULL) == OK
|
||||
&& (*after == '='
|
||||
|| (*after != NUL && after[1] == '=')))
|
||||
eap->cmdidx = CMD_var;
|
||||
@@ -3418,6 +3494,11 @@ find_ex_command(
|
||||
break;
|
||||
}
|
||||
|
||||
// Not not recognize ":*" as the star command unless '*' is in
|
||||
// 'cpoptions'.
|
||||
if (eap->cmdidx == CMD_star && vim_strchr(p_cpo, CPO_STAR) == NULL)
|
||||
p = eap->cmd;
|
||||
|
||||
// Look for a user defined command as a last resort. Let ":Print" be
|
||||
// overruled by a user defined command.
|
||||
if ((eap->cmdidx == CMD_SIZE || eap->cmdidx == CMD_Print)
|
||||
@@ -4391,7 +4472,7 @@ expand_filename(
|
||||
if (p[0] == '`' && p[1] == '=')
|
||||
{
|
||||
p += 2;
|
||||
(void)skip_expr(&p);
|
||||
(void)skip_expr(&p, NULL);
|
||||
if (*p == '`')
|
||||
++p;
|
||||
continue;
|
||||
@@ -4666,7 +4747,9 @@ separate_nextcmd(exarg_T *eap)
|
||||
else if (p[0] == '`' && p[1] == '=' && (eap->argt & EX_XFILE))
|
||||
{
|
||||
p += 2;
|
||||
(void)skip_expr(&p);
|
||||
(void)skip_expr(&p, NULL);
|
||||
if (*p == NUL) // stop at NUL after CTRL-V
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -4939,7 +5022,7 @@ ex_buffer(exarg_T *eap)
|
||||
else
|
||||
goto_buffer(eap, DOBUF_FIRST, FORWARD, (int)eap->line2);
|
||||
if (eap->do_ecmd_cmd != NULL)
|
||||
do_cmdline_cmd(eap->do_ecmd_cmd);
|
||||
do_cmd_argument(eap->do_ecmd_cmd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4952,7 +5035,7 @@ ex_bmodified(exarg_T *eap)
|
||||
{
|
||||
goto_buffer(eap, DOBUF_MOD, FORWARD, (int)eap->line2);
|
||||
if (eap->do_ecmd_cmd != NULL)
|
||||
do_cmdline_cmd(eap->do_ecmd_cmd);
|
||||
do_cmd_argument(eap->do_ecmd_cmd);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4967,7 +5050,7 @@ ex_bnext(exarg_T *eap)
|
||||
|
||||
goto_buffer(eap, DOBUF_CURRENT, FORWARD, (int)eap->line2);
|
||||
if (eap->do_ecmd_cmd != NULL)
|
||||
do_cmdline_cmd(eap->do_ecmd_cmd);
|
||||
do_cmd_argument(eap->do_ecmd_cmd);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4984,7 +5067,7 @@ ex_bprevious(exarg_T *eap)
|
||||
|
||||
goto_buffer(eap, DOBUF_CURRENT, BACKWARD, (int)eap->line2);
|
||||
if (eap->do_ecmd_cmd != NULL)
|
||||
do_cmdline_cmd(eap->do_ecmd_cmd);
|
||||
do_cmd_argument(eap->do_ecmd_cmd);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5001,7 +5084,7 @@ ex_brewind(exarg_T *eap)
|
||||
|
||||
goto_buffer(eap, DOBUF_FIRST, FORWARD, 0);
|
||||
if (eap->do_ecmd_cmd != NULL)
|
||||
do_cmdline_cmd(eap->do_ecmd_cmd);
|
||||
do_cmd_argument(eap->do_ecmd_cmd);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5016,7 +5099,7 @@ ex_blast(exarg_T *eap)
|
||||
|
||||
goto_buffer(eap, DOBUF_LAST, BACKWARD, 0);
|
||||
if (eap->do_ecmd_cmd != NULL)
|
||||
do_cmdline_cmd(eap->do_ecmd_cmd);
|
||||
do_cmd_argument(eap->do_ecmd_cmd);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5109,7 +5192,8 @@ check_more(
|
||||
if (message)
|
||||
{
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
if ((p_confirm || cmdmod.confirm) && curbuf->b_fname != NULL)
|
||||
if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM))
|
||||
&& curbuf->b_fname != NULL)
|
||||
{
|
||||
char_u buff[DIALOG_MSG_SIZE];
|
||||
|
||||
@@ -5429,7 +5513,7 @@ ex_win_close(
|
||||
if (need_hide && !buf_hide(buf) && !forceit)
|
||||
{
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
if ((p_confirm || cmdmod.confirm) && p_write)
|
||||
if ((p_confirm || (cmdmod.cmod_flags & CMOD_CONFIRM)) && p_write)
|
||||
{
|
||||
bufref_T bufref;
|
||||
|
||||
@@ -6085,7 +6169,7 @@ ex_splitview(exarg_T *eap)
|
||||
#endif
|
||||
#ifdef FEAT_BROWSE
|
||||
char_u dot_path[] = ".";
|
||||
int browse_flag = cmdmod.browse;
|
||||
int save_cmod_flags = cmdmod.cmod_flags;
|
||||
#endif
|
||||
int use_tab = eap->cmdidx == CMD_tabedit
|
||||
|| eap->cmdidx == CMD_tabfind
|
||||
@@ -6101,7 +6185,7 @@ ex_splitview(exarg_T *eap)
|
||||
#ifdef FEAT_QUICKFIX
|
||||
// A ":split" in the quickfix window works like ":new". Don't want two
|
||||
// quickfix windows. But it's OK when doing ":tab split".
|
||||
if (bt_quickfix(curbuf) && cmdmod.tab == 0)
|
||||
if (bt_quickfix(curbuf) && cmdmod.cmod_tab == 0)
|
||||
{
|
||||
if (eap->cmdidx == CMD_split)
|
||||
eap->cmdidx = CMD_new;
|
||||
@@ -6124,7 +6208,7 @@ ex_splitview(exarg_T *eap)
|
||||
# endif
|
||||
#endif
|
||||
#ifdef FEAT_BROWSE
|
||||
if (cmdmod.browse
|
||||
if ((cmdmod.cmod_flags & CMOD_BROWSE)
|
||||
&& eap->cmdidx != CMD_vnew
|
||||
&& eap->cmdidx != CMD_new)
|
||||
{
|
||||
@@ -6150,7 +6234,7 @@ ex_splitview(exarg_T *eap)
|
||||
eap->arg = fname;
|
||||
}
|
||||
}
|
||||
cmdmod.browse = FALSE; // Don't browse again in do_ecmd().
|
||||
cmdmod.cmod_flags &= ~CMOD_BROWSE; // Don't browse again in do_ecmd().
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -6158,7 +6242,7 @@ ex_splitview(exarg_T *eap)
|
||||
*/
|
||||
if (use_tab)
|
||||
{
|
||||
if (win_new_tabpage(cmdmod.tab != 0 ? cmdmod.tab
|
||||
if (win_new_tabpage(cmdmod.cmod_tab != 0 ? cmdmod.cmod_tab
|
||||
: eap->addr_count == 0 ? 0
|
||||
: (int)eap->line2 + 1) != FAIL)
|
||||
{
|
||||
@@ -6168,7 +6252,7 @@ ex_splitview(exarg_T *eap)
|
||||
if (curwin != old_curwin
|
||||
&& win_valid(old_curwin)
|
||||
&& old_curwin->w_buffer != curbuf
|
||||
&& !cmdmod.keepalt)
|
||||
&& (cmdmod.cmod_flags & CMOD_KEEPALT) == 0)
|
||||
old_curwin->w_alt_fnum = curbuf->b_fnum;
|
||||
}
|
||||
}
|
||||
@@ -6177,11 +6261,7 @@ ex_splitview(exarg_T *eap)
|
||||
{
|
||||
// Reset 'scrollbind' when editing another file, but keep it when
|
||||
// doing ":split" without arguments.
|
||||
if (*eap->arg != NUL
|
||||
# ifdef FEAT_BROWSE
|
||||
|| cmdmod.browse
|
||||
# endif
|
||||
)
|
||||
if (*eap->arg != NUL)
|
||||
RESET_BINDING(curwin);
|
||||
else
|
||||
do_check_scrollbind(FALSE);
|
||||
@@ -6189,7 +6269,7 @@ ex_splitview(exarg_T *eap)
|
||||
}
|
||||
|
||||
# ifdef FEAT_BROWSE
|
||||
cmdmod.browse = browse_flag;
|
||||
cmdmod.cmod_flags = save_cmod_flags;
|
||||
# endif
|
||||
|
||||
# if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
|
||||
@@ -6362,7 +6442,7 @@ ex_resize(exarg_T *eap)
|
||||
need_mouse_correct = TRUE;
|
||||
# endif
|
||||
n = atol((char *)eap->arg);
|
||||
if (cmdmod.split & WSP_VERT)
|
||||
if (cmdmod.cmod_split & WSP_VERT)
|
||||
{
|
||||
if (*eap->arg == '-' || *eap->arg == '+')
|
||||
n += wp->w_width;
|
||||
@@ -6454,7 +6534,7 @@ ex_open(exarg_T *eap)
|
||||
}
|
||||
|
||||
/*
|
||||
* ":edit", ":badd", ":visual".
|
||||
* ":edit", ":badd", ":balt", ":visual".
|
||||
*/
|
||||
static void
|
||||
ex_edit(exarg_T *eap)
|
||||
@@ -6543,7 +6623,7 @@ do_exedit(
|
||||
else if ((eap->cmdidx != CMD_split && eap->cmdidx != CMD_vsplit)
|
||||
|| *eap->arg != NUL
|
||||
#ifdef FEAT_BROWSE
|
||||
|| cmdmod.browse
|
||||
|| (cmdmod.cmod_flags & CMOD_BROWSE)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
@@ -6569,7 +6649,8 @@ do_exedit(
|
||||
+ (eap->forceit ? ECMD_FORCEIT : 0)
|
||||
// after a split we can use an existing buffer
|
||||
+ (old_curwin != NULL ? ECMD_OLDBUF : 0)
|
||||
+ (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0 )
|
||||
+ (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0)
|
||||
+ (eap->cmdidx == CMD_balt ? ECMD_ALTBUF : 0)
|
||||
, old_curwin == NULL ? curwin : NULL) == FAIL)
|
||||
{
|
||||
// Editing the file failed. If the window was split, close it.
|
||||
@@ -6612,7 +6693,7 @@ do_exedit(
|
||||
else
|
||||
{
|
||||
if (eap->do_ecmd_cmd != NULL)
|
||||
do_cmdline_cmd(eap->do_ecmd_cmd);
|
||||
do_cmd_argument(eap->do_ecmd_cmd);
|
||||
#ifdef FEAT_TITLE
|
||||
n = curwin->w_arg_idx_invalid;
|
||||
#endif
|
||||
@@ -6632,7 +6713,7 @@ do_exedit(
|
||||
&& curwin != old_curwin
|
||||
&& win_valid(old_curwin)
|
||||
&& old_curwin->w_buffer != curbuf
|
||||
&& !cmdmod.keepalt)
|
||||
&& (cmdmod.cmod_flags & CMOD_KEEPALT) == 0)
|
||||
old_curwin->w_alt_fnum = curbuf->b_fnum;
|
||||
|
||||
ex_no_reprint = TRUE;
|
||||
@@ -6777,7 +6858,7 @@ ex_read(exarg_T *eap)
|
||||
return;
|
||||
|
||||
#ifdef FEAT_BROWSE
|
||||
if (cmdmod.browse)
|
||||
if (cmdmod.cmod_flags & CMOD_BROWSE)
|
||||
{
|
||||
char_u *browseFile;
|
||||
|
||||
@@ -7217,8 +7298,8 @@ ex_wincmd(exarg_T *eap)
|
||||
else if (!eap->skip)
|
||||
{
|
||||
// Pass flags on for ":vertical wincmd ]".
|
||||
postponed_split_flags = cmdmod.split;
|
||||
postponed_split_tab = cmdmod.tab;
|
||||
postponed_split_flags = cmdmod.cmod_split;
|
||||
postponed_split_tab = cmdmod.cmod_tab;
|
||||
do_window(*eap->arg, eap->addr_count > 0 ? eap->line2 : 0L, xchar);
|
||||
postponed_split_flags = 0;
|
||||
postponed_split_tab = 0;
|
||||
@@ -7621,7 +7702,7 @@ ex_redir(exarg_T *eap)
|
||||
if (fname == NULL)
|
||||
return;
|
||||
#ifdef FEAT_BROWSE
|
||||
if (cmdmod.browse)
|
||||
if (cmdmod.cmod_flags & CMOD_BROWSE)
|
||||
{
|
||||
char_u *browseFile;
|
||||
|
||||
@@ -8095,6 +8176,9 @@ ex_startinsert(exarg_T *eap)
|
||||
restart_edit = 'i';
|
||||
curwin->w_curswant = 0; // avoid MAXCOL
|
||||
}
|
||||
|
||||
if (VIsual_active)
|
||||
showmode();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8293,8 +8377,8 @@ ex_pedit(exarg_T *eap)
|
||||
ex_stag(exarg_T *eap)
|
||||
{
|
||||
postponed_split = -1;
|
||||
postponed_split_flags = cmdmod.split;
|
||||
postponed_split_tab = cmdmod.tab;
|
||||
postponed_split_flags = cmdmod.cmod_split;
|
||||
postponed_split_tab = cmdmod.cmod_tab;
|
||||
ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name + 1);
|
||||
postponed_split_flags = 0;
|
||||
postponed_split_tab = 0;
|
||||
@@ -8420,7 +8504,7 @@ find_cmdline_var(char_u *src, int *usedlen)
|
||||
* Evaluate cmdline variables.
|
||||
*
|
||||
* change '%' to curbuf->b_ffname
|
||||
* '#' to curwin->w_altfile
|
||||
* '#' to curwin->w_alt_fnum
|
||||
* '<cword>' to word under the cursor
|
||||
* '<cWORD>' to WORD under the cursor
|
||||
* '<cexpr>' to C-expression under the cursor
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user