mirror of
https://github.com/zoriya/vim.git
synced 2026-01-08 16:00:51 +00:00
Compare commits
224 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6914e87d3c | ||
|
|
04947cc6ed | ||
|
|
a974953443 | ||
|
|
18062fcad6 | ||
|
|
8c801b374b | ||
|
|
f9a65505d1 | ||
|
|
008bff967f | ||
|
|
6057748a1a | ||
|
|
6c3843ca8a | ||
|
|
2e2d758902 | ||
|
|
f76ec1eeb5 | ||
|
|
51b477f74f | ||
|
|
4fa1175765 | ||
|
|
37096afd3f | ||
|
|
3dc3474f00 | ||
|
|
39d4cab494 | ||
|
|
3650fd7098 | ||
|
|
057e84afe5 | ||
|
|
087b5ff35d | ||
|
|
0a84284e60 | ||
|
|
3f1e9f000f | ||
|
|
0f2a5cc68b | ||
|
|
9faec4e3d4 | ||
|
|
0abc6e471a | ||
|
|
9f646c2e11 | ||
|
|
d0bce504ec | ||
|
|
0e62a6742b | ||
|
|
1bd3cb2019 | ||
|
|
7d41410a45 | ||
|
|
2c6553498e | ||
|
|
21a83bd53d | ||
|
|
eba13e4ea2 | ||
|
|
bc327ccc3d | ||
|
|
9cb577a682 | ||
|
|
41f0895c6e | ||
|
|
6bfc475f71 | ||
|
|
b4893b8450 | ||
|
|
7e82c5f338 | ||
|
|
21578271bb | ||
|
|
027c4ab4d2 | ||
|
|
dc167465f8 | ||
|
|
723ef5db98 | ||
|
|
a1070eae77 | ||
|
|
5b5ae29bd3 | ||
|
|
ada1d870b4 | ||
|
|
10b9421f3b | ||
|
|
12d265315f | ||
|
|
d3f8a9ee65 | ||
|
|
c7dac8534e | ||
|
|
064095012c | ||
|
|
527ed38cfa | ||
|
|
e0890d678d | ||
|
|
3aca5a6fbc | ||
|
|
c0fcb6e0b1 | ||
|
|
9bbd883b35 | ||
|
|
333bd56422 | ||
|
|
04ea7e9049 | ||
|
|
b8554304c3 | ||
|
|
eed9d46293 | ||
|
|
7c5b3c0369 | ||
|
|
4afa77419f | ||
|
|
6281815ecc | ||
|
|
2379f87eb4 | ||
|
|
9979fcd72e | ||
|
|
03dfde2b5f | ||
|
|
39f3b14110 | ||
|
|
10ccfb2a17 | ||
|
|
8d4be89011 | ||
|
|
a98f8a2305 | ||
|
|
942db23c9c | ||
|
|
0fa09676c2 | ||
|
|
c150c09ec4 | ||
|
|
31842cd077 | ||
|
|
44ec21c467 | ||
|
|
d9d7789b6f | ||
|
|
ca753ec862 | ||
|
|
f785aa1354 | ||
|
|
0bcadf14aa | ||
|
|
3b678047bc | ||
|
|
5affc03468 | ||
|
|
418a29f0ff | ||
|
|
5202929dab | ||
|
|
8f33ebfade | ||
|
|
3ff656f6b4 | ||
|
|
f3fa18468c | ||
|
|
b17ec4d427 | ||
|
|
82db31c104 | ||
|
|
4223d43c0f | ||
|
|
963ffa0a5a | ||
|
|
a853089479 | ||
|
|
4549dad874 | ||
|
|
ba98fb54ae | ||
|
|
0123cc1e14 | ||
|
|
dee37dc733 | ||
|
|
6628b7ebff | ||
|
|
a5a1ec1826 | ||
|
|
4f53b79bf5 | ||
|
|
c3fc75db02 | ||
|
|
00385114db | ||
|
|
0dc5f603e9 | ||
|
|
dd07c02232 | ||
|
|
983d83ff1c | ||
|
|
dfc3db76b9 | ||
|
|
2c7080bf1c | ||
|
|
8c6951fa28 | ||
|
|
aad5f9d79a | ||
|
|
efa1923565 | ||
|
|
6502643677 | ||
|
|
f5a5116a96 | ||
|
|
038e09ee76 | ||
|
|
139348f3e8 | ||
|
|
ab65fc77c5 | ||
|
|
92bb83e41c | ||
|
|
8ab375706e | ||
|
|
6bcb877ec1 | ||
|
|
2c363a2e95 | ||
|
|
fef8064b54 | ||
|
|
fc1dafa91c | ||
|
|
8bead9a058 | ||
|
|
0dcd39bad5 | ||
|
|
4dba04256b | ||
|
|
7b6903f02c | ||
|
|
2e5910bfbb | ||
|
|
91478ae49a | ||
|
|
148be9bc1c | ||
|
|
d5e8c92816 | ||
|
|
e7bebc495d | ||
|
|
7781ebe50f | ||
|
|
3b69006973 | ||
|
|
9d20daffc2 | ||
|
|
f9547eb6ef | ||
|
|
5daa911626 | ||
|
|
0346b799fc | ||
|
|
e507ff15d5 | ||
|
|
80ad3e2569 | ||
|
|
f272ae12ac | ||
|
|
c03f5c677a | ||
|
|
853886722c | ||
|
|
3d2bb8b6f1 | ||
|
|
6a12e3342d | ||
|
|
4d8479b335 | ||
|
|
206c2a6e19 | ||
|
|
3445320839 | ||
|
|
f2b26bcf8f | ||
|
|
b63f3ca66d | ||
|
|
76ab5446d5 | ||
|
|
ebd211c8a3 | ||
|
|
f8c6a17180 | ||
|
|
59ff64079b | ||
|
|
92e5df8047 | ||
|
|
3eb6bd9c2b | ||
|
|
28976e2acc | ||
|
|
df2c2988bb | ||
|
|
97202d9516 | ||
|
|
61015162ba | ||
|
|
1d859e2421 | ||
|
|
5ed58c7b70 | ||
|
|
9a046fd08b | ||
|
|
d697ddea14 | ||
|
|
2e6cdb91e8 | ||
|
|
3e492c2d5f | ||
|
|
bed72df3e6 | ||
|
|
21829c5f2c | ||
|
|
b7e2670b6a | ||
|
|
bb4b93ed85 | ||
|
|
ce0370d9e6 | ||
|
|
98989a0014 | ||
|
|
ff0e57fe77 | ||
|
|
e0e3917554 | ||
|
|
e5ea346a07 | ||
|
|
5c829bf229 | ||
|
|
ab55f11d9b | ||
|
|
c05fe07529 | ||
|
|
4efd994829 | ||
|
|
107e9cecf7 | ||
|
|
ced68a0070 | ||
|
|
8323cab31c | ||
|
|
f002a41d12 | ||
|
|
b204990346 | ||
|
|
7cf0c114d6 | ||
|
|
40be52ba71 | ||
|
|
dfbc5fd879 | ||
|
|
7cebe8ba7d | ||
|
|
9a562c184d | ||
|
|
9ae3705b6e | ||
|
|
4bce26bb70 | ||
|
|
402115f1c2 | ||
|
|
0d3de8cb59 | ||
|
|
b3005ce191 | ||
|
|
9b6344613e | ||
|
|
57d5a01cb4 | ||
|
|
e32e516dfa | ||
|
|
f904133e1a | ||
|
|
e71996bd08 | ||
|
|
5e6a7aa2b2 | ||
|
|
ccb47a2899 | ||
|
|
b1f2857096 | ||
|
|
c5f59fab23 | ||
|
|
a0f7f73ebb | ||
|
|
77a849c4b3 | ||
|
|
99880f96cf | ||
|
|
a28639e711 | ||
|
|
e64f83cc6a | ||
|
|
09fbedc8dc | ||
|
|
98a29d00a4 | ||
|
|
82aa6e09e0 | ||
|
|
f30a14db3b | ||
|
|
585587dadb | ||
|
|
036d07144e | ||
|
|
1430ceeb2d | ||
|
|
3af15ab788 | ||
|
|
85773bf32b | ||
|
|
239f8d9326 | ||
|
|
e2edc2ed4a | ||
|
|
70250fb4d2 | ||
|
|
f898f7c68d | ||
|
|
9ebcf231bd | ||
|
|
351ead09dd | ||
|
|
7c886db915 | ||
|
|
a3b494d6af | ||
|
|
e2924328c1 | ||
|
|
bf78974ca4 | ||
|
|
648ea76e1d | ||
|
|
883cf97f10 |
6
.github/CODEOWNERS
vendored
6
.github/CODEOWNERS
vendored
@@ -31,6 +31,7 @@ runtime/compiler/dartdevc.vim @dkearns
|
||||
runtime/compiler/dartdoc.vim @dkearns
|
||||
runtime/compiler/dartfmt.vim @dkearns
|
||||
runtime/compiler/eruby.vim @dkearns
|
||||
runtime/compiler/fbc.vim @dkearns
|
||||
runtime/compiler/gawk.vim @dkearns
|
||||
runtime/compiler/gjs.vim @dkearns
|
||||
runtime/compiler/haml.vim @tpope
|
||||
@@ -50,6 +51,7 @@ runtime/compiler/rubyunit.vim @dkearns
|
||||
runtime/compiler/sass.vim @tpope
|
||||
runtime/compiler/se.vim @dkearns
|
||||
runtime/compiler/shellcheck.vim @dkearns
|
||||
runtime/compiler/sml.vim @dkearns
|
||||
runtime/compiler/stylelint.vim @dkearns
|
||||
runtime/compiler/tcl.vim @dkearns
|
||||
runtime/compiler/tidy.vim @dkearns
|
||||
@@ -66,12 +68,14 @@ 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/basic.vim @dkearns
|
||||
runtime/ftplugin/bst.vim @tpope
|
||||
runtime/ftplugin/cfg.vim @chrisbra
|
||||
runtime/ftplugin/css.vim @dkearns
|
||||
runtime/ftplugin/cucumber.vim @tpope
|
||||
runtime/ftplugin/eiffel.vim @dkearns
|
||||
runtime/ftplugin/eruby.vim @tpope @dkearns
|
||||
runtime/ftplugin/freebasic.vim @dkearns
|
||||
runtime/ftplugin/git.vim @tpope
|
||||
runtime/ftplugin/gitcommit.vim @tpope
|
||||
runtime/ftplugin/gitconfig.vim @tpope
|
||||
@@ -93,6 +97,7 @@ runtime/ftplugin/ruby.vim @tpope @dkearns
|
||||
runtime/ftplugin/sass.vim @tpope
|
||||
runtime/ftplugin/scss.vim @tpope
|
||||
runtime/ftplugin/spec.vim @ignatenkobrain
|
||||
runtime/ftplugin/tidy.vim @dkearns
|
||||
runtime/ftplugin/tmux.vim @ericpruitt
|
||||
runtime/ftplugin/typescript.vim @dkearns
|
||||
runtime/ftplugin/typescriptreact.vim @dkearns
|
||||
@@ -127,6 +132,7 @@ runtime/syntax/amiga.vim @cecamp
|
||||
runtime/syntax/asm.vim @dkearns
|
||||
runtime/syntax/asmh8300.vim @dkearns
|
||||
runtime/syntax/awk.vim @dkearns
|
||||
runtime/syntax/basic.vim @dkearns
|
||||
runtime/syntax/bst.vim @tpope
|
||||
runtime/syntax/cabal.vim @coot
|
||||
runtime/syntax/cabalconfig.vim @coot
|
||||
|
||||
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@@ -7,7 +7,7 @@ on:
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-18.04
|
||||
|
||||
env:
|
||||
CC: ${{ matrix.compiler }}
|
||||
@@ -208,6 +208,7 @@ jobs:
|
||||
TRAVIS_JOB_ID: ${{ github.run_id }}
|
||||
run: |
|
||||
sudo apt-get install -y python3-setuptools python3-wheel
|
||||
sudo -H pip3 install pip -U
|
||||
# needed for https support for coveralls building cffi only works with gcc, not with clang
|
||||
CC=gcc pip3 install --user cpp-coveralls pyopenssl ndg-httpsclient pyasn1
|
||||
~/.local/bin/coveralls -b "${SRCDIR}" -x .xs -e "${SRCDIR}"/if_perl.c -e "${SRCDIR}"/xxd -e "${SRCDIR}"/libvterm --encodings utf-8
|
||||
@@ -227,7 +228,7 @@ jobs:
|
||||
done
|
||||
|
||||
coveralls:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-18.04
|
||||
|
||||
needs: linux
|
||||
if: always() && github.event_name != 'pull_request'
|
||||
|
||||
@@ -70,6 +70,7 @@ the text. For example, reindent all the lines:
|
||||
| Vim new | 0.190276 |
|
||||
|
||||
The differences are smaller, but Vim 9 script is clearly the fastest.
|
||||
Using LuaJIT gives 0.25, only a little bit faster than plain Lua.
|
||||
|
||||
How does Vim9 script work? The function is first compiled into a sequence of
|
||||
instructions. Each instruction has one or two parameters and a stack is
|
||||
|
||||
@@ -359,6 +359,8 @@ Section "$(str_section_exe)" id_section_exe
|
||||
|
||||
SetOutPath $0\colors
|
||||
File ${VIMRT}\colors\*.*
|
||||
SetOutPath $0\colors\tools
|
||||
File ${VIMRT}\colors\tools\*.*
|
||||
|
||||
SetOutPath $0\compiler
|
||||
File ${VIMRT}\compiler\*.*
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Dávid Szabó ( complex857 AT gmail DOT com )
|
||||
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" URL: https://github.com/shawncplus/phpcomplete.vim
|
||||
" Last Change: 2018 Oct 10
|
||||
" Last Change: 2021 Feb 08
|
||||
"
|
||||
" OPTIONS:
|
||||
"
|
||||
@@ -122,7 +122,6 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
" If exists b:php_menu it means completion was already constructed we
|
||||
" don't need to do anything more
|
||||
if exists("b:php_menu")
|
||||
@@ -148,8 +147,6 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
|
||||
try
|
||||
let eventignore = &eventignore
|
||||
let &eventignore = 'all'
|
||||
let winheight = winheight(0)
|
||||
let winnr = winnr()
|
||||
|
||||
let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(getline(0, line('.')))
|
||||
|
||||
@@ -183,7 +180,6 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
|
||||
endif
|
||||
|
||||
if filereadable(classlocation)
|
||||
let classfile = readfile(classlocation)
|
||||
let classcontent = ''
|
||||
let classcontent .= "\n".phpcomplete#GetClassContents(classlocation, classname)
|
||||
let sccontent = split(classcontent, "\n")
|
||||
@@ -217,7 +213,6 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
|
||||
return phpcomplete#CompleteGeneral(a:base, current_namespace, imports)
|
||||
endif
|
||||
finally
|
||||
silent! exec winnr.'resize '.winheight
|
||||
let &eventignore = eventignore
|
||||
endtry
|
||||
endfunction
|
||||
@@ -1025,7 +1020,7 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) "
|
||||
let c_var = '$'.c_var
|
||||
endif
|
||||
let c_variables[c_var] = ''
|
||||
if g:phpcomplete_parse_docblock_comments && len(get(variables, var_index)) > 0
|
||||
if g:phpcomplete_parse_docblock_comments && len(get(variables, var_index, '')) > 0
|
||||
let c_doc[c_var] = phpcomplete#GetDocBlock(a:sccontent, variables[var_index])
|
||||
endif
|
||||
let var_index += 1
|
||||
@@ -2082,26 +2077,17 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
||||
" ...
|
||||
" ]
|
||||
"
|
||||
let full_file_path = fnamemodify(a:file_path, ':p')
|
||||
let class_name_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*'
|
||||
let cfile = join(a:file_lines, "\n")
|
||||
let full_file_path = fnamemodify(a:file_path, ':p')
|
||||
let result = []
|
||||
" We use new buffer and (later) normal! because
|
||||
" this is the most efficient way. The other way
|
||||
" is to go through the looong string looking for
|
||||
" matching {}
|
||||
let popup_id = popup_create(a:file_lines, {'hidden': v:true})
|
||||
|
||||
" remember the window we started at
|
||||
let phpcomplete_original_window = winnr()
|
||||
call win_execute(popup_id, 'call search(''\c\(class\|interface\|trait\)\_s\+'.a:class_name.'\(\>\|$\)'')')
|
||||
call win_execute(popup_id, "let cfline = line('.')")
|
||||
call win_execute(popup_id, "call search('{')")
|
||||
call win_execute(popup_id, "let endline = line('.')")
|
||||
|
||||
silent! below 1new
|
||||
silent! 0put =cfile
|
||||
call search('\c\(class\|interface\|trait\)\_s\+'.a:class_name.'\(\>\|$\)')
|
||||
let cfline = line('.')
|
||||
call search('{')
|
||||
let endline = line('.')
|
||||
|
||||
let content = join(getline(cfline, endline), "\n")
|
||||
call win_execute(popup_id, 'let content = join(getline('.cfline.', '.endline.'), "\n")')
|
||||
" Catch extends
|
||||
if content =~? 'extends'
|
||||
let extends_string = matchstr(content, '\(class\|interface\)\_s\+'.a:class_name.'\_.\+extends\_s\+\zs\('.class_name_pattern.'\(,\|\_s\)*\)\+\ze\(extends\|{\)')
|
||||
@@ -2117,14 +2103,16 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
||||
else
|
||||
let implemented_interfaces = []
|
||||
endif
|
||||
call searchpair('{', '', '}', 'W')
|
||||
let class_closing_bracket_line = line('.')
|
||||
|
||||
call win_execute(popup_id, 'let [class_closing_bracket_line, class_closing_bracket_col] = searchpairpos("{", "", "}", "W")')
|
||||
|
||||
" Include class docblock
|
||||
let doc_line = cfline - 1
|
||||
if getline(doc_line) =~? '^\s*\*/'
|
||||
call win_execute(popup_id, 'let l = getline('.doc_line.')')
|
||||
if l =~? '^\s*\*/'
|
||||
while doc_line != 0
|
||||
if getline(doc_line) =~? '^\s*/\*\*'
|
||||
call win_execute(popup_id, 'let l = getline('.doc_line.')')
|
||||
if l =~? '^\s*/\*\*'
|
||||
let cfline = doc_line
|
||||
break
|
||||
endif
|
||||
@@ -2132,22 +2120,22 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
||||
endwhile
|
||||
endif
|
||||
|
||||
let classcontent = join(getline(cfline, class_closing_bracket_line), "\n")
|
||||
call win_execute(popup_id, 'let classcontent = join(getline('.cfline.', '.class_closing_bracket_line.'), "\n")')
|
||||
|
||||
let used_traits = []
|
||||
" move back to the line next to the class's definition
|
||||
call cursor(endline + 1, 1)
|
||||
call win_execute(popup_id, 'call cursor('.(endline + 1).', 1)')
|
||||
let keep_searching = 1
|
||||
while keep_searching != 0
|
||||
" try to grab "use..." keywords
|
||||
let [lnum, col] = searchpos('\c^\s\+use\s\+'.class_name_pattern, 'cW', class_closing_bracket_line)
|
||||
let syn_name = synIDattr(synID(lnum, col, 0), "name")
|
||||
call win_execute(popup_id, 'let [lnum, col] = searchpos(''\c^\s\+use\s\+'.class_name_pattern.''', "cW", '.class_closing_bracket_line.')')
|
||||
call win_execute(popup_id, 'let syn_name = synIDattr(synID('.lnum.', '.col.', 0), "name")')
|
||||
if syn_name =~? 'string\|comment'
|
||||
call cursor(lnum + 1, 1)
|
||||
call win_execute(popup_id, 'call cursor('.(lnum + 1).', 1)')
|
||||
continue
|
||||
endif
|
||||
|
||||
let trait_line = getline(lnum)
|
||||
call win_execute(popup_id, 'let trait_line = getline('.lnum.')')
|
||||
if trait_line !~? ';'
|
||||
" try to find the next line containing ';'
|
||||
let l = lnum
|
||||
@@ -2157,25 +2145,23 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
||||
while search_line !~? ';' && l > 0
|
||||
" file lines are reversed so we need to go backwards
|
||||
let l += 1
|
||||
let search_line = getline(l)
|
||||
call win_execute(popup_id, 'let search_line = getline('.l.')')
|
||||
let trait_line .= ' '.substitute(search_line, '\(^\s\+\|\s\+$\)', '', 'g')
|
||||
endwhile
|
||||
endif
|
||||
let use_expression = matchstr(trait_line, '^\s*use\s\+\zs.\{-}\ze;')
|
||||
let use_parts = map(split(use_expression, '\s*,\s*'), 'substitute(v:val, "\\s+", " ", "g")')
|
||||
let used_traits += map(use_parts, 'substitute(v:val, "\\s", "", "g")')
|
||||
call cursor(lnum + 1, 1)
|
||||
call win_execute(popup_id, 'call cursor('.(lnum + 1).', 1)')
|
||||
|
||||
if [lnum, col] == [0, 0]
|
||||
let keep_searching = 0
|
||||
endif
|
||||
endwhile
|
||||
|
||||
silent! bw! %
|
||||
call popup_close(popup_id)
|
||||
|
||||
let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(a:file_lines[0:cfline])
|
||||
" go back to original window
|
||||
exe phpcomplete_original_window.'wincmd w'
|
||||
call add(result, {
|
||||
\ 'class': a:class_name,
|
||||
\ 'content': classcontent,
|
||||
@@ -2532,40 +2518,37 @@ function! phpcomplete#FormatDocBlock(info) " {{{
|
||||
endif
|
||||
|
||||
return res
|
||||
endfunction!
|
||||
endfunction
|
||||
" }}}
|
||||
|
||||
function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
||||
let original_window = winnr()
|
||||
|
||||
silent! below 1new
|
||||
silent! 0put =a:file_lines
|
||||
normal! G
|
||||
let popup_id = popup_create(a:file_lines, {'hidden': v:true})
|
||||
call win_execute(popup_id, 'normal! G')
|
||||
|
||||
" clear out classes, functions and other blocks
|
||||
while 1
|
||||
let block_start_pos = searchpos('\c\(class\|trait\|function\|interface\)\s\+\_.\{-}\zs{', 'Web')
|
||||
call win_execute(popup_id, 'let block_start_pos = searchpos(''\c\(class\|trait\|function\|interface\)\s\+\_.\{-}\zs{'', "Web")')
|
||||
if block_start_pos == [0, 0]
|
||||
break
|
||||
endif
|
||||
let block_end_pos = searchpairpos('{', '', '}\|\%$', 'W', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
|
||||
call win_execute(popup_id, 'let block_end_pos = searchpairpos("{", "", ''}\|\%$'', "W", ''synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"'')')
|
||||
|
||||
let popup_lines = winbufnr(popup_id)->getbufline(1, '$')
|
||||
if block_end_pos != [0, 0]
|
||||
" end of the block found, just delete it
|
||||
silent! exec block_start_pos[0].','.block_end_pos[0].'d _'
|
||||
call remove(popup_lines, block_start_pos[0] - 1, block_end_pos[0] - 1)
|
||||
else
|
||||
" block pair not found, use block start as beginning and the end
|
||||
" of the buffer instead
|
||||
silent! exec block_start_pos[0].',$d _'
|
||||
call remove(popup_lines, block_start_pos[0] - 1, -1)
|
||||
endif
|
||||
call popup_settext(popup_id, popup_lines)
|
||||
endwhile
|
||||
normal! G
|
||||
call win_execute(popup_id, 'normal! G', 'silent!')
|
||||
|
||||
" grab the remains
|
||||
let file_lines = reverse(getline(1, line('.') - 1))
|
||||
|
||||
silent! bw! %
|
||||
exe original_window.'wincmd w'
|
||||
call win_execute(popup_id, "let file_lines = reverse(getline(1, line('.')-1))")
|
||||
call popup_close(popup_id)
|
||||
|
||||
let namespace_name_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*'
|
||||
let i = 0
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
" Vim completion script
|
||||
" Language: All languages, uses existing syntax highlighting rules
|
||||
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
|
||||
" Version: 13.0
|
||||
" Last Change: 2019 Aug 08
|
||||
" Version: 14.0
|
||||
" Last Change: 2020 Dec 30
|
||||
" Usage: For detailed help, ":help ft-syntax-omni"
|
||||
|
||||
" History
|
||||
"
|
||||
" Version 14.0
|
||||
" - Fixed issue with single quotes and is_keyword
|
||||
" https://github.com/vim/vim/issues/7463
|
||||
"
|
||||
" Version 13.0
|
||||
" - Extended the option omni_syntax_group_include_{filetype}
|
||||
" to accept a comma separated list of regex's rather than
|
||||
@@ -179,7 +183,8 @@ function! syntaxcomplete#Complete(findstart, base)
|
||||
endif
|
||||
|
||||
" let base = s:prepended . a:base
|
||||
let base = s:prepended
|
||||
" let base = s:prepended
|
||||
let base = substitute(s:prepended, "'", "''", 'g')
|
||||
|
||||
let filetype = substitute(&filetype, '\.', '_', 'g')
|
||||
let list_idx = index(s:cache_name, filetype, 0, &ignorecase)
|
||||
@@ -548,7 +553,7 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
|
||||
" let syn_list = substitute( @l, '^.*xxx\s*\%(contained\s*\)\?', "", '' )
|
||||
" let syn_list = substitute( @l, '^.*xxx\s*', "", '' )
|
||||
|
||||
" We only want the words for the lines begining with
|
||||
" We only want the words for the lines beginning with
|
||||
" containedin, but there could be other items.
|
||||
|
||||
" Tried to remove all lines that do not begin with contained
|
||||
|
||||
27
runtime/compiler/fbc.vim
Normal file
27
runtime/compiler/fbc.vim
Normal file
@@ -0,0 +1,27 @@
|
||||
" Vim compiler file
|
||||
" Compiler: FreeBASIC Compiler
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2015 Jan 10
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "fbc"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
CompilerSet makeprg=fbc
|
||||
CompilerSet errorformat=%-G%.%#Too\ many\ errors\\,\ exiting,
|
||||
\%f(%l)\ %tarning\ %n(%\\d%\\+):\ %m,
|
||||
\%E%f(%l)\ error\ %n:\ %m,
|
||||
\%-Z%p^,
|
||||
\%-C%.%#,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
28
runtime/compiler/sml.vim
Normal file
28
runtime/compiler/sml.vim
Normal file
@@ -0,0 +1,28 @@
|
||||
" Vim compiler file
|
||||
" Compiler: SML/NJ Compiler
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2020 Feb 10
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "sml"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
CompilerSet makeprg=sml
|
||||
CompilerSet errorformat=%f:%l.%c-%\\d%\\+.%\\d%\\+\ %trror:\ %m,
|
||||
\%f:%l.%c\ %trror:\ %m,
|
||||
\%trror:\ %m
|
||||
\%f:%l.%c-%\\d%\\+.%\\d%\\+\ %tarning:\ %m,
|
||||
\%f:%l.%c\ %tarning:\ %m,
|
||||
\%tarning:\ %m,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim compiler file
|
||||
" Compiler: HTML Tidy
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2016 Apr 21
|
||||
" Last Change: 2020 Sep 4
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@@ -12,8 +12,15 @@ if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
CompilerSet makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes\ %:S
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" foo.html:8:1: Warning: inserting missing 'foobar' element
|
||||
" foo.html:9:2: Error: <foobar> is not recognized!
|
||||
CompilerSet errorformat=%f:%l:%c:\ %trror:%m,%f:%l:%c:\ %tarning:%m,%-G%.%#
|
||||
CompilerSet makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes
|
||||
CompilerSet errorformat=%f:%l:%c:\ %trror:\ %m,
|
||||
\%f:%l:%c:\ %tarning:\ %m,
|
||||
\%f:%l:%c:\ %tnfo:\ %m,
|
||||
\%f:%l:%c:\ %m,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 8.2. Last change: 2020 Dec 19
|
||||
*autocmd.txt* For Vim version 8.2. Last change: 2021 Jan 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -54,7 +54,8 @@ effects. Be careful not to destroy your text.
|
||||
:au[tocmd] [group] {event} {pat} [++once] [++nested] {cmd}
|
||||
Add {cmd} to the list of commands that Vim will
|
||||
execute automatically on {event} for a file matching
|
||||
{pat} |autocmd-patterns|.
|
||||
{pat} |autocmd-patterns|.
|
||||
Here {event} cannot be "*". *E1155*
|
||||
Note: A quote character is seen as argument to the
|
||||
:autocmd and won't start a comment.
|
||||
Vim always adds the {cmd} after existing autocommands,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 8.2. Last change: 2020 Nov 21
|
||||
*change.txt* For Vim version 8.2. Last change: 2021 Jan 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1631,24 +1631,31 @@ default setting is "tcq". You can separate the option letters with commas for
|
||||
readability.
|
||||
|
||||
letter meaning when present in 'formatoptions' ~
|
||||
|
||||
*fo-t*
|
||||
t Auto-wrap text using textwidth
|
||||
*fo-c*
|
||||
c Auto-wrap comments using textwidth, inserting the current comment
|
||||
leader automatically.
|
||||
*fo-r*
|
||||
r Automatically insert the current comment leader after hitting
|
||||
<Enter> in Insert mode.
|
||||
*fo-o*
|
||||
o Automatically insert the current comment leader after hitting 'o' or
|
||||
'O' in Normal mode.
|
||||
*fo-q*
|
||||
q Allow formatting of comments with "gq".
|
||||
Note that formatting will not change blank lines or lines containing
|
||||
only the comment leader. A new paragraph starts after such a line,
|
||||
or when the comment leader changes.
|
||||
*fo-w*
|
||||
w Trailing white space indicates a paragraph continues in the next line.
|
||||
A line that ends in a non-white character ends a paragraph.
|
||||
*fo-a*
|
||||
a Automatic formatting of paragraphs. Every time text is inserted or
|
||||
deleted the paragraph will be reformatted. See |auto-format|.
|
||||
When the 'c' flag is present this only happens for recognized
|
||||
comments.
|
||||
*fo-n*
|
||||
n When formatting text, recognize numbered lists. This actually uses
|
||||
the 'formatlistpat' option, thus any kind of list can be used. The
|
||||
indent of the text after the number is used for the next line. The
|
||||
@@ -1659,6 +1666,7 @@ n When formatting text, recognize numbered lists. This actually uses
|
||||
1. the first item
|
||||
wraps
|
||||
2. the second item
|
||||
< *fo-2*
|
||||
2 When formatting text, use the indent of the second line of a paragraph
|
||||
for the rest of the paragraph, instead of the indent of the first
|
||||
line. This supports paragraphs in which the first line has a
|
||||
@@ -1668,36 +1676,46 @@ n When formatting text, recognize numbered lists. This actually uses
|
||||
second line of the same paragraph
|
||||
third line.
|
||||
< This also works inside comments, ignoring the comment leader.
|
||||
*fo-v*
|
||||
v Vi-compatible auto-wrapping in insert mode: Only break a line at a
|
||||
blank that you have entered during the current insert command. (Note:
|
||||
this is not 100% Vi compatible. Vi has some "unexpected features" or
|
||||
bugs in this area. It uses the screen column instead of the line
|
||||
column.)
|
||||
*fo-b*
|
||||
b Like 'v', but only auto-wrap if you enter a blank at or before
|
||||
the wrap margin. If the line was longer than 'textwidth' when you
|
||||
started the insert, or you do not enter a blank in the insert before
|
||||
reaching 'textwidth', Vim does not perform auto-wrapping.
|
||||
*fo-l*
|
||||
l Long lines are not broken in insert mode: When a line was longer than
|
||||
'textwidth' when the insert command started, Vim does not
|
||||
automatically format it.
|
||||
*fo-m*
|
||||
m Also break at a multibyte character above 255. This is useful for
|
||||
Asian text where every character is a word on its own.
|
||||
*fo-M*
|
||||
M When joining lines, don't insert a space before or after a multibyte
|
||||
character. Overrules the 'B' flag.
|
||||
*fo-B*
|
||||
B When joining lines, don't insert a space between two multibyte
|
||||
characters. Overruled by the 'M' flag.
|
||||
*fo-1*
|
||||
1 Don't break a line after a one-letter word. It's broken before it
|
||||
instead (if possible).
|
||||
*fo-]*
|
||||
] Respect textwidth rigorously. With this flag set, no line can be
|
||||
longer than textwidth, unless line-break-prohibition rules make this
|
||||
impossible. Mainly for CJK scripts and works only if 'encoding' is
|
||||
"utf-8".
|
||||
*fo-j*
|
||||
j Where it makes sense, remove a comment leader when joining lines. For
|
||||
example, joining:
|
||||
int i; // the index ~
|
||||
// in the list ~
|
||||
Becomes:
|
||||
int i; // the index in the list ~
|
||||
*fo-p*
|
||||
p Don't break lines at single spaces that follow periods. This is
|
||||
intended to complement 'joinspaces' and |cpo-J|, for prose with
|
||||
sentences separated by two spaces. For example, with 'textwidth' set
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*cmdline.txt* For Vim version 8.2. Last change: 2020 Dec 26
|
||||
*cmdline.txt* For Vim version 8.2. Last change: 2021 Jan 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1096,7 +1096,7 @@ Also see |`=|.
|
||||
In the command-line window the command line can be edited just like editing
|
||||
text in any window. It is a special kind of window, because you cannot leave
|
||||
it in a normal way.
|
||||
{not available when compiled without the |+cmdline_hist| feature}
|
||||
{not available when compiled without the |+cmdwin| feature}
|
||||
|
||||
|
||||
OPEN *c_CTRL-F* *q:* *q/* *q?*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*diff.txt* For Vim version 8.2. Last change: 2019 Nov 10
|
||||
*diff.txt* For Vim version 8.2. Last change: 2021 Feb 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -59,7 +59,7 @@ In each of the edited files these options are set:
|
||||
'scrollbind' on
|
||||
'cursorbind' on
|
||||
'scrollopt' includes "hor"
|
||||
'wrap' off
|
||||
'wrap' off, or leave as-is if 'diffopt' includes "followwrap"
|
||||
'foldmethod' "diff"
|
||||
'foldcolumn' value from 'diffopt', default is 2
|
||||
|
||||
@@ -144,7 +144,7 @@ Otherwise they are set to their default value:
|
||||
'scrollbind' off
|
||||
'cursorbind' off
|
||||
'scrollopt' without "hor"
|
||||
'wrap' on
|
||||
'wrap' on, or leave as-is if 'diffopt' includes "followwrap"
|
||||
'foldmethod' "manual"
|
||||
'foldcolumn' 0
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.2. Last change: 2021 Jan 13
|
||||
*eval.txt* For Vim version 8.2. Last change: 2021 Feb 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -293,13 +293,13 @@ is not available it returns zero or the default value you specify: >
|
||||
|
||||
|
||||
List concatenation ~
|
||||
|
||||
*list-concatenation*
|
||||
Two lists can be concatenated with the "+" operator: >
|
||||
:let longlist = mylist + [5, 6]
|
||||
:let mylist += [7, 8]
|
||||
|
||||
To prepend or append an item turn the item into a list by putting [] around
|
||||
it. To change a list in-place see |list-modification| below.
|
||||
To prepend or append an item, turn the item into a list by putting [] around
|
||||
it. To change a list in-place, refer to |list-modification| below.
|
||||
|
||||
|
||||
Sublist ~
|
||||
@@ -2082,6 +2082,12 @@ v:null An empty String. Used to put "null" in JSON. See
|
||||
That is so that eval() can parse the string back to the same
|
||||
value. Read-only.
|
||||
|
||||
*v:numbermax* *numbermax-variable*
|
||||
v:numbermax Maximum value of a number.
|
||||
|
||||
*v:numbermin* *numbermin-variable*
|
||||
v:numbermin Minimum value of a number (negative)
|
||||
|
||||
*v:numbersize* *numbersize-variable*
|
||||
v:numbersize Number of bits in a Number. This is normally 64, but on some
|
||||
systems it may be 32.
|
||||
@@ -2543,6 +2549,8 @@ finddir({name} [, {path} [, {count}]])
|
||||
findfile({name} [, {path} [, {count}]])
|
||||
String find file {name} in {path}
|
||||
flatten({list} [, {maxdepth}]) List flatten {list} up to {maxdepth} levels
|
||||
flattennew({list} [, {maxdepth}])
|
||||
List flatten a copy of {list}
|
||||
float2nr({expr}) Number convert Float {expr} to a Number
|
||||
floor({expr}) Float round {expr} down
|
||||
fmod({expr1}, {expr2}) Float remainder of {expr1} / {expr2}
|
||||
@@ -2554,6 +2562,7 @@ foldlevel({lnum}) Number fold level at {lnum}
|
||||
foldtext() String line displayed for closed fold
|
||||
foldtextresult({lnum}) String text for closed fold at {lnum}
|
||||
foreground() Number bring the Vim window to the foreground
|
||||
fullcommand({name}) String get full command from {name}
|
||||
funcref({name} [, {arglist}] [, {dict}])
|
||||
Funcref reference to function {name}
|
||||
function({name} [, {arglist}] [, {dict}])
|
||||
@@ -3127,6 +3136,7 @@ append({lnum}, {text}) *append()*
|
||||
text line below line {lnum} in the current buffer.
|
||||
Otherwise append {text} as one text line below line {lnum} in
|
||||
the current buffer.
|
||||
Any type of item is accepted and converted to a String.
|
||||
{lnum} can be zero to insert a line before the first one.
|
||||
Returns 1 for failure ({lnum} out of range or out of memory),
|
||||
0 for success. Example: >
|
||||
@@ -4084,8 +4094,9 @@ delete({fname} [, {flags}]) *delete()*
|
||||
|
||||
A symbolic link itself is deleted, not what it points to.
|
||||
|
||||
The result is a Number, which is 0 if the delete operation was
|
||||
successful and -1 when the deletion failed or partly failed.
|
||||
The result is a Number, which is 0/false if the delete
|
||||
operation was successful and -1/true when the deletion failed
|
||||
or partly failed.
|
||||
|
||||
Use |remove()| to delete an item from a |List|.
|
||||
To delete a line from the buffer use |:delete| or
|
||||
@@ -4704,8 +4715,10 @@ flatten({list} [, {maxdepth}]) *flatten()*
|
||||
Flatten {list} up to {maxdepth} levels. Without {maxdepth}
|
||||
the result is a |List| without nesting, as if {maxdepth} is
|
||||
a very large number.
|
||||
The {list} is changed in place, make a copy first if you do
|
||||
The {list} is changed in place, use |flattennew()| if you do
|
||||
not want that.
|
||||
In Vim9 script flatten() cannot be used, you must always use
|
||||
|flattennew()|.
|
||||
*E900*
|
||||
{maxdepth} means how deep in nested lists changes are made.
|
||||
{list} is not modified when {maxdepth} is 0.
|
||||
@@ -4719,6 +4732,10 @@ flatten({list} [, {maxdepth}]) *flatten()*
|
||||
:echo flatten([1, [2, [3, 4]], 5], 1)
|
||||
< [1, 2, [3, 4], 5]
|
||||
|
||||
flattennew({list} [, {maxdepth}]) *flattennew()*
|
||||
Like |flatten()| but first make a copy of {list}.
|
||||
|
||||
|
||||
float2nr({expr}) *float2nr()*
|
||||
Convert {expr} to a Number by omitting the part after the
|
||||
decimal point.
|
||||
@@ -4886,6 +4903,21 @@ foreground() Move the Vim window to the foreground. Useful when sent from
|
||||
{only in the Win32, Athena, Motif and GTK GUI versions and the
|
||||
Win32 console version}
|
||||
|
||||
fullcommand({name}) *fullcommand()*
|
||||
Get the full command name from a short abbreviated command
|
||||
name; see |20.2| for details on command abbreviations.
|
||||
|
||||
{name} may start with a `:` and can include a [range], these
|
||||
are skipped and not returned.
|
||||
Returns an empty string if a command doesn't exist or if it's
|
||||
ambiguous (for user-defined functions).
|
||||
|
||||
For example `fullcommand('s')`, `fullcommand('sub')`,
|
||||
`fullcommand(':%substitute')` all return "substitute".
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetName()->fullcommand()
|
||||
<
|
||||
*funcref()*
|
||||
funcref({name} [, {arglist}] [, {dict}])
|
||||
Just like |function()|, but the returned Funcref will lookup
|
||||
@@ -5871,6 +5903,7 @@ getreg([{regname} [, 1 [, {list}]]]) *getreg()*
|
||||
When the register was not set an empty list is returned.
|
||||
|
||||
If {regname} is not specified, |v:register| is used.
|
||||
In |Vim9-script| {regname} must be one character.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetRegname()->getreg()
|
||||
@@ -5898,6 +5931,7 @@ getreginfo([{regname}]) *getreginfo()*
|
||||
will be returned.
|
||||
If {regname} is not specified, |v:register| is used.
|
||||
The returned Dictionary can be passed to |setreg()|.
|
||||
In |Vim9-script| {regname} must be one character.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetRegname()->getreginfo()
|
||||
@@ -5911,6 +5945,7 @@ getregtype([{regname}]) *getregtype()*
|
||||
"" for an empty or unknown register
|
||||
<CTRL-V> is one character with value 0x16.
|
||||
If {regname} is not specified, |v:register| is used.
|
||||
In |Vim9-script| {regname} must be one character.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetRegname()->getregtype()
|
||||
@@ -6222,8 +6257,8 @@ has({feature} [, {check}])
|
||||
|
||||
|
||||
has_key({dict}, {key}) *has_key()*
|
||||
The result is a Number, which is 1 if |Dictionary| {dict} has
|
||||
an entry with key {key}. Zero otherwise.
|
||||
The result is a Number, which is TRUE if |Dictionary| {dict}
|
||||
has an entry with key {key}. FALSE otherwise.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
mydict->has_key(key)
|
||||
@@ -6266,16 +6301,16 @@ haslocaldir([{winnr} [, {tabnr}]]) *haslocaldir()*
|
||||
GetWinnr()->haslocaldir()
|
||||
|
||||
hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()*
|
||||
The result is a Number, which is 1 if there is a mapping that
|
||||
contains {what} in somewhere in the rhs (what it is mapped to)
|
||||
and this mapping exists in one of the modes indicated by
|
||||
{mode}.
|
||||
The result is a Number, which is TRUE if there is a mapping
|
||||
that contains {what} in somewhere in the rhs (what it is
|
||||
mapped to) and this mapping exists in one of the modes
|
||||
indicated by {mode}.
|
||||
When {abbr} is there and it is |TRUE| use abbreviations
|
||||
instead of mappings. Don't forget to specify Insert and/or
|
||||
Command-line mode.
|
||||
Both the global mappings and the mappings local to the current
|
||||
buffer are checked for a match.
|
||||
If no matching mapping is found 0 is returned.
|
||||
If no matching mapping is found FALSE is returned.
|
||||
The following characters are recognized in {mode}:
|
||||
n Normal mode
|
||||
v Visual and Select mode
|
||||
@@ -6311,8 +6346,8 @@ histadd({history}, {item}) *histadd()*
|
||||
character is sufficient.
|
||||
If {item} does already exist in the history, it will be
|
||||
shifted to become the newest entry.
|
||||
The result is a Number: 1 if the operation was successful,
|
||||
otherwise 0 is returned.
|
||||
The result is a Number: TRUE if the operation was successful,
|
||||
otherwise FALSE is returned.
|
||||
|
||||
Example: >
|
||||
:call histadd("input", strftime("%Y %b %d"))
|
||||
@@ -6335,8 +6370,8 @@ histdel({history} [, {item}]) *histdel()*
|
||||
an index, see |:history-indexing|. The respective entry will
|
||||
be removed if it exists.
|
||||
|
||||
The result is a Number: 1 for a successful operation,
|
||||
otherwise 0 is returned.
|
||||
The result is TRUE for a successful operation, otherwise FALSE
|
||||
is returned.
|
||||
|
||||
Examples:
|
||||
Clear expression register history: >
|
||||
@@ -6388,7 +6423,7 @@ histnr({history}) *histnr()*
|
||||
GetHistory()->histnr()
|
||||
<
|
||||
hlexists({name}) *hlexists()*
|
||||
The result is a Number, which is non-zero if a highlight group
|
||||
The result is a Number, which is TRUE if a highlight group
|
||||
called {name} exists. This is when the group has been
|
||||
defined in some way. Not necessarily when highlighting has
|
||||
been defined for it, it may also have been used for a syntax
|
||||
@@ -6561,7 +6596,7 @@ inputrestore() *inputrestore()*
|
||||
Restore typeahead that was saved with a previous |inputsave()|.
|
||||
Should be called the same number of times inputsave() is
|
||||
called. Calling it more often is harmless though.
|
||||
Returns 1 when there is nothing to restore, 0 otherwise.
|
||||
Returns TRUE when there is nothing to restore, FALSE otherwise.
|
||||
|
||||
inputsave() *inputsave()*
|
||||
Preserve typeahead (also from mappings) and clear it, so that
|
||||
@@ -6569,7 +6604,7 @@ inputsave() *inputsave()*
|
||||
followed by a matching inputrestore() after the prompt. Can
|
||||
be used several times, in which case there must be just as
|
||||
many inputrestore() calls.
|
||||
Returns 1 when out of memory, 0 otherwise.
|
||||
Returns TRUE when out of memory, FALSE otherwise.
|
||||
|
||||
inputsecret({prompt} [, {text}]) *inputsecret()*
|
||||
This function acts much like the |input()| function with but
|
||||
@@ -7045,7 +7080,7 @@ listener_flush([{buf}]) *listener_flush()*
|
||||
|
||||
listener_remove({id}) *listener_remove()*
|
||||
Remove a listener previously added with listener_add().
|
||||
Returns zero when {id} could not be found, one when {id} was
|
||||
Returns FALSE when {id} could not be found, TRUE when {id} was
|
||||
removed.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
@@ -7728,8 +7763,8 @@ mkdir({name} [, {path} [, {prot}]])
|
||||
flag is passed (since patch 8.0.1708). However, without the
|
||||
"p" option the call will fail.
|
||||
|
||||
The function result is a Number, which is 1 if the call was
|
||||
successful or 0 if the directory creation failed or partly
|
||||
The function result is a Number, which is TRUE if the call was
|
||||
successful or FALSE if the directory creation failed or partly
|
||||
failed.
|
||||
|
||||
Not available on all systems. To check use: >
|
||||
@@ -9205,6 +9240,7 @@ server2client({clientid}, {string}) *server2client()*
|
||||
Send a reply string to {clientid}. The most recent {clientid}
|
||||
that sent a string can be retrieved with expand("<client>").
|
||||
{only available when compiled with the |+clientserver| feature}
|
||||
Returns zero for success, -1 for failure.
|
||||
Note:
|
||||
This id has to be stored before the next command can be
|
||||
received. I.e. before returning from the received command and
|
||||
@@ -9342,8 +9378,8 @@ setcmdpos({pos}) *setcmdpos()*
|
||||
before inserting the resulting text.
|
||||
When the number is too big the cursor is put at the end of the
|
||||
line. A number smaller than one has undefined results.
|
||||
Returns 0 when successful, 1 when not editing the command
|
||||
line.
|
||||
Returns FALSE when successful, TRUE when not editing the
|
||||
command line.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetPos()->setcmdpos()
|
||||
@@ -9401,9 +9437,11 @@ setline({lnum}, {text}) *setline()*
|
||||
{lnum} is used like with |getline()|.
|
||||
When {lnum} is just below the last line the {text} will be
|
||||
added below the last line.
|
||||
{text} can be any type or a List of any type, each item is
|
||||
converted to a String.
|
||||
|
||||
If this succeeds, 0 is returned. If this fails (most likely
|
||||
because {lnum} is invalid) 1 is returned.
|
||||
If this succeeds, FALSE is returned. If this fails (most likely
|
||||
because {lnum} is invalid) TRUE is returned.
|
||||
|
||||
Example: >
|
||||
:call setline(5, strftime("%c"))
|
||||
@@ -9623,6 +9661,7 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()*
|
||||
setreg({regname}, {value} [, {options}])
|
||||
Set the register {regname} to {value}.
|
||||
If {regname} is "" or "@", the unnamed register '"' is used.
|
||||
In |Vim9-script| {regname} must be one character.
|
||||
|
||||
{value} may be any value returned by |getreg()| or
|
||||
|getreginfo()|, including a |List| or |Dict|.
|
||||
@@ -11378,7 +11417,7 @@ win_gettype([{nr}]) *win_gettype()*
|
||||
win_gotoid({expr}) *win_gotoid()*
|
||||
Go to window with ID {expr}. This may also change the current
|
||||
tabpage.
|
||||
Return 1 if successful, 0 if the window cannot be found.
|
||||
Return TRUE if successful, FALSE if the window cannot be found.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetWinid()->win_gotoid()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*filetype.txt* For Vim version 8.2. Last change: 2020 Sep 28
|
||||
*filetype.txt* For Vim version 8.2. Last change: 2021 Jan 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -147,6 +147,7 @@ can be used to overrule the filetype used for certain extensions:
|
||||
*.w g:filetype_w |ft-cweb-syntax|
|
||||
*.i g:filetype_i |ft-progress-syntax|
|
||||
*.p g:filetype_p |ft-pascal-syntax|
|
||||
*.pp g:filetype_pp |ft-pascal-syntax|
|
||||
*.sh g:bash_is_sh |ft-sh-syntax|
|
||||
*.tex g:tex_flavor |ft-tex-plugin|
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ Vim had built-in support for hangul, the Korean language, for users without
|
||||
XIM (X Input Method). Since it didn't work well and was not maintained it was
|
||||
removed in Vim 8.1.2327.
|
||||
|
||||
If you want this hangul input mehod you can go back to Vim 8.1.2326 or
|
||||
If you want this hangul input method you can go back to Vim 8.1.2326 or
|
||||
earlier. If you think this code is still useful and want to maintain it, make
|
||||
a patch to add it back. However, making it work with UTF-8 encoding would be
|
||||
best.
|
||||
|
||||
@@ -610,14 +610,14 @@ the use of square and curly brackets, and otherwise by community convention.
|
||||
These conventions are not universally followed, so the Clojure indent script
|
||||
offers a few configurable options, listed below.
|
||||
|
||||
If the current vim does not include |searchpairpos()|, the indent script falls
|
||||
If the current vim does not include searchpairpos(), the indent script falls
|
||||
back to normal 'lisp' indenting, and the following options are ignored.
|
||||
|
||||
*g:clojure_maxlines*
|
||||
|
||||
Set maximum scan distance of |searchpairpos()|. Larger values trade
|
||||
performance for correctness when dealing with very long forms. A value of 0
|
||||
will scan without limits.
|
||||
Set maximum scan distance of searchpairpos(). Larger values trade performance
|
||||
for correctness when dealing with very long forms. A value of 0 will scan
|
||||
without limits.
|
||||
>
|
||||
" Default
|
||||
let g:clojure_maxlines = 100
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 8.2. Last change: 2020 Oct 05
|
||||
*index.txt* For Vim version 8.2. Last change: 2021 Feb 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1176,6 +1176,7 @@ tag command action ~
|
||||
|:bNext| :bN[ext] go to previous buffer in the buffer list
|
||||
|:ball| :ba[ll] open a window for each buffer in the buffer list
|
||||
|:badd| :bad[d] add buffer to the buffer list
|
||||
|:balt| :balt like ":badd" but also set the alternate file
|
||||
|:bdelete| :bd[elete] remove a buffer from the buffer list
|
||||
|:behave| :be[have] set mouse and selection behavior
|
||||
|:belowright| :bel[owright] make split window appear right or below
|
||||
@@ -1590,6 +1591,8 @@ tag command action ~
|
||||
|:sign| :sig[n] manipulate signs
|
||||
|:silent| :sil[ent] run a command silently
|
||||
|:sleep| :sl[eep] do nothing for a few seconds
|
||||
|:sleep!| :sl[eep]! do nothing for a few seconds, without the
|
||||
cursor visible
|
||||
|:slast| :sla[st] split window and go to last file in the
|
||||
argument list
|
||||
|:smagic| :sm[agic] :substitute with 'magic'
|
||||
@@ -1696,7 +1699,8 @@ tag command action ~
|
||||
|:version| :ve[rsion] print version number and other info
|
||||
|:verbose| :verb[ose] execute command with 'verbose' set
|
||||
|:vertical| :vert[ical] make following command split vertically
|
||||
|:vim9script| :vim9[script] indicates Vim9 script file
|
||||
|:vim9cmd| :vim9[cmd] make following command use Vim9 script syntax
|
||||
|:vim9script| :vim9s[cript] indicates Vim9 script file
|
||||
|:vimgrep| :vim[grep] search for pattern in files
|
||||
|:vimgrepadd| :vimgrepa[dd] like :vimgrep, but append to current list
|
||||
|:visual| :vi[sual] same as ":edit", but turns off "Ex" mode
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.2. Last change: 2021 Jan 08
|
||||
*options.txt* For Vim version 8.2. Last change: 2021 Feb 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1568,7 +1568,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
{only in GUI versions or when the |+xterm_clipboard|
|
||||
feature is included}
|
||||
This option is a list of comma separated names.
|
||||
These names are recognized:
|
||||
Note: if one of the items is "exclude:", then you can't add an item
|
||||
after that. Therefore do append an item with += but use ^= to
|
||||
prepend, e.g.: >
|
||||
set clipboard^=unnamed
|
||||
< These names are recognized:
|
||||
|
||||
*clipboard-unnamed*
|
||||
unnamed When included, Vim will use the clipboard register '*'
|
||||
@@ -2677,6 +2681,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
foldcolumn:{n} Set the 'foldcolumn' option to {n} when
|
||||
starting diff mode. Without this 2 is used.
|
||||
|
||||
followwrap Follow the 'wrap' option and leave as it is.
|
||||
|
||||
internal Use the internal diff library. This is
|
||||
ignored when 'diffexpr' is set. *E960*
|
||||
When running out of memory when writing a
|
||||
@@ -3229,7 +3235,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Only normal file name characters can be used, "/\*?[|<>" are illegal.
|
||||
|
||||
*'fillchars'* *'fcs'*
|
||||
'fillchars' 'fcs' string (default "vert:|,fold:-")
|
||||
'fillchars' 'fcs' string (default "vert:|,fold:-,eob:~")
|
||||
global
|
||||
{not available when compiled without the |+folding|
|
||||
feature}
|
||||
@@ -3241,7 +3247,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
stlnc:c ' ' or '=' statusline of the non-current windows
|
||||
vert:c '|' vertical separators |:vsplit|
|
||||
fold:c '-' filling 'foldtext'
|
||||
foldopen:c '-' mark the beginning of a fold
|
||||
foldclose:c '+' show a closed fold
|
||||
foldsep:c '|' open fold middle character
|
||||
diff:c '-' deleted lines of the 'diff' option
|
||||
eob:c '~' empty lines below the end of a buffer
|
||||
|
||||
Any one that is omitted will fall back to the default. For "stl" and
|
||||
"stlnc" the space will be used when there is highlighting, '^' or '='
|
||||
@@ -3252,7 +3262,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
< This is similar to the default, except that these characters will also
|
||||
be used when there is highlighting.
|
||||
|
||||
for "stl" and "stlnc" only single-byte values are supported.
|
||||
For "stl" and "stlnc" single-byte and multibyte characters are
|
||||
supported. But double-width characters are not supported.
|
||||
|
||||
The highlighting used for these items:
|
||||
item highlight group ~
|
||||
@@ -3261,6 +3272,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
vert:c VertSplit |hl-VertSplit|
|
||||
fold:c Folded |hl-Folded|
|
||||
diff:c DiffDelete |hl-DiffDelete|
|
||||
eob:c EndOfBuffer |hl-EndOfBuffer|
|
||||
|
||||
*'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'*
|
||||
'fixendofline' 'fixeol' boolean (default on)
|
||||
@@ -3273,7 +3285,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
See the 'endofline' option.
|
||||
|
||||
*'fkmap'* *'fk'* *'nofkmap'* *'nofk'*
|
||||
'fkmap' 'fk' boolean (default off) *E198*
|
||||
'fkmap' 'fk' boolean (default off)
|
||||
global
|
||||
{only available when compiled with the |+rightleft|
|
||||
feature}
|
||||
@@ -4846,7 +4858,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
*'listchars'* *'lcs'*
|
||||
'listchars' 'lcs' string (default "eol:$")
|
||||
global
|
||||
global or local to window |global-local|
|
||||
Strings to use in 'list' mode and for the |:list| command. It is a
|
||||
comma separated list of string settings.
|
||||
*lcs-eol*
|
||||
@@ -4877,7 +4889,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*lcs-space*
|
||||
space:c Character to show for a space. When omitted, spaces
|
||||
are left blank.
|
||||
*lcs-trail*
|
||||
*lcs-lead*
|
||||
lead:c Character to show for leading spaces. When omitted,
|
||||
leading spaces are blank. Overrides the "space"
|
||||
setting for leading spaces. You can combine it with
|
||||
"tab:", for example: >
|
||||
:set listchars+=tab:>-,lead:.
|
||||
< *lcs-trail*
|
||||
trail:c Character to show for trailing spaces. When omitted,
|
||||
trailing spaces are blank. Overrides the "space"
|
||||
setting for trailing spaces.
|
||||
@@ -5221,7 +5239,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
NOTE: This option is set to the Vi default value when 'compatible' is
|
||||
set and to the Vim default value when 'compatible' is reset.
|
||||
|
||||
*'mouse'* *E538*
|
||||
*'mouse'*
|
||||
'mouse' string (default "", "a" for GUI and Win32,
|
||||
set to "a" or "nvi" in |defaults.vim|)
|
||||
global
|
||||
@@ -6226,7 +6244,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
<
|
||||
*'runtimepath'* *'rtp'* *vimfiles*
|
||||
'runtimepath' 'rtp' string (default:
|
||||
Unix: "$HOME/.vim,
|
||||
Unix: "$HOME/.vim,
|
||||
$VIM/vimfiles,
|
||||
$VIMRUNTIME,
|
||||
$VIM/vimfiles/after,
|
||||
@@ -6236,7 +6254,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
$VIMRUNTIME,
|
||||
$VIM/vimfiles/after,
|
||||
home:vimfiles/after"
|
||||
PC: "$HOME/vimfiles,
|
||||
MS-Windows: "$HOME/vimfiles,
|
||||
$VIM/vimfiles,
|
||||
$VIMRUNTIME,
|
||||
$VIM/vimfiles/after,
|
||||
@@ -6248,8 +6266,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
$VIM/vimfiles,
|
||||
$VIMRUNTIME,
|
||||
$VIM/vimfiles/after,
|
||||
$BE_USER_SETTINGS/vim/after")
|
||||
VMS: "sys$login:vimfiles,
|
||||
$BE_USER_SETTINGS/vim/after"
|
||||
VMS: "sys$login:vimfiles,
|
||||
$VIM/vimfiles,
|
||||
$VIMRUNTIME,
|
||||
$VIM/vimfiles/after,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*pattern.txt* For Vim version 8.2. Last change: 2021 Jan 08
|
||||
*pattern.txt* For Vim version 8.2. Last change: 2021 Feb 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -229,7 +229,7 @@ This is like executing two search commands after each other, except that:
|
||||
*last-pattern*
|
||||
The last used pattern and offset are remembered. They can be used to repeat
|
||||
the search, possibly in another direction or with another count. Note that
|
||||
two patterns are remembered: One for 'normal' search commands and one for the
|
||||
two patterns are remembered: One for "normal" search commands and one for the
|
||||
substitute command ":s". Each time an empty pattern is given, the previously
|
||||
used pattern is used. However, if there is no previous search command, a
|
||||
previous substitute pattern is used, if possible.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*popup.txt* For Vim version 8.2. Last change: 2020 Nov 07
|
||||
*popup.txt* For Vim version 8.2. Last change: 2021 Feb 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -588,8 +588,6 @@ properties. It is in one of four forms:
|
||||
|
||||
If you want to create a new buffer yourself use |bufadd()| and pass the buffer
|
||||
number to popup_create().
|
||||
It is not possible to use the buffer of a terminal window. *E278* You CAN
|
||||
create a hidden terminal buffer and use that one in a popup window.
|
||||
|
||||
The second argument of |popup_create()| is a dictionary with options:
|
||||
line Screen line where to position the popup. Can use a
|
||||
@@ -622,7 +620,8 @@ The second argument of |popup_create()| is a dictionary with options:
|
||||
property moves. Use an empty string to remove. See
|
||||
|popup-textprop-pos|.
|
||||
textpropwin What window to search for the text property. When
|
||||
omitted or invalid the current window is used.
|
||||
omitted or invalid the current window is used. Used
|
||||
when "textprop" is present.
|
||||
textpropid Used to identify the text property when "textprop" is
|
||||
present. Use zero to reset.
|
||||
fixed When FALSE (the default), and:
|
||||
@@ -694,8 +693,8 @@ The second argument of |popup_create()| is a dictionary with options:
|
||||
the left.
|
||||
border List with numbers, defining the border thickness
|
||||
above/right/below/left of the popup (similar to CSS).
|
||||
Only values of zero and non-zero are recognized.
|
||||
An empty list uses a border all around.
|
||||
Only values of zero and non-zero are currently
|
||||
recognized. An empty list uses a border all around.
|
||||
borderhighlight List of highlight group names to use for the border.
|
||||
When one entry it is used for all borders, otherwise
|
||||
the highlight for the top/right/bottom/left border.
|
||||
@@ -743,10 +742,10 @@ The second argument of |popup_create()| is a dictionary with options:
|
||||
line or to another window.
|
||||
mousemoved Like "moved" but referring to the mouse pointer
|
||||
position
|
||||
cursorline non-zero: Highlight the cursor line. Also scrolls the
|
||||
text to show this line (only works properly
|
||||
when 'wrap' is off).
|
||||
zero: Do not highlight the cursor line.
|
||||
cursorline TRUE: Highlight the cursor line. Also scrolls the
|
||||
text to show this line (only works properly
|
||||
when 'wrap' is off).
|
||||
zero: Do not highlight the cursor line.
|
||||
Default is zero, except for |popup_menu()|.
|
||||
filter A callback that can filter typed characters, see
|
||||
|popup-filter|.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickfix.txt* For Vim version 8.2. Last change: 2020 May 31
|
||||
*quickfix.txt* For Vim version 8.2. Last change: 2021 Feb 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1025,6 +1025,12 @@ commands can be combined to create a NewGrep command: >
|
||||
'smartcase' is not used.
|
||||
If {pattern} is empty (e.g. // is specified), the last
|
||||
used search pattern is used. |last-pattern|
|
||||
|
||||
|QuickFixCmdPre| and |QuickFixCmdPost| are triggered.
|
||||
A file that is opened for matching may use a buffer
|
||||
number, but it is reused if possible to avoid
|
||||
consuming buffer numbers.
|
||||
|
||||
:{count}vim[grep] ...
|
||||
When a number is put before the command this is used
|
||||
as the maximum number of matches to find. Use
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*repeat.txt* For Vim version 8.2. Last change: 2021 Jan 02
|
||||
*repeat.txt* For Vim version 8.2. Last change: 2021 Feb 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -354,13 +354,15 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
Vim version, or update Vim to a newer version. See
|
||||
|vimscript-version| for what changed between versions.
|
||||
|
||||
:vim9script [noclear] *:vim9* *:vim9script*
|
||||
:vim9s[cript] [noclear] *:vim9s* *:vim9script*
|
||||
Marks a script file as containing |Vim9-script|
|
||||
commands. Also see |vim9-namespace|.
|
||||
Must be the first command in the file.
|
||||
For [noclear] see |vim9-reload|.
|
||||
Without the |+eval| feature this changes the syntax
|
||||
for some commands.
|
||||
See |:vim9cmd| for executing one command with Vim9
|
||||
syntax and semantics.
|
||||
|
||||
*:scr* *:scriptnames*
|
||||
:scr[iptnames] List all sourced script names, in the order they were
|
||||
@@ -877,7 +879,7 @@ DEFINING BREAKPOINTS
|
||||
valid in the script where it has been defined and if that
|
||||
script is called from several other scripts, this will stop
|
||||
whenever that particular variable will become visible or
|
||||
unaccessible again.
|
||||
inaccessible again.
|
||||
|
||||
The [lnum] is the line number of the breakpoint. Vim will stop at or after
|
||||
this line. When omitted line 1 is used.
|
||||
@@ -899,8 +901,9 @@ matches ".../plugin/explorer.vim", ".../plugin/iexplorer.vim", etc. >
|
||||
matches ".../plugin/explorer.vim" and "explorer.vim" in any other directory.
|
||||
|
||||
The match for functions is done against the name as it's shown in the output
|
||||
of ":function". For local functions this means that something like "<SNR>99_"
|
||||
is prepended.
|
||||
of ":function". However, for local functions the script-specific prefix such
|
||||
as "<SNR>99_" is ignored to make it easier to match script-local functions
|
||||
without knowing the ID of the script.
|
||||
|
||||
Note that functions are first loaded and later executed. When they are loaded
|
||||
the "file" breakpoints are checked, when they are executed the "func"
|
||||
@@ -955,10 +958,10 @@ OBSCURE
|
||||
|
||||
Profiling means that Vim measures the time that is spent on executing
|
||||
functions and/or scripts. The |+profile| feature is required for this.
|
||||
It is only included when Vim was compiled with "huge" features.
|
||||
It is included when Vim was compiled with "huge" features.
|
||||
|
||||
You can also use the |reltime()| function to measure time. This only requires
|
||||
the |+reltime| feature, which is present more often.
|
||||
the |+reltime| feature, which is present in more builds.
|
||||
|
||||
For profiling syntax highlighting see |:syntime|.
|
||||
|
||||
@@ -1005,7 +1008,12 @@ For example, to profile the one_script.vim script file: >
|
||||
|
||||
|
||||
You must always start with a ":profile start fname" command. The resulting
|
||||
file is written when Vim exits. Here is an example of the output, with line
|
||||
file is written when Vim exits. For example, to profile one specific
|
||||
function: >
|
||||
profile start /tmp/vimprofile
|
||||
profile func MyFunc
|
||||
|
||||
Here is an example of the output, with line
|
||||
numbers prepended for the explanation:
|
||||
|
||||
1 FUNCTION Test2() ~
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*starting.txt* For Vim version 8.2. Last change: 2020 Dec 19
|
||||
*starting.txt* For Vim version 8.2. Last change: 2021 Feb 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1344,7 +1344,11 @@ resulting file, when executed with a ":source" command:
|
||||
"options". Script-local mappings will not be written.
|
||||
2. Restores global variables that start with an uppercase letter and contain
|
||||
at least one lowercase letter, if 'sessionoptions' contains "globals".
|
||||
3. Unloads all currently loaded buffers.
|
||||
3. Closes all windows in the current tab page, except the current one; closes
|
||||
all tab pages except the current one (this results in currently loaded
|
||||
buffers to be unloaded, some may become hidden if 'hidden' is set or
|
||||
otherwise specified); wipes out the current buffer, if it is empty
|
||||
and unnamed.
|
||||
4. Restores the current directory if 'sessionoptions' contains "curdir", or
|
||||
sets the current directory to where the Session file is if 'sessionoptions'
|
||||
contains "sesdir".
|
||||
@@ -1640,13 +1644,17 @@ either have to fix the error, or delete the file (while Vim is running, so
|
||||
most of the information will be restored).
|
||||
|
||||
*:rv* *:rviminfo* *E195*
|
||||
:rv[iminfo][!] [file] Read from viminfo file [file] (default: see above).
|
||||
:rv[iminfo][!] [file] Read from viminfo file [file] (default: see
|
||||
|viminfo-file-name| above).
|
||||
If [!] is given, then any information that is
|
||||
already set (registers, marks, |v:oldfiles|, etc.)
|
||||
will be overwritten
|
||||
|
||||
*:wv* *:wviminfo* *E137* *E138* *E574* *E886* *E929*
|
||||
:wv[iminfo][!] [file] Write to viminfo file [file] (default: see above).
|
||||
:wv[iminfo][!] [file] Write to viminfo file [file] (default: see
|
||||
|viminfo-file-name| above).
|
||||
This command has no effect when 'viminfofile' has been
|
||||
set to "NONE".
|
||||
The information in the file is first read in to make
|
||||
a merge between old and new info. When [!] is used,
|
||||
the old information is not read first, only the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 8.2. Last change: 2020 Dec 17
|
||||
*syntax.txt* For Vim version 8.2. Last change: 2021 Jan 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -2335,11 +2335,12 @@ http://papp.plan9.de.
|
||||
|
||||
PASCAL *pascal.vim* *ft-pascal-syntax*
|
||||
|
||||
Files matching "*.p" could be Progress or Pascal. If the automatic detection
|
||||
doesn't work for you, or you don't edit Progress at all, use this in your
|
||||
startup vimrc: >
|
||||
Files matching "*.p" could be Progress or Pascal and those matching "*.pp"
|
||||
could be Puppet or Pascal. If the automatic detection doesn't work for you,
|
||||
or you only edit Pascal files, use this in your startup vimrc: >
|
||||
|
||||
:let filetype_p = "pascal"
|
||||
:let filetype_p = "pascal"
|
||||
:let filetype_pp = "pascal"
|
||||
|
||||
The Pascal syntax file has been extended to take into account some extensions
|
||||
provided by Turbo Pascal, Free Pascal Compiler and GNU Pascal Compiler.
|
||||
|
||||
@@ -1045,6 +1045,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
't_da' term.txt /*'t_da'*
|
||||
't_db' term.txt /*'t_db'*
|
||||
't_dl' term.txt /*'t_dl'*
|
||||
't_fd' term.txt /*'t_fd'*
|
||||
't_fe' term.txt /*'t_fe'*
|
||||
't_fs' term.txt /*'t_fs'*
|
||||
't_k1' term.txt /*'t_k1'*
|
||||
't_k2' term.txt /*'t_k2'*
|
||||
@@ -1290,6 +1292,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
+cmdline_compl various.txt /*+cmdline_compl*
|
||||
+cmdline_hist various.txt /*+cmdline_hist*
|
||||
+cmdline_info various.txt /*+cmdline_info*
|
||||
+cmdwin various.txt /*+cmdwin*
|
||||
+comments various.txt /*+comments*
|
||||
+conceal various.txt /*+conceal*
|
||||
+cryptv various.txt /*+cryptv*
|
||||
@@ -3112,9 +3115,11 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:sip change.txt /*:sip*
|
||||
:sir change.txt /*:sir*
|
||||
:sl various.txt /*:sl*
|
||||
:sl! various.txt /*:sl!*
|
||||
:sla windows.txt /*:sla*
|
||||
:slast windows.txt /*:slast*
|
||||
:sleep various.txt /*:sleep*
|
||||
:sleep! various.txt /*:sleep!*
|
||||
:sm change.txt /*:sm*
|
||||
:smagic change.txt /*:smagic*
|
||||
:smap map.txt /*:smap*
|
||||
@@ -3397,7 +3402,9 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:vie editing.txt /*:vie*
|
||||
:view editing.txt /*:view*
|
||||
:vim quickfix.txt /*:vim*
|
||||
:vim9 repeat.txt /*:vim9*
|
||||
:vim9 vim9.txt /*:vim9*
|
||||
:vim9cmd vim9.txt /*:vim9cmd*
|
||||
:vim9s repeat.txt /*:vim9s*
|
||||
:vim9script repeat.txt /*:vim9script*
|
||||
:vimgrep quickfix.txt /*:vimgrep*
|
||||
:vimgrepa quickfix.txt /*:vimgrepa*
|
||||
@@ -3939,6 +3946,7 @@ E1136 map.txt /*E1136*
|
||||
E1137 map.txt /*E1137*
|
||||
E114 eval.txt /*E114*
|
||||
E115 eval.txt /*E115*
|
||||
E1155 autocmd.txt /*E1155*
|
||||
E116 eval.txt /*E116*
|
||||
E117 eval.txt /*E117*
|
||||
E118 eval.txt /*E118*
|
||||
@@ -4028,7 +4036,6 @@ E194 message.txt /*E194*
|
||||
E195 starting.txt /*E195*
|
||||
E196 various.txt /*E196*
|
||||
E197 mlang.txt /*E197*
|
||||
E198 options.txt /*E198*
|
||||
E199 cmdline.txt /*E199*
|
||||
E20 motion.txt /*E20*
|
||||
E200 autocmd.txt /*E200*
|
||||
@@ -4114,7 +4121,6 @@ E274 eval.txt /*E274*
|
||||
E275 textprop.txt /*E275*
|
||||
E276 eval.txt /*E276*
|
||||
E277 remote.txt /*E277*
|
||||
E278 popup.txt /*E278*
|
||||
E279 terminal.txt /*E279*
|
||||
E28 syntax.txt /*E28*
|
||||
E280 if_tcl.txt /*E280*
|
||||
@@ -4180,7 +4186,6 @@ E337 gui.txt /*E337*
|
||||
E338 editing.txt /*E338*
|
||||
E339 message.txt /*E339*
|
||||
E34 various.txt /*E34*
|
||||
E340 vi_diff.txt /*E340*
|
||||
E341 message.txt /*E341*
|
||||
E342 message.txt /*E342*
|
||||
E343 options.txt /*E343*
|
||||
@@ -4388,7 +4393,6 @@ E534 options.txt /*E534*
|
||||
E535 options.txt /*E535*
|
||||
E536 options.txt /*E536*
|
||||
E537 options.txt /*E537*
|
||||
E538 options.txt /*E538*
|
||||
E539 options.txt /*E539*
|
||||
E54 pattern.txt /*E54*
|
||||
E540 options.txt /*E540*
|
||||
@@ -6351,6 +6355,7 @@ expression-commands eval.txt /*expression-commands*
|
||||
expression-syntax eval.txt /*expression-syntax*
|
||||
exrc starting.txt /*exrc*
|
||||
extend() eval.txt /*extend()*
|
||||
extendnew() eval.txt /*extendnew()*
|
||||
extension-removal cmdline.txt /*extension-removal*
|
||||
extensions-improvements todo.txt /*extensions-improvements*
|
||||
f motion.txt /*f*
|
||||
@@ -6415,6 +6420,7 @@ fixed-7.2 version7.txt /*fixed-7.2*
|
||||
fixed-7.3 version7.txt /*fixed-7.3*
|
||||
fixed-7.4 version7.txt /*fixed-7.4*
|
||||
flatten() eval.txt /*flatten()*
|
||||
flattennew() eval.txt /*flattennew()*
|
||||
flexwiki.vim syntax.txt /*flexwiki.vim*
|
||||
float-e eval.txt /*float-e*
|
||||
float-functions usr_41.txt /*float-functions*
|
||||
@@ -6430,7 +6436,26 @@ fname_new-variable eval.txt /*fname_new-variable*
|
||||
fname_out-variable eval.txt /*fname_out-variable*
|
||||
fnameescape() eval.txt /*fnameescape()*
|
||||
fnamemodify() eval.txt /*fnamemodify()*
|
||||
fo-1 change.txt /*fo-1*
|
||||
fo-2 change.txt /*fo-2*
|
||||
fo-B change.txt /*fo-B*
|
||||
fo-M change.txt /*fo-M*
|
||||
fo-] change.txt /*fo-]*
|
||||
fo-a change.txt /*fo-a*
|
||||
fo-b change.txt /*fo-b*
|
||||
fo-c change.txt /*fo-c*
|
||||
fo-j change.txt /*fo-j*
|
||||
fo-l change.txt /*fo-l*
|
||||
fo-m change.txt /*fo-m*
|
||||
fo-n change.txt /*fo-n*
|
||||
fo-o change.txt /*fo-o*
|
||||
fo-p change.txt /*fo-p*
|
||||
fo-q change.txt /*fo-q*
|
||||
fo-r change.txt /*fo-r*
|
||||
fo-t change.txt /*fo-t*
|
||||
fo-table change.txt /*fo-table*
|
||||
fo-v change.txt /*fo-v*
|
||||
fo-w change.txt /*fo-w*
|
||||
fold-behavior fold.txt /*fold-behavior*
|
||||
fold-colors fold.txt /*fold-colors*
|
||||
fold-commands fold.txt /*fold-commands*
|
||||
@@ -6643,6 +6668,7 @@ ftplugin-name usr_05.txt /*ftplugin-name*
|
||||
ftplugin-overrule filetype.txt /*ftplugin-overrule*
|
||||
ftplugin-special usr_41.txt /*ftplugin-special*
|
||||
ftplugins usr_05.txt /*ftplugins*
|
||||
fullcommand() eval.txt /*fullcommand()*
|
||||
funcref() eval.txt /*funcref()*
|
||||
function() eval.txt /*function()*
|
||||
function-argument eval.txt /*function-argument*
|
||||
@@ -7613,6 +7639,7 @@ lc_time-variable eval.txt /*lc_time-variable*
|
||||
lcs-conceal options.txt /*lcs-conceal*
|
||||
lcs-eol options.txt /*lcs-eol*
|
||||
lcs-extends options.txt /*lcs-extends*
|
||||
lcs-lead options.txt /*lcs-lead*
|
||||
lcs-nbsp options.txt /*lcs-nbsp*
|
||||
lcs-precedes options.txt /*lcs-precedes*
|
||||
lcs-space options.txt /*lcs-space*
|
||||
@@ -7641,6 +7668,7 @@ linewise-visual visual.txt /*linewise-visual*
|
||||
lisp.vim syntax.txt /*lisp.vim*
|
||||
lispindent() eval.txt /*lispindent()*
|
||||
list eval.txt /*list*
|
||||
list-concatenation eval.txt /*list-concatenation*
|
||||
list-functions usr_41.txt /*list-functions*
|
||||
list-identity eval.txt /*list-identity*
|
||||
list-index eval.txt /*list-index*
|
||||
@@ -8270,6 +8298,8 @@ null vim9.txt /*null*
|
||||
null-variable eval.txt /*null-variable*
|
||||
number_relativenumber options.txt /*number_relativenumber*
|
||||
numbered-function eval.txt /*numbered-function*
|
||||
numbermax-variable eval.txt /*numbermax-variable*
|
||||
numbermin-variable eval.txt /*numbermin-variable*
|
||||
numbersize-variable eval.txt /*numbersize-variable*
|
||||
o insert.txt /*o*
|
||||
o_CTRL-V motion.txt /*o_CTRL-V*
|
||||
@@ -8680,6 +8710,7 @@ read-in-close-cb channel.txt /*read-in-close-cb*
|
||||
read-messages insert.txt /*read-messages*
|
||||
read-only-share editing.txt /*read-only-share*
|
||||
read-stdin version5.txt /*read-stdin*
|
||||
readblob() eval.txt /*readblob()*
|
||||
readdir() eval.txt /*readdir()*
|
||||
readdirex() eval.txt /*readdirex()*
|
||||
readfile() eval.txt /*readfile()*
|
||||
@@ -8945,6 +8976,7 @@ sinh() eval.txt /*sinh()*
|
||||
skeleton autocmd.txt /*skeleton*
|
||||
skip_defaults_vim starting.txt /*skip_defaults_vim*
|
||||
slice eval.txt /*slice*
|
||||
slice() eval.txt /*slice()*
|
||||
slow-fast-terminal term.txt /*slow-fast-terminal*
|
||||
slow-start starting.txt /*slow-start*
|
||||
slow-terminal term.txt /*slow-terminal*
|
||||
@@ -9340,6 +9372,8 @@ t_f6 version4.txt /*t_f6*
|
||||
t_f7 version4.txt /*t_f7*
|
||||
t_f8 version4.txt /*t_f8*
|
||||
t_f9 version4.txt /*t_f9*
|
||||
t_fd term.txt /*t_fd*
|
||||
t_fe term.txt /*t_fe*
|
||||
t_float-variable eval.txt /*t_float-variable*
|
||||
t_fs term.txt /*t_fs*
|
||||
t_func-variable eval.txt /*t_func-variable*
|
||||
@@ -9714,6 +9748,7 @@ type-inference vim9.txt /*type-inference*
|
||||
type-mistakes tips.txt /*type-mistakes*
|
||||
typecorr-settings usr_41.txt /*typecorr-settings*
|
||||
typecorr.txt usr_41.txt /*typecorr.txt*
|
||||
typename() eval.txt /*typename()*
|
||||
u undo.txt /*u*
|
||||
uganda uganda.txt /*uganda*
|
||||
uganda.txt uganda.txt /*uganda.txt*
|
||||
@@ -9841,6 +9876,8 @@ v:mouse_win eval.txt /*v:mouse_win*
|
||||
v:mouse_winid eval.txt /*v:mouse_winid*
|
||||
v:none eval.txt /*v:none*
|
||||
v:null eval.txt /*v:null*
|
||||
v:numbermax eval.txt /*v:numbermax*
|
||||
v:numbermin eval.txt /*v:numbermin*
|
||||
v:numbersize eval.txt /*v:numbersize*
|
||||
v:oldfiles eval.txt /*v:oldfiles*
|
||||
v:operator eval.txt /*v:operator*
|
||||
@@ -10083,6 +10120,7 @@ vim8 version8.txt /*vim8*
|
||||
vim9 vim9.txt /*vim9*
|
||||
vim9-classes vim9.txt /*vim9-classes*
|
||||
vim9-const vim9.txt /*vim9-const*
|
||||
vim9-curly vim9.txt /*vim9-curly*
|
||||
vim9-declaration vim9.txt /*vim9-declaration*
|
||||
vim9-declarations usr_46.txt /*vim9-declarations*
|
||||
vim9-differences vim9.txt /*vim9-differences*
|
||||
@@ -10090,6 +10128,7 @@ vim9-export vim9.txt /*vim9-export*
|
||||
vim9-final vim9.txt /*vim9-final*
|
||||
vim9-gotchas vim9.txt /*vim9-gotchas*
|
||||
vim9-import vim9.txt /*vim9-import*
|
||||
vim9-mix vim9.txt /*vim9-mix*
|
||||
vim9-namespace vim9.txt /*vim9-namespace*
|
||||
vim9-rationale vim9.txt /*vim9-rationale*
|
||||
vim9-reload vim9.txt /*vim9-reload*
|
||||
@@ -10314,6 +10353,7 @@ xterm-command-server term.txt /*xterm-command-server*
|
||||
xterm-copy-paste term.txt /*xterm-copy-paste*
|
||||
xterm-cursor-keys term.txt /*xterm-cursor-keys*
|
||||
xterm-end-home-keys term.txt /*xterm-end-home-keys*
|
||||
xterm-focus-event term.txt /*xterm-focus-event*
|
||||
xterm-function-keys term.txt /*xterm-function-keys*
|
||||
xterm-modifier-keys term.txt /*xterm-modifier-keys*
|
||||
xterm-mouse options.txt /*xterm-mouse*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*term.txt* For Vim version 8.2. Last change: 2020 Dec 29
|
||||
*term.txt* For Vim version 8.2. Last change: 2021 Jan 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -373,9 +373,9 @@ Added by Vim (there are no standard codes for these):
|
||||
t_Ri restore icon text from stack *t_Ri* *'t_Ri'*
|
||||
t_TE end of "raw" mode *t_TE* *'t_TE'*
|
||||
t_TI put terminal into "raw" mode *t_TI* *'t_TI'*
|
||||
t_fd disable focus-event tracking *t_TI* *'t_TI'*
|
||||
t_fd disable focus-event tracking *t_fd* *'t_fd'*
|
||||
|xterm-focus-event|
|
||||
t_fe enable focus-event tracking *t_TI* *'t_TI'*
|
||||
t_fe enable focus-event tracking *t_fe* *'t_fe'*
|
||||
|xterm-focus-event|
|
||||
|
||||
Some codes have a start, middle and end part. The start and end are defined
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*terminal.txt* For Vim version 8.2. Last change: 2021 Jan 04
|
||||
*terminal.txt* For Vim version 8.2. Last change: 2021 Feb 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -126,11 +126,28 @@ After opening the terminal window and setting 'buftype' to "terminal" the
|
||||
|TerminalWinOpen| autocommand event is triggered. This makes it possible to set
|
||||
options specifically for the terminal window and buffer. Example: >
|
||||
au TerminalWinOpen * setlocal bufhidden=hide
|
||||
This only works properly if the terminal is not hidden.
|
||||
|
||||
There is also the |TerminalOpen| event, but this may be triggered for a hidden
|
||||
terminal, and the current window and buffer may not be for the new terminal.
|
||||
For both hidden and non-hidden terminals this works, both for buffer-local and
|
||||
window-local options: >
|
||||
au TerminalWinOpen,BufWinEnter * if &buftype == 'terminal'
|
||||
\ | setlocal bufhidden=hide colorcolumn=123
|
||||
\ | endif
|
||||
Note that for a hidden terminal the options are not set until the terminal is
|
||||
no longer hidden.
|
||||
|
||||
There is also the |TerminalOpen| event. Keep in mind this may be triggered
|
||||
for a hidden terminal, then the current window and buffer are not that of the
|
||||
new terminal.
|
||||
You need to use <abuf>, which is set to the terminal buffer. Example: >
|
||||
au TerminalOpen * call setbufvar(+expand('<abuf>'), '&colorcolumn', 123)
|
||||
au TerminalOpen * call setbufvar(expand('<abuf>')->str2nr(),
|
||||
\ '&termwinscroll', 1000)
|
||||
For a window-local option, you need to delay setting the option until the
|
||||
terminal window has been created (this only works for a hidden terminal): >
|
||||
au TerminalOpen * exe printf(
|
||||
\ 'au BufWinEnter <buffer=%d> ++once setlocal colorcolumn=%d',
|
||||
\ expand('<abuf>')->str2nr(), 123)
|
||||
For a non-hidden terminal use |TerminalWinOpen|.
|
||||
|
||||
Mouse events (click and drag) are passed to the terminal. Mouse move events
|
||||
are only passed when Vim itself is receiving them. For a terminal that is
|
||||
@@ -717,6 +734,8 @@ term_scrape({buf}, {row}) *term_scrape()*
|
||||
"attr" attributes of the cell, use |term_getattr()|
|
||||
to get the individual flags
|
||||
"width" cell width: 1 or 2
|
||||
For a double-width cell there is one item, thus the list can
|
||||
be shorter than the width of the terminal.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetBufnr()->term_scrape(row)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.2. Last change: 2021 Jan 11
|
||||
*todo.txt* For Vim version 8.2. Last change: 2021 Feb 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -38,27 +38,14 @@ browser use: https://github.com/vim/vim/issues/1234
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
no error for:
|
||||
echo extend([0], ['a', true])
|
||||
like it does for:
|
||||
echo extend([0], ['a'])
|
||||
At script level this does not give an error:
|
||||
echo map([0], (_, v) => [])
|
||||
Or:
|
||||
var l: list<number> = [0]
|
||||
echo map(l, (_, v) => [])
|
||||
|
||||
Vim9 - Make everything work:
|
||||
- Expand `=expr` in :next, :argedit, :argadd, :argdelete, :drop
|
||||
- Expand `=expr` in :vimgrep, :vimgrepadd, :lvimgrep, :lvimgrepadd
|
||||
- Expand `=expr` in :mkspell
|
||||
- Unlet with range: "unlet list[a : b]"
|
||||
- Implement "export {one, two three}".
|
||||
- Disallow :open ?
|
||||
- ISN_CHECKTYPE could use check_argtype()
|
||||
- Using a script variable inside a :def function doesn't work if the variable
|
||||
is inside a block, see Test_nested_function(). Should it work?
|
||||
- give error for variable name:
|
||||
let p = function('NoSuchFunc')
|
||||
var p = function('NoSuchFunc')
|
||||
- Make closures work better:
|
||||
- Create closure in a loop. Need to make a list of them.
|
||||
- If a :def function is called with a function reference, compile it to get
|
||||
@@ -66,20 +53,16 @@ Vim9 - Make everything work:
|
||||
def Filter(x: string, Cond: func(string): bool)
|
||||
Filter(x, (v) => v =~ '^b')
|
||||
- Make inline function work, to be used as a funcref:
|
||||
let Ref = (arg: type): type => {
|
||||
var Ref = (arg: type): type => {
|
||||
statement
|
||||
return expr
|
||||
}
|
||||
let Ref = (arg: type) => {
|
||||
var Ref = (arg: type) => {
|
||||
statement
|
||||
statement
|
||||
}
|
||||
- Does this work already: can use func as reference:
|
||||
def SomeFunc() ...
|
||||
map(list, SomeFunc)
|
||||
- For builtin functions using tv_get_string*() use check_for_string() to be
|
||||
more strict about the argument type.
|
||||
- Possible memory leaks in test_vim9_func
|
||||
- Implement :lockvar and :unlockvar. How about local variables? Perhaps only
|
||||
allow this for global variables. Use :final or :const otherwise.
|
||||
- Allow function names that will be script-local to start with lower case
|
||||
@@ -94,10 +77,10 @@ Vim9 - Make everything work:
|
||||
- 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> = #{}
|
||||
var ret: dict<string> = #{}
|
||||
ret[i] = string(i)
|
||||
- Appending to dict item doesn't work:
|
||||
let d[i] ..= value
|
||||
var 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().
|
||||
@@ -117,13 +100,16 @@ Vim9 - Make everything work:
|
||||
- compile "skip" argument of searchpair()
|
||||
- compile "expr" and "call" expression of a channel in channel_exe_cmd()?
|
||||
- give an error for "echo Func()" if Func() does not return anything.
|
||||
- Using "windo echo expr" does not accept a line break inside "expr" (in a
|
||||
:def function and at script level in a not executed block). #7681
|
||||
|
||||
Once Vim9 is stable:
|
||||
- Change the help to prefer Vim9 syntax where appropriate
|
||||
- Use Vim9 for runtime files.
|
||||
PR #7497 for autoload/ccomplete.vim
|
||||
- Add all the error numbers in a good place in documentation.
|
||||
- In the generic eval docs, point out the Vim9 syntax where it differs.
|
||||
- Add the "vim9script" feature, can use has('vim9script')
|
||||
- Use Vim9 for runtime files.
|
||||
PR #7497 for autoload/ccomplete.vim
|
||||
|
||||
Also for Vim9:
|
||||
- better implementation for partial and tests for that.
|
||||
@@ -150,7 +136,6 @@ Also for Vim9:
|
||||
- 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?
|
||||
- Make profiling work - Add ISN_PROFILE instructions after every line?
|
||||
- List commands when 'verbose' is set or :verbose is used.
|
||||
|
||||
Further Vim9 improvements, possibly after launch:
|
||||
@@ -178,6 +163,7 @@ Popup windows:
|
||||
However, it may also cause trouble, changing the popup of another plugin.
|
||||
- Width is not computed correctly when minwidth and maxwidth are &columns
|
||||
and padding and a scrollbar are used. (#6676)
|
||||
- Should popup_getoptions() also return the mask? #7774
|
||||
- Add a way to use popup_menu() synchronously: instead of invoking the
|
||||
callback, return the choice. (Ben Jackson, #6534)
|
||||
- Use popup (or popup menu) for command line completion
|
||||
@@ -193,8 +179,11 @@ Popup windows:
|
||||
- Figure out the size and position better if wrapping inserts indent
|
||||
|
||||
Text properties:
|
||||
- :goto does not go to the right place when text properties are present.
|
||||
(#5930)
|
||||
- Popup attached to text property stays visible when text is no longer
|
||||
visible. (#7736)
|
||||
- Popup attached to text property stays visible when text is deleted with
|
||||
"cc". (#7737) "C" works OK. "dd" also files in a buffer with a single
|
||||
line.
|
||||
- "cc" does not call inserted_bytes(). (Axel Forsman, #5763)
|
||||
- Combining text property with 'cursorline' does not always work (Billie
|
||||
Cleek, #5533)
|
||||
@@ -205,8 +194,6 @@ Text properties:
|
||||
'incsearch' with :s:
|
||||
- :s/foo using CTRL-G moves to another line, should not happen, or use the
|
||||
correct line (it uses the last but one line) (Lifepillar, Aug 18, #3345)
|
||||
- :s@pat/tern@ doesn't include "/" in the pattern. (Takahiro Yoshihara, #3637)
|
||||
pass delim to do_search() ?
|
||||
- Also support range: :/foo/,/bar/delete
|
||||
- Also support for user command, e.g. Cfilter
|
||||
- :%s/foo should take the first match below the cursor line, unless there
|
||||
@@ -255,7 +242,6 @@ Terminal emulator window:
|
||||
be redrawn.
|
||||
- GUI: When using ":set go+=!" a system() call causes the hit-enter prompt.
|
||||
(#3327)
|
||||
- GUI: hang until key typed. (#3530)
|
||||
- Allow for specifying the directory, with ++cwd={dir}.
|
||||
- With a vertical split only one window is updated. (Linwei, 2018 Jun 2,
|
||||
#2977)
|
||||
@@ -277,7 +263,9 @@ Terminal emulator window:
|
||||
- When 'encoding' is not utf-8, or the job is using another encoding, setup
|
||||
conversions.
|
||||
|
||||
Error numbers available: E653
|
||||
Valgrind reports memory leaks in test_options
|
||||
|
||||
test_arglist func Test_all_not_allowed_from_cmdwin() hangs on MS-Windows.
|
||||
|
||||
Mapping with partial match not executed properly in GTK. (Ingo Karkat, #7082)
|
||||
|
||||
@@ -287,7 +275,8 @@ Have another look at the implementation.
|
||||
Patch to implement the vimtutor with a plugin: #6414
|
||||
Was originally written by Felipe Morales.
|
||||
|
||||
Patch to find Python dll using registry key. (#7540)
|
||||
Adding "10" to 'spellsuggest' causes spell suggestions to become very slow.
|
||||
(#4087) Did patch 8.2.2379 help?
|
||||
|
||||
Remove SPACE_IN_FILENAME ? It is only used for completion.
|
||||
|
||||
@@ -382,10 +371,6 @@ When "+ register is set then "" points to it. If another Vim grabs the "+
|
||||
register, then "" doesn't contain anything. Make it still follow "+.
|
||||
(#6435)
|
||||
|
||||
Patch to fix drawing error with DirectX. (James Grant, #5688)
|
||||
Causes flicker on resizing. Workaround from Ken Takata.
|
||||
How about only setting the attribute when part of the Vim window is offscreen?
|
||||
|
||||
File marks merging has duplicates since 7.4.1925. (Ingo Karkat, #5733)
|
||||
|
||||
"make test_gui" crashed in submenu_change(). Fix and remove workaround in
|
||||
@@ -479,12 +464,6 @@ Help for ":argadd fname" says that if "fname" is already in the argument list
|
||||
that entry is used. But instead it's always added. (#6210)
|
||||
Add flag AL_FIND_ADD, if there is one argument find it in the list.
|
||||
|
||||
Adding "10" to 'spellsuggest' causes spell suggestions to become very slow.
|
||||
(#4087)
|
||||
|
||||
behavior of i_CTRl-R_CTRL-R differs from documentation. (Paul Desmond Parker,
|
||||
#5771)
|
||||
|
||||
":bnext" in a help buffer is supposed to go to the next help buffer, but it
|
||||
goes to any buffer, and then :bnext skips help buffers, since they are
|
||||
unlisted. (#4478)
|
||||
@@ -496,9 +475,6 @@ find them. (Max Kukartsev, #6218)
|
||||
|
||||
Enable 'termbidi' if $VTE_VERSION >= 5703 ?
|
||||
|
||||
Universal solution to detect if t_RS is working, using cursor position.
|
||||
Koichi Iwamoto, #2126
|
||||
|
||||
Sound: support on Mac? Or does libcanberra work there?
|
||||
|
||||
Python 3.8 doesn't work. (Antonios Hadjigeorgalis, #5509)
|
||||
@@ -511,15 +487,8 @@ support combining characters. (Charles Campbell) Also #4687
|
||||
Output from assert_equalfile() doesn't give a hint about what's different.
|
||||
Assuming the files are text, print the line with the difference.
|
||||
|
||||
Add "t" action to settagstack(): truncate and add new entries. (#5405)
|
||||
|
||||
When 'relativenumber' is set the line just below a diff change doesn't get
|
||||
updated. (#6138)
|
||||
|
||||
Result of synID() sometimes wrong in help files. (#5252)
|
||||
|
||||
Status line is nut updated when splitting windows. (Marcin Szamotulski, #5496)
|
||||
|
||||
Problem showing a line if the number column width changes when using "o".
|
||||
(Mateusz Morusiewicz, #4245)
|
||||
|
||||
@@ -532,9 +501,6 @@ with packages under "start". (xtal8, #1994)
|
||||
Patch to add new motion ]( and ]{. (Yasuhiro Matsumoto, #5320)
|
||||
Better: use the "z" prefix. or ]t) and [t(.
|
||||
|
||||
Modeless selection doesn't work in gvim. (#4783)
|
||||
Caused by patch 8.1.1534.
|
||||
|
||||
Visual highlight not removed when 'display' is "lastline" and line doesn't
|
||||
fit. (Kevin Lawler, #4457)
|
||||
|
||||
@@ -545,9 +511,6 @@ Does not build with MinGW out of the box:
|
||||
- WINVER conflict, should use 0x0600 by default?
|
||||
- INT_MAX not defined: need to include <limits.h> in vim.h
|
||||
|
||||
Crash when mixing matchadd and substitute()? (Max Christian Pohle, 2018 May
|
||||
13, #2910) Can't reproduce?
|
||||
|
||||
Display messed up with matchparen, wrapping and scrolling. (#5638)
|
||||
Screen update bug related to matchparen. (Chris Heath, 2017 Mar 4, #1532)
|
||||
|
||||
@@ -556,14 +519,6 @@ when "qq" is mapped and after the first "q" the mouse is moved outside of the
|
||||
gvim window (with focus follows mouse), then the K_FOCUSLOST key is put in the
|
||||
input buffer. (#5302)
|
||||
|
||||
xterm should be able to pass focus changes to Vim, so that Vim can check for
|
||||
buffers that changed. Perhaps in misc.c, function selectwindow().
|
||||
Xterm 224 supports it!
|
||||
Patch to make FocusGained and FocusLost work in modern terminals. (Hayaki
|
||||
Saito, 2013 Apr 24) Update 2016 Aug 12.
|
||||
Also see issue #609.
|
||||
We could add the enable/disable sequences to t_ti/t_te or t_ks/t_ke.
|
||||
|
||||
:buffer completion does not escape "+" properly and results in a regexp error.
|
||||
(#5467)
|
||||
|
||||
@@ -582,16 +537,10 @@ Patch to add the :bvimgrep command. (Christian Brabandt, 2014 Nov 12)
|
||||
Updated 2016 Jun 10, #858 Update 2017 Mar 28: use <buffer>.
|
||||
Better use ":bufgrep" ?
|
||||
|
||||
Errors found with random data:
|
||||
heap-buffer-overflow in alist_add (#2472)
|
||||
|
||||
Improve fallback for menu translations, to avoid having to create lots of
|
||||
files that source the actual file. E.g. menu_da_de -> menu_da
|
||||
Include part of #3242?
|
||||
|
||||
When a terminal exit_cb closes the window, a following typed key is lost, if
|
||||
it's in a mapping. (2018 Oct 6, #2302, #3522)
|
||||
|
||||
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.
|
||||
@@ -604,11 +553,6 @@ Williams, 2018 Oct 30)
|
||||
|
||||
'[ mark in wrong column after put. (#4776)
|
||||
|
||||
"exepath('bin/cmd')" does not work while ":!bin/cmd" does work.
|
||||
(Daniel Hahler, #4710) and executable('bin/cmd') returns 1
|
||||
|
||||
Error drawing the number column when 'cursorline' is set. (#3893)
|
||||
|
||||
Problem with :tlmenu: Detach item added with all modes? Issue #3563.
|
||||
|
||||
Add an argument to expandcmd() to expand like ":next" does.
|
||||
@@ -678,9 +622,6 @@ Should we include some part of pull request #4505, not increment changedtick
|
||||
in some cases? E.g. for ":write" when the changed flag was already off, the
|
||||
buffer didn't change at all.
|
||||
|
||||
Line numbers in profile are off when function was defined with ":execute".
|
||||
(Daniel Hahler, #4511)
|
||||
|
||||
Session file contains absolute paths when "curdir" is removed form
|
||||
'sessionoptions', making it impossible to have a session with a relative path.
|
||||
(#4450)
|
||||
@@ -743,9 +684,6 @@ a hint about how to fix it. (#4300)
|
||||
|
||||
Make balloon_show() work outside of 'balloonexpr'? Users expect it to work:
|
||||
#2948. (related to #1512?)
|
||||
On Win32 it stops showing, because showState is already ShS_SHOWING.
|
||||
balloon_show() does not work properly in the terminal. (Ben Jackson, 2017 Dec
|
||||
20, #2481)
|
||||
Also see #2352, want better control over balloon, perhaps set the position.
|
||||
Should also be possible to add highlighting, like in the status line?
|
||||
balloonexpr() on MS-Windows GUI doesn't handle accented chars? (nivaemail,
|
||||
@@ -771,12 +709,6 @@ Redo only remembers the last change. Could use "{count}g." to redo an older
|
||||
change. How does the user know which change? At least have a way to list
|
||||
them: ":repeats". Add to history, like search history and command line history.
|
||||
|
||||
Incsearch test fails when locale is "C". (Dominique Pelle, #3986)
|
||||
Also run all tests with C locale?
|
||||
|
||||
"vat" doesn't work well on XML when the closing > is on another line.
|
||||
#3927
|
||||
|
||||
Pasting foo} causes Vim to behave weird. (John Little, 2018 Jun 17)
|
||||
Related to bracketed paste. I cannot reproduce it.
|
||||
|
||||
@@ -795,8 +727,6 @@ Some xterm responses are not properly handled: (Markus Gömmel, 2019 Apr 1)
|
||||
Using CTRL-L to add a character to the search string that contains \v,
|
||||
punctuation is repeated. (Smylers, 2018 Nov 17, #3621)
|
||||
|
||||
ml_get error: (Israel Chauca Fuentes, 2018 Oct 17, #3550).
|
||||
|
||||
Using single wide base character with double wide composing character gives
|
||||
drawing errors. Fill up the base character? (Dominique, #4328)
|
||||
|
||||
@@ -831,19 +761,13 @@ Memory leak in test_alot with pyeval() (allocating partial)
|
||||
Memory leak in test_alot with expand()
|
||||
Memory leaks in test_channel? (or is it because of fork())
|
||||
|
||||
gethostbyname() is old, use getaddrinfo() if available. (#3227)
|
||||
|
||||
matchaddpos() gets slow with many matches. Proposal by Rick Howe, 2018 Jul
|
||||
19.
|
||||
|
||||
Should make 'listchars' global-local. Local to window or to buffer?
|
||||
Probably window. #5206
|
||||
Add something like 'fillchars' local to window, but allow for specifying a
|
||||
highlight name. Esp. for the statusline.
|
||||
And "extends" and "precedes" are also useful without 'list' set. Also in
|
||||
'fillchars' or another option?
|
||||
Related: #3820 - Support setting the character displayed below the last line?
|
||||
Neovim uses "eob:X" in 'fillchars'.
|
||||
|
||||
Sourceforge Vim pages still have content, redirect from empty page.
|
||||
Check for PHP errors. (Wayne Davison, 2018 Oct 26)
|
||||
@@ -852,22 +776,15 @@ Problem with Visual yank when 'linebreak' and 'showbreak' are set.
|
||||
Patch with tests, but it's not clear how it is supposed to work. (tommm, 2018
|
||||
Nov 17) Asked about this, Dec 22. Christian will have a look.
|
||||
|
||||
Patch to fix that using "5gj" starting inside a closed fold does not work on
|
||||
screen lines but on text lines. (Julius Hulsmann, #4095) Lacks a test.
|
||||
|
||||
home_replace() uses $HOME instead of "homedir". (Cesar Martins, 2018 Aug 9)
|
||||
|
||||
When the status line uses term_gettitle(), it does not get updated when the
|
||||
terminal title changes. (Josh Triplett, 2018 Sep 9, #3418)
|
||||
How would we know that the status line needs to be updated?
|
||||
|
||||
Adjust windows installer explanation of behavior. (scootergrisen, #3310)
|
||||
|
||||
Update for xim-input-style help (Tony Mechelynck, 2019 Jan 10).
|
||||
Feedback from someone who uses this?
|
||||
|
||||
ml_get error. (Dominique Pelle, 2018 Sep 14, #3434)
|
||||
|
||||
Only output t_Cs when t_Ce is also set. do not use Cs and Ce termcap entries. (Daniel Hahler, 2018 Sep 25)
|
||||
Add t_cS and t_cR for cursor color select and reset. Use Cs and Cr terminfo
|
||||
values.
|
||||
@@ -890,41 +807,22 @@ includes the first screen line. (2018 Aug 23, #3368)
|
||||
Refactored HTML indent file. (Michael Lee, #1821)
|
||||
Asked to write a test.
|
||||
|
||||
MS-Windows: .lnk file not resolved properly when 'encoding' is set.
|
||||
(lkintact, 2018 Sep 22, #3473)
|
||||
|
||||
Merge checking for 'cursorline' and 'concealcursor', see neovim #9492.
|
||||
|
||||
Display error when a conceal match uses '\%>1l'. (#4854)
|
||||
|
||||
Add a windowID argument to placing a sign, so that it only shows up in one
|
||||
window for the buffer.
|
||||
|
||||
Request to add sign_setlist() to make it faster to add a lot of signs, e.g.
|
||||
when adding a sign for every quickfix entry. (#4557)
|
||||
|
||||
Win32 key codes are messy. Mike Williams tried to fix that, but now old
|
||||
mappings no longer work. Create a new terminal for the better solution?
|
||||
|
||||
Compiler warnings (geeknik, 2017 Oct 26):
|
||||
- signed integer overflow in do_sub() (#2249)
|
||||
- signed integer overflow in get_address() (#2248)
|
||||
- signed integer overflow in getdecchrs() (#2254)
|
||||
- undefined left shift in get_string_tv() (#2250)
|
||||
|
||||
Win32 console: <F11> and <F12> typed in Insert mode don't result in normal
|
||||
characters. (#3246)
|
||||
|
||||
'foldtext' is evaluated too often. (Daniel Hahler, #2773)
|
||||
|
||||
Add Native language protocol server (LSP) support. (Yegappan Lakshmanan, 2018
|
||||
Oct 28)
|
||||
|
||||
ml_get error when using a Python script. (Yggdroot, 2017 Jun 1, #1737)
|
||||
Lemonboy can reproduce (2017 Jun 5)
|
||||
Also reproduced by Benjamin Doherty, 2018 Oct 4.
|
||||
Simpler way: Ken Takata, Oct 6.
|
||||
|
||||
Add more testing of the GTK GUI.
|
||||
- gtk_test_widget_click() can be used to simulate a click in a widget.
|
||||
|
||||
@@ -983,8 +881,6 @@ missing: --nofork, -A , -b, -h, etc.
|
||||
":au * * command" should not be allowed, only use * for event when listing or
|
||||
deleting autocmds, not when adding them.
|
||||
|
||||
Alternative manpager.vim. (Enno, 2018 Jan 5, #2529)
|
||||
|
||||
With 'foldmethod' "indent" and appending an empty line, what follows isn't
|
||||
included in the existing fold. Deleting the empty line and undo fixes it.
|
||||
(Oleg Koshovetc, 2018 Jul 15, #3214)
|
||||
@@ -1006,9 +902,6 @@ Python indenting: alternative way to indent arguments:
|
||||
http://orchistro.tistory.com/236
|
||||
Should be supported with a flag.
|
||||
|
||||
Starting job with cwd option, when the directory does not exist, gives a
|
||||
confusing error message. (Wang Shidong, 2018 Jan 2, #2519)
|
||||
|
||||
Add the debug command line history to viminfo.
|
||||
|
||||
Add Makefiles to the runtime/spell directory tree, since nobody uses Aap.
|
||||
@@ -1029,9 +922,6 @@ With foldmethod=syntax and nofoldenable comment highlighting isn't removed.
|
||||
Using 'wildignore' also applies to literally entered file name. Also with
|
||||
:drop (remote commands).
|
||||
|
||||
Inserting a line in a CompleteDone autocommand may confuse undo. (micbou,
|
||||
2018 Jun 18, #3027)
|
||||
|
||||
Implement option_save() and option_restore():
|
||||
option_restore({list}) *option_restore()*
|
||||
Restore options previously saved by option_save().
|
||||
@@ -1067,8 +957,6 @@ Also see #1689.
|
||||
When 'virtualedit' is "all" and 'cursorcolumn' is set, the wrong column may be
|
||||
highlighted. (van-de-bugger, 2018 Jan 23, #2576)
|
||||
|
||||
":file" does not show anything when 'shortmess' contains 'F'. (#3070)
|
||||
|
||||
No profile information for function that executes ":quit". (Daniel Hahler,
|
||||
2017 Dec 26, #2501)
|
||||
|
||||
@@ -1079,9 +967,6 @@ Add script number to profile? (#3330 breaks tests).
|
||||
A function defined locally and lambda's are not easily recognized.
|
||||
Mention where they were defined somewhere.
|
||||
|
||||
Invalid range error when using BufWinLeave for closing terminal.
|
||||
(Gabriel Barta, 2017 Nov 15, #2339)
|
||||
|
||||
ml_get errors with buggy script. (Dominique, 2017 Apr 30)
|
||||
|
||||
Error in emsg with buggy script. (Dominique, 2017 Apr 30)
|
||||
@@ -1147,10 +1032,6 @@ line breaks. (Ken Takata, 2017 Aug 22)
|
||||
|
||||
The ":move" command does not honor closed folds. (Ryan Lue, #2351)
|
||||
|
||||
Patch to fix increment/decrement not working properly when 'virtualedit' is
|
||||
set. (Hirohito Higashi, 2016 Aug 1, #923)
|
||||
Was this fixed?
|
||||
|
||||
Cannot copy modeless selection when cursor is inside it. (lkintact, #2300)
|
||||
|
||||
Test_writefile_fails_conversion failure on Solaris because if different iconv
|
||||
@@ -1190,9 +1071,6 @@ Patch from Christian Brabandt to preserve upper case marks when wiping out a
|
||||
buffer. (2013 Dec 9)
|
||||
Also fixes #2166?
|
||||
|
||||
Python: After "import vim" error messages only show the first line of the
|
||||
stack trace. (Yggdroot, 2017 Jul 28, #1887)
|
||||
|
||||
Profile of a dict function is lost when the dict is deleted. Would it be
|
||||
possible to collect this? (Daniel Hahler, #2350)
|
||||
|
||||
@@ -1203,8 +1081,6 @@ Patch to skip writing a temp file for diffing if the buffer is equal to the
|
||||
existing file. (Akria Sheng, 2017 Jul 22)
|
||||
Could also skip writing lines that are the same.
|
||||
|
||||
Patch with Files for Latvian language. (Vitolins, 2017 May 3, #1675)
|
||||
|
||||
MS-Windows: Opening same file in a second gvim hangs. (Sven Bruggemann, 2017
|
||||
Jul 4)
|
||||
|
||||
@@ -1227,19 +1103,9 @@ Use gvimext.dll from the nightly build? (Issue #249)
|
||||
Problem with using :cd when remotely editing a file. (Gerd Wachsmuth, 2017 May
|
||||
8, #1690)
|
||||
|
||||
Bogus characters inserted when triggering indent while changing text.
|
||||
(Vitor Antunes, 2016 Nov 22, #1269)
|
||||
|
||||
Using "wviminfo /tmp/viminfo" does not store file marks that Vim knows about,
|
||||
it only works when merging with an existing file. (Shougo, 2017 Jun 19, #1781)
|
||||
|
||||
Segmentation fault with complete(). (Lifepillar, 2017 Apr 29, #1668)
|
||||
Check for "pat" to be NULL in search_for_exact_line()?
|
||||
How did it get NULL? Comment by Christian, Apr 30.
|
||||
|
||||
Is it possible to keep the complete menu open when calling complete()?
|
||||
(Prabir Shrestha, 2017 May 19, #1713)
|
||||
|
||||
Memory leak in test97? The string is actually freed. Weird.
|
||||
|
||||
assert_fails() can only check for the first error. Make it possible to have
|
||||
@@ -1278,9 +1144,6 @@ Wrong diff highlighting with three files. (2016 Oct 20, #1186)
|
||||
Also get E749 on exit.
|
||||
Another example in #1309
|
||||
|
||||
When deleting a mark or register, leave a tombstone, so that it's also deleted
|
||||
when writing viminfo (and the delete was the most recent action). #1339
|
||||
|
||||
Suggestion to improve pt-br spell checking. (Marcelo D Montu, 2016 Dec 15,
|
||||
#1330)
|
||||
|
||||
@@ -1309,9 +1172,6 @@ Check for errors E704 and E705 only does VAR_FUNC, should also do VAR_PARTIAL.
|
||||
(Nikolai Pavlov, 2017 Mar 13, #1557)
|
||||
Make a function to check for function-like type?
|
||||
|
||||
Screen updated delayed when using CTRL-O u in Insert mode.
|
||||
(Barlik, #1191) Perhaps because status message?
|
||||
|
||||
Implement named arguments for functions with optional arguments:
|
||||
func Foo(start, count = 1, all = 1)
|
||||
call Foo(12, all = 0)
|
||||
@@ -1347,16 +1207,9 @@ Useful to restore it. Is there another solution?
|
||||
|
||||
Patch for wrong cursor position on wrapped line, involving breakindent.
|
||||
(Ozaki Kiichi, 2016 Nov 25)
|
||||
Does this also fix #1408 ?
|
||||
|
||||
'cursorline' and match interfere. (Ozaki Kiichi, 2017 Jun 23, #1792)
|
||||
|
||||
Patch for 'cursorlinenr' option. (Ozaki Kiichi, 2016 Nov 30)
|
||||
|
||||
When 'completeopt' has "noselect" does not insert a newline. (Lifepillar, 2017
|
||||
Apr 23, #1653)
|
||||
Can 'completeopt' be made buffer-local? (#5487)
|
||||
|
||||
Window resizing with 'winfixheight': With a vertical split the height changes
|
||||
anyway. (Tommy allen, 2017 Feb 21, #1502)
|
||||
|
||||
@@ -1371,9 +1224,6 @@ Patch to add Zstandard compressed file support. (Nick Terrell, 2016 Oct 24)
|
||||
On Windows buffer completion sees backslash as escape char instead of path
|
||||
separator. (Toffanim, 2016 Nov 24, #1274)
|
||||
|
||||
min() and max() spawn lots of error messages if sorted list/dictionary
|
||||
contains invalid data (Nikolay Pavlov, 2016 Sep 4, #1039)
|
||||
|
||||
Should :vmap in matchit.vim be :xmap? (Tony Mechelynck)
|
||||
|
||||
Problem with whitespace in errorformat. (Gerd Wachsmuth, 2016 May 15, #807)
|
||||
@@ -1383,6 +1233,8 @@ Undo problem: "g-" doesn't go back, gets stuck. (Björn Linse, 2016 Jul 18)
|
||||
Add "unicode true" to NSIS installer. Doesn't work with Windows 95, which we
|
||||
no longer support.
|
||||
|
||||
Suppoert sort(l, 'F'), convert strings to float. (#7857)
|
||||
|
||||
sort() is not stable when using numeric/float sort (Nikolay Pavlov, 2016 Sep
|
||||
4#1038)
|
||||
|
||||
@@ -1398,7 +1250,6 @@ is used. (Filipe Brandenburger, #7322)
|
||||
gets redrawn in redraw_after_callback(). #6120
|
||||
- Add a separate timeout for opening a socket. Currently it's fixed at 50
|
||||
msec, which is too small for a remote connection. (tverniquet, #2130)
|
||||
- Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026)
|
||||
- Writing raw mode to a buffer should still handle NL characters as line
|
||||
breaks. (Dmitry Zotikov, 2017 Aug 16)
|
||||
- When out_cb executes :sleep, the close_cb may be invoked. (Daniel Hahler,
|
||||
@@ -1475,9 +1326,6 @@ Regexp problems:
|
||||
Another one: echom matchstr(" sdfsfsf\n sfdsdfsdf",'[^\n]*')
|
||||
(2017 May 15, #1252)
|
||||
|
||||
Feature request: Complete members of a dictionary. (Luc Hermitte, 2017 Jan 4,
|
||||
#1350)
|
||||
|
||||
Undo message is not always properly displayed. Patch by Ken Takata, 2013 oct
|
||||
3. Doesn't work properly according to Yukihiro Nakadaira.
|
||||
Also see #1635.
|
||||
@@ -1514,11 +1362,6 @@ the system encoding (usually utf-8).
|
||||
MS-Windows: use WS_HIDE instead of SW_SHOWMINNOACTIVE in os_win32.c?
|
||||
Otherwise task flickers in taskbar.
|
||||
|
||||
Repeating 'opfunc' in a function only works once. (Tarmean, 2016 Jul 15, #925)
|
||||
|
||||
Have a way to get the call stack, in a function and from an exception.
|
||||
#1125
|
||||
|
||||
Second problem in #966: ins_compl_add_tv() uses get_dict_string() multiple
|
||||
times, overwrites the one buffer. (Nikolay Pavlov, 2016 Aug 5)
|
||||
|
||||
@@ -1578,10 +1421,6 @@ Mechelynck) Perhaps use exists("::tearoff") to check?
|
||||
Use vim.vim syntax highlighting for help file examples, but without ":" in
|
||||
'iskeyword' for syntax.
|
||||
|
||||
When command names are very long :command output is difficult to read. Use a
|
||||
maximum for the column width? (#871)
|
||||
Patcy by varmanishant, 2016 Jun 18, #876
|
||||
|
||||
Installation of .desktop files does not work everywhere.
|
||||
It's now fixed, but the target directory probably isn't right.
|
||||
Add configure check?
|
||||
@@ -1598,12 +1437,6 @@ Especially useful when using 'linebreak'
|
||||
":cd C:\Windows\System32\drivers\etc*" does not work, even though the
|
||||
directory exists. (Sergio Gallelli, 2013 Dec 29)
|
||||
|
||||
In debug mode one can inspect variables, but not the function parameters
|
||||
(starting with a:). (Luc Hermitte, 2017 Jan 4, #1352)
|
||||
|
||||
If ":bd" also closes a Tab page then the " mark is not set. (Harm te Hennepe,
|
||||
2016 Apr 25, #780)
|
||||
|
||||
Patch to avoid redrawing tabline when the popup menu is visible.
|
||||
(Christian Brabandt, 2016 Jan 28)
|
||||
|
||||
@@ -1654,9 +1487,6 @@ Patch to add :mapgroup, put mappings in a group like augroup.
|
||||
Value returned by virtcol() changes depending on how lines wrap. This is
|
||||
inconsistent with the documentation.
|
||||
|
||||
Value of virtcol() for '[ and '] depend on multibyte character.
|
||||
(Luchr, #277)
|
||||
|
||||
Can we cache the syntax attributes, so that updates for 'relativenumber' and
|
||||
'cursorline'/'cursorcolumn' are a lot faster? Thus store the attributes
|
||||
before combining them.
|
||||
@@ -1671,9 +1501,6 @@ Build with Python on Mac does not always use the right library.
|
||||
To support Thai (and other languages) word boundaries, include the ICU
|
||||
library: http://userguide.icu-project.org/boundaryanalysis
|
||||
|
||||
When complete() first argument is before where insert started and 'backspace'
|
||||
is Vi compatible, the completion fails. (Hirohito Higashi, 2015 Feb 19)
|
||||
|
||||
Patch to use two highlight groups for relative numbers. (Shaun Brady, 2016 Jan
|
||||
30)
|
||||
|
||||
@@ -1879,9 +1706,6 @@ Patch for XDG base directory support. (Jean François Bignolles, 2014 Mar 4)
|
||||
Remark on the docs. Should not be a compile time feature. But then what?
|
||||
Also see #2034.
|
||||
|
||||
Completion of ":e" is ":earlier", should be ":edit". Complete to the matching
|
||||
command instead of doing this alphabetically. (Mikel Jorgensen)
|
||||
|
||||
Patch to define macros for hardcoded values. (Elias Diem, 2013 Dec 14)
|
||||
|
||||
Several syntax file match "^\s*" which may get underlined if that's in the
|
||||
@@ -1926,10 +1750,6 @@ The BufUnload event is triggered when re-using the empty buffer.
|
||||
(Pokey Rule, 2013 Jul 22)
|
||||
Patch by Marcin Szamotulski, 2013 Jul 22.
|
||||
|
||||
The CompleteDone autocommand needs some info passed to it:
|
||||
- The word that was selected (empty if abandoned complete)
|
||||
- Type of completion: tag, omnifunc, user func.
|
||||
|
||||
Patch to allow more types in remote_expr(). (Lech Lorens, 2014 Jan 5)
|
||||
Doesn't work for string in list. Other way to pass all types of variables
|
||||
reliably?
|
||||
@@ -2390,10 +2210,6 @@ Syntax priority problem. (Charles Campbell, 2011 Sep 15)
|
||||
When completion inserts the first match, it may trigger the line to be folded.
|
||||
Disable updating folds while completion is active? (Peter Odding, 2010 Jun 9)
|
||||
|
||||
When a:base in 'completefunc' starts with a number it's passed as a number,
|
||||
not a string. (Sean Ma) Need to add flag to call_func_retlist() to force a
|
||||
string value.
|
||||
|
||||
For running gvim on a USB stick: avoid the OLE registration. Use a command
|
||||
line argument -noregister.
|
||||
|
||||
@@ -2539,6 +2355,7 @@ part of standard Vim. The "1 to "9 registers are not sufficient.
|
||||
6 When yanking into the unnamed registers several times, somehow make the
|
||||
previous contents also available (like it's done for deleting). What
|
||||
register names to use? g"1, g"2, etc.?
|
||||
Also do this for the small delete register "-.
|
||||
|
||||
After doing "su" $HOME can be the old user's home, thus ~root/file is not
|
||||
correct. Don't use it in the swap file.
|
||||
@@ -2783,10 +2600,6 @@ More AmigaOS4 patches. (Peter Bengtsson, Nov 9)
|
||||
Amiga patches with vbcc. (Adrien Destugues, 2010 Aug 30)
|
||||
http://pulkomandy.ath.cx/drop/vim73_vbcc_amiga.diff
|
||||
|
||||
Insert mode completion: When editing the text and pressing CTRL-N again goes
|
||||
back to originally completed text, edited text is gone. (Peng Yu, 2008 Jul 24)
|
||||
Suggestion by Ben Schmidt, 2008 Aug 6.
|
||||
|
||||
Problem with compound words? (Bert, 2008 May 6)
|
||||
No warning for when flags are defined after they are used in an affix.
|
||||
|
||||
@@ -3295,15 +3108,11 @@ Quickfix/Location List:
|
||||
window is cleared, to avoid going back to the list of errors buffer (would
|
||||
have two windows with it). Can we just remove the jump list entries for
|
||||
the quickfix buffer?
|
||||
- Quickfix window height is not kept with a vertical split. (Lifepillar,
|
||||
2018 Jun 10, #2998)
|
||||
- When an item in the quickfix list has a file name that does not exist,
|
||||
behave like the item was not a match for :cnext.
|
||||
- When adding an item to a new quickfix list make ":cnext" jump to that
|
||||
item. Make a difference being at the first item and not having used
|
||||
:cnext at all. (Afanasiy Fet, 2017 Jan 3)
|
||||
- This does not work: :set cscopequickfix=a-
|
||||
(Linewi, 2015 Jul 12, #914)
|
||||
- When opening quickfix window, disable spell checking?
|
||||
- Patch for supporting count before CR in quickfix window. (AOYAMA Shotaro,
|
||||
2007 Jan 1)
|
||||
@@ -5085,6 +4894,23 @@ Omni completion:
|
||||
|
||||
|
||||
Insert mode completion/expansion:
|
||||
- Is it possible to keep the complete menu open when calling complete()?
|
||||
(Prabir Shrestha, 2017 May 19, #1713)
|
||||
- When 'completeopt' has "noselect" does not insert a newline.
|
||||
(Lifepillar, 2017 Apr 23, #1653)
|
||||
- Can 'completeopt' be made buffer-local? (#5487)
|
||||
- When complete() first argument is before where insert started and
|
||||
'backspace' is Vi compatible, the completion fails.
|
||||
(Hirohito Higashi, 2015 Feb 19)
|
||||
- The CompleteDone autocommand needs some info passed to it:
|
||||
- The word that was selected (empty if abandoned complete)
|
||||
- Type of completion: tag, omnifunc, user func.
|
||||
- When a:base in 'completefunc' starts with a number it's passed as a
|
||||
number, not a string. (Sean Ma) Need to add flag to call_func_retlist()
|
||||
to force a string value.
|
||||
- When editing the text and pressing CTRL-N again goes back to originally
|
||||
completed text, edited text is gone. (Peng Yu, 2008 Jul 24)
|
||||
Suggestion by Ben Schmidt, 2008 Aug 6.
|
||||
- GUI implementation of the popup menu.
|
||||
7 When searching in other files the name flash by, too fast to read. Only
|
||||
display a name every second or so, like with ":vimgrep".
|
||||
@@ -5182,6 +5008,10 @@ Command line editing:
|
||||
|
||||
|
||||
Command line completion:
|
||||
- Feature request: Complete members of a dictionary.
|
||||
(Luc Hermitte, 2017 Jan 4, #1350)
|
||||
- Completion of ":e" is ":earlier", should be ":edit". Complete to the
|
||||
matching command instead of doing this alphabetically. (Mikel Jorgensen)
|
||||
8 Change expand_interactively into a flag that is passed as an argument.
|
||||
8 With command line completion after '%' and '#', expand current/alternate
|
||||
file name, so it can be edited. Also with modifiers, such as "%:h".
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_04.txt* For Vim version 8.2. Last change: 2019 Nov 21
|
||||
*usr_04.txt* For Vim version 8.2. Last change: 2021 Feb 22
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -464,9 +464,9 @@ of characters to replace. It will not continue on the next line.
|
||||
|
||||
You can switch between Insert mode and Replace mode with the <Insert> key.
|
||||
|
||||
When you use <BS> (backspace) to make correction, you will notice that the
|
||||
old text is put back. Thus it works like an undo command for the last typed
|
||||
character.
|
||||
When you use <BS> (backspace) to make a correction, you will notice that the
|
||||
old text is put back. Thus it works like an undo command for the previously
|
||||
typed character.
|
||||
|
||||
==============================================================================
|
||||
*04.10* Conclusion
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 8.2. Last change: 2021 Jan 08
|
||||
*usr_41.txt* For Vim version 8.2. Last change: 2021 Feb 01
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -665,6 +665,7 @@ List manipulation: *list-functions*
|
||||
count() count number of times a value appears in a List
|
||||
repeat() repeat a List multiple times
|
||||
flatten() flatten a List
|
||||
flattennew() flatten a copy of a List
|
||||
|
||||
Dictionary manipulation: *dict-functions*
|
||||
get() get an entry without an error for a wrong key
|
||||
@@ -882,6 +883,7 @@ Command line: *command-line-functions*
|
||||
getcmdtype() return the current command-line type
|
||||
getcmdwintype() return the current command-line window type
|
||||
getcompletion() list of command-line completion matches
|
||||
fullcommand() get full command name
|
||||
|
||||
Quickfix and location lists: *quickfix-functions*
|
||||
getqflist() list of quickfix errors
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*various.txt* For Vim version 8.2. Last change: 2020 Nov 16
|
||||
*various.txt* For Vim version 8.2. Last change: 2021 Jan 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -345,8 +345,9 @@ N *+clientserver* Unix and Win32: Remote invocation |clientserver|
|
||||
*+clipboard* |clipboard| support compiled-in
|
||||
*+clipboard_working* |clipboard| support compiled-in and working
|
||||
T *+cmdline_compl* command line completion |cmdline-completion|
|
||||
S *+cmdline_hist* command line history |cmdline-history|
|
||||
T *+cmdline_hist* command line history |cmdline-history|
|
||||
N *+cmdline_info* |'showcmd'| and |'ruler'|
|
||||
S *+cmdwin* |cmdline-window| support
|
||||
T *+comments* |'comments'| support
|
||||
B *+conceal* "conceal" support, see |conceal| |:syn-conceal| etc.
|
||||
N *+cryptv* encryption support |encryption|
|
||||
@@ -411,7 +412,7 @@ N *+mouse_sysmouse* Unix only: *BSD console mouse handling |sysmouse|
|
||||
B *+mouse_sgr* Unix only: sgr mouse handling |sgr-mouse|
|
||||
B *+mouse_urxvt* Unix only: urxvt mouse handling |urxvt-mouse|
|
||||
N *+mouse_xterm* Unix only: xterm mouse handling |xterm-mouse|
|
||||
N *+multi_byte* 16 and 32 bit characters |multibyte|
|
||||
T *+multi_byte* Unicode support, 16 and 32 bit characters |multibyte|
|
||||
*+multi_byte_ime* Win32 input method for multibyte chars |multibyte-ime|
|
||||
N *+multi_lang* non-English language support |multi-lang|
|
||||
m *+mzscheme* Mzscheme interface |mzscheme|
|
||||
@@ -707,12 +708,12 @@ K Run a program to lookup the keyword under the
|
||||
not more than one line.
|
||||
|
||||
[N]gs *gs* *:sl* *:sleep*
|
||||
:[N]sl[eep] [N] [m] Do nothing for [N] seconds. When [m] is included,
|
||||
:[N]sl[eep] [N][m] Do nothing for [N] seconds. When [m] is included,
|
||||
sleep for [N] milliseconds. The count for "gs" always
|
||||
uses seconds. The default is one second. >
|
||||
:sleep "sleep for one second
|
||||
:5sleep "sleep for five seconds
|
||||
:sleep 100m "sleep for a hundred milliseconds
|
||||
:sleep 100m "sleep for 100 milliseconds
|
||||
10gs "sleep for ten seconds
|
||||
< Can be interrupted with CTRL-C (CTRL-Break on
|
||||
MS-Windows). "gs" stands for "goto sleep".
|
||||
@@ -722,6 +723,9 @@ K Run a program to lookup the keyword under the
|
||||
available when compiled with the |+netbeans_intg|
|
||||
feature}
|
||||
|
||||
*:sl!* *:sleep!*
|
||||
:[N]sl[eep]! [N] [m] Same as above, but hide the cursor
|
||||
|
||||
*:xrestore* *:xr*
|
||||
:xr[estore] [display] Reinitializes the connection to the X11 server. Useful
|
||||
after the X server restarts, e.g. when running Vim for
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*version6.txt* For Vim version 8.2. Last change: 2020 Aug 17
|
||||
*version6.txt* For Vim version 8.2. Last change: 2021 Jan 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -9661,7 +9661,7 @@ Solution: Check for tcsetattr() to return an error, retry when it does.
|
||||
Files: src/os_unix.c
|
||||
|
||||
Patch 6.2f.018
|
||||
Problem: Mac OS X 10.2: OK is defined to zero in cursus.h while Vim uses
|
||||
Problem: Mac OS X 10.2: OK is defined to zero in curses.h while Vim uses
|
||||
one. Redefining it causes a warning message.
|
||||
Solution: Undefine OK before defining it to one. (Taro Muraoka)
|
||||
Files: src/vim.h
|
||||
|
||||
@@ -16933,7 +16933,7 @@ Solution: Add #ifdefs.
|
||||
Files: src/screen.c
|
||||
|
||||
Patch 8.0.0383 (after 8.0.0382)
|
||||
Problem: Misplaced #ifdef. (Christ van Willigen)
|
||||
Problem: Misplaced #ifdef. (Christ van Willegen)
|
||||
Solution: Split assignment.
|
||||
Files: src/screen.c
|
||||
|
||||
@@ -19612,7 +19612,7 @@ Files: Filelist
|
||||
|
||||
Patch 8.0.0815
|
||||
Problem: Terminal window not correctly updated when 'statusline' invokes
|
||||
":sleep". (NIkolay Pavlov)
|
||||
":sleep". (Nikolay Pavlov)
|
||||
Solution: Clear got_int. Repeat redrawing when needed.
|
||||
Files: src/terminal.c
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*vi_diff.txt* For Vim version 8.2. Last change: 2020 Aug 15
|
||||
*vi_diff.txt* For Vim version 8.2. Last change: 2021 Jan 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -73,7 +73,7 @@ edit the termcap entry and try again. Vim has the |terminal-options|.
|
||||
Vim has only a few limits for the files that can be edited {Vi: can not handle
|
||||
<Nul> characters and characters above 128, has limited line length, many other
|
||||
limits}.
|
||||
*E340*
|
||||
|
||||
Maximum line length 2147483647 characters. Longer lines are split.
|
||||
Maximum number of lines 2147483647 lines.
|
||||
Maximum file size 2147483647 bytes (2 Gbyte) when a long integer is
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2021 Jan 10
|
||||
*vim9.txt* For Vim version 8.2. Last change: 2021 Feb 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -51,6 +51,7 @@ The Vim9 script syntax and semantics are used in:
|
||||
- a function defined with the `:def` command
|
||||
- a script file where the first command is `vim9script`
|
||||
- an autocommand defined in the context of the above
|
||||
- a command prefixed with the `vim9cmd` command modifier
|
||||
|
||||
When using `:function` in a Vim9 script file the legacy syntax is used, with
|
||||
the highest |scriptversion|. However, this can be confusing and is therefore
|
||||
@@ -60,6 +61,12 @@ Vim9 script and legacy Vim script can be mixed. There is no requirement to
|
||||
rewrite old scripts, they keep working as before. You may want to use a few
|
||||
`:def` functions for code that needs to be fast.
|
||||
|
||||
*:vim9* *:vim9cmd*
|
||||
:vim9[cmd] {cmd}
|
||||
Execute {cmd} using Vim9 script syntax and semantics.
|
||||
Useful when typing a command and in a legacy script or
|
||||
function.
|
||||
|
||||
==============================================================================
|
||||
|
||||
2. Differences from legacy Vim script *vim9-differences*
|
||||
@@ -89,8 +96,8 @@ script and `:def` functions; details are below:
|
||||
def CallMe(count: number, message: string): bool
|
||||
- Call functions without `:call`: >
|
||||
writefile(['done'], 'file.txt')
|
||||
- You cannot use `:xit`, `:t`, `:append`, `:change`, `:insert` or curly-braces
|
||||
names.
|
||||
- You cannot use `:xit`, `:t`, `:k`, `:append`, `:change`, `:insert` or
|
||||
curly-braces names.
|
||||
- A range before a command must be prefixed with a colon: >
|
||||
:%s/this/that
|
||||
- Unless mentioned specifically, the highest |scriptversion| is used.
|
||||
@@ -272,8 +279,8 @@ without any command. The same for global, window, tab, buffer and Vim
|
||||
variables, because they are not really declared. They can also be deleted
|
||||
with `:unlet`.
|
||||
|
||||
Variables and functions cannot shadow previously defined or imported variables
|
||||
and functions.
|
||||
Variables, functions and function arguments cannot shadow previously defined
|
||||
or imported variables and functions in the same script file.
|
||||
Variables may shadow Ex commands, rename the variable if needed.
|
||||
|
||||
Global variables and user defined functions must be prefixed with "g:", also
|
||||
@@ -300,14 +307,14 @@ Example: >
|
||||
const myList = [1, 2]
|
||||
myList = [3, 4] # Error!
|
||||
myList[0] = 9 # Error!
|
||||
muList->add(3) # Error!
|
||||
myList->add(3) # Error!
|
||||
< *:final*
|
||||
`:final` is used for making only the variable a constant, the value can be
|
||||
changed. This is well known from Java. Example: >
|
||||
final myList = [1, 2]
|
||||
myList = [3, 4] # Error!
|
||||
myList[0] = 9 # OK
|
||||
muList->add(3) # OK
|
||||
myList->add(3) # OK
|
||||
|
||||
It is common to write constants as ALL_CAPS, but you don't have to.
|
||||
|
||||
@@ -403,10 +410,16 @@ Additionally, a lambda can contain statements in {}: >
|
||||
}
|
||||
NOT IMPLEMENTED YET
|
||||
|
||||
*vim9-curly*
|
||||
To avoid the "{" of a dictionary literal to be recognized as a statement block
|
||||
wrap it in parenthesis: >
|
||||
wrap it in parentheses: >
|
||||
var Lambda = (arg) => ({key: 42})
|
||||
|
||||
Also when confused with the start of a command block: >
|
||||
({
|
||||
key: value
|
||||
})->method()
|
||||
|
||||
|
||||
Automatic line continuation ~
|
||||
|
||||
@@ -487,6 +500,9 @@ Now "exit_cb: Func})" is actually a valid command: save any changes to the
|
||||
file "_cb: Func})" and exit. To avoid this kind of mistake in Vim9 script
|
||||
there must be white space between most command names and the argument.
|
||||
|
||||
However, the argument of a command that is a command won't be recognized. For
|
||||
example, after "windo echo expr" a line break inside "expr" will not be seen.
|
||||
|
||||
|
||||
Notes:
|
||||
- "enddef" cannot be used at the start of a continuation line, it ends the
|
||||
@@ -527,24 +543,31 @@ 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 is considered a much more useful syntax. In Vim9 script the {} form
|
||||
uses literal keys: >
|
||||
let dict = {key: value}
|
||||
var dict = {key: value}
|
||||
|
||||
This works for alphanumeric characters, underscore and dash. If you want to
|
||||
use another character, use a single or double quoted string: >
|
||||
let dict = {'key with space': value}
|
||||
let dict = {"key\twith\ttabs": value}
|
||||
let dict = {'': value} # empty key
|
||||
var dict = {'key with space': value}
|
||||
var dict = {"key\twith\ttabs": value}
|
||||
var dict = {'': value} # empty key
|
||||
|
||||
In case the key needs to be an expression, square brackets can be used, just
|
||||
like in JavaScript: >
|
||||
let dict = {["key" .. nr]: value}
|
||||
var dict = {["key" .. nr]: value}
|
||||
|
||||
The key type can be string, number, bool or float. Other types result in an
|
||||
error. A number can be given with and without the []: >
|
||||
var dict = {123: 'without', [456]: 'with'}
|
||||
echo dict
|
||||
{'456': 'with', '123': 'without'}
|
||||
|
||||
|
||||
No :xit, :t, :append, :change or :insert ~
|
||||
No :xit, :t, :k, :append, :change or :insert ~
|
||||
|
||||
These commands are too easily confused with local variable names.
|
||||
Instead of `:x` or `:xit` you can use `:exit`.
|
||||
Instead of `:t` you can use `:copy`.
|
||||
Instead of `:k` you can use `:mark`.
|
||||
|
||||
|
||||
Comparators ~
|
||||
@@ -552,6 +575,29 @@ Comparators ~
|
||||
The 'ignorecase' option is not used for comparators that use strings.
|
||||
|
||||
|
||||
For loop ~
|
||||
|
||||
Legacy Vim script has some tricks to make a for loop over a list handle
|
||||
deleting items at the current or previous item. In Vim9 script it just uses
|
||||
the index, if items are deleted then items in the list will be skipped.
|
||||
Example legacy script: >
|
||||
let l = [1, 2, 3, 4]
|
||||
for i in l
|
||||
echo i
|
||||
call remove(l, index(l, i))
|
||||
endfor
|
||||
Would echo:
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
In compiled Vim9 script you get:
|
||||
1
|
||||
3
|
||||
Generally, you should not change the list that is iterated over. Make a copy
|
||||
first if needed.
|
||||
|
||||
|
||||
White space ~
|
||||
|
||||
Vim9 script enforces proper use of white space. This is no longer allowed: >
|
||||
@@ -576,15 +622,17 @@ the start and end: >
|
||||
|
||||
White space is not allowed:
|
||||
- Between a function name and the "(": >
|
||||
call Func (arg) # Error!
|
||||
call Func
|
||||
Func (arg) # Error!
|
||||
Func
|
||||
\ (arg) # Error!
|
||||
call Func(arg) # OK
|
||||
call Func(
|
||||
\ arg) # OK
|
||||
call Func(
|
||||
\ arg # OK
|
||||
\ )
|
||||
Func
|
||||
(arg) # Error!
|
||||
Func(arg) # OK
|
||||
Func(
|
||||
arg) # OK
|
||||
Func(
|
||||
arg # OK
|
||||
)
|
||||
|
||||
|
||||
Conditions and expressions ~
|
||||
@@ -648,12 +696,13 @@ for v:null. When converting a boolean to a string "false" and "true" are
|
||||
used, not "v:false" and "v:true" like in legacy script. "v:none" is not
|
||||
changed, it is only used in JSON and has no equivalent in other languages.
|
||||
|
||||
Indexing a string with [idx] or [idx, idx] uses character indexes instead of
|
||||
Indexing a string with [idx] or [idx : idx] uses character indexes instead of
|
||||
byte indexes. Example: >
|
||||
echo 'bár'[1]
|
||||
In legacy script this results in the character 0xc3 (an illegal byte), in Vim9
|
||||
script this results in the string 'á'.
|
||||
A negative index is counting from the end, "[-1]" is the last character.
|
||||
To exclude the last character use |slice()|.
|
||||
If the index is out of range then an empty string results.
|
||||
|
||||
In legacy script "++var" and "--var" would be silently accepted and have no
|
||||
@@ -670,21 +719,22 @@ same time tries to support the legacy Vim commands. Some compromises had to
|
||||
be made. Here is a summary of what might be unexpected.
|
||||
|
||||
Ex command ranges need to be prefixed with a colon. >
|
||||
-> # legacy Vim: shifts the previous line to the right
|
||||
->func() # Vim9: method call in continuation line
|
||||
:-> # Vim9: shifts the previous line to the right
|
||||
-> legacy Vim: shifts the previous line to the right
|
||||
->func() Vim9: method call in a continuation line
|
||||
:-> Vim9: shifts the previous line to the right
|
||||
|
||||
%s/a/b # legacy Vim: substitute on all lines
|
||||
%s/a/b legacy Vim: substitute on all lines
|
||||
x = alongname
|
||||
% another # Vim9: line continuation without a backslash
|
||||
:%s/a/b # Vim9: substitute on all lines
|
||||
'text'->func() # Vim9: method call
|
||||
:'t # legacy Vim: jump to mark m
|
||||
% another Vim9: modulo operator in a continuation line
|
||||
:%s/a/b Vim9: substitute on all lines
|
||||
't legacy Vim: jump to mark t
|
||||
'text'->func() Vim9: method call
|
||||
:'t Vim9: jump to mark t
|
||||
|
||||
Some Ex commands can be confused with assignments in Vim9 script: >
|
||||
g:name = value # assignment
|
||||
g:pattern:cmd # invalid command - ERROR
|
||||
:g:pattern:cmd # :global command
|
||||
g:name = value # assignment
|
||||
g:pattern:cmd # invalid command - ERROR
|
||||
:g:pattern:cmd # :global command
|
||||
|
||||
Functions defined with `:def` compile the whole function. Legacy functions
|
||||
can bail out, and the following lines are not parsed: >
|
||||
@@ -704,7 +754,7 @@ Vim9 functions are compiled as a whole: >
|
||||
For a workaround, split it in two functions: >
|
||||
func Maybe()
|
||||
if has('feature')
|
||||
call MaybyInner()
|
||||
call MaybeInner()
|
||||
endif
|
||||
endfunc
|
||||
if has('feature')
|
||||
@@ -720,7 +770,7 @@ evaluates to false: >
|
||||
endif
|
||||
enddef
|
||||
< *vim9-user-command*
|
||||
Another side effect of compiling a function is that the precense of a user
|
||||
Another side effect of compiling a function is that the presence of a user
|
||||
command is checked at compile time. If the user command is defined later an
|
||||
error will result. This works: >
|
||||
command -nargs=1 MyCommand echom <q-args>
|
||||
@@ -811,6 +861,9 @@ prefix and they do not need to exist (they can be deleted any time).
|
||||
Note that for command line completion of {func} you
|
||||
can prepend "s:" to find script-local functions.
|
||||
|
||||
:disa[ssemble]! {func} Like `:disassemble` but with the instructions used for
|
||||
profiling.
|
||||
|
||||
Limitations ~
|
||||
|
||||
Local variables will not be visible to string evaluation. For example: >
|
||||
@@ -976,10 +1029,14 @@ an error, thus breaking backwards compatibility. For example:
|
||||
- Using a number where a string is expected. *E1024*
|
||||
|
||||
One consequence is that the item type of a list or dict given to map() must
|
||||
not change. This will give an error in compiled code: >
|
||||
not change. This will give an error in Vim9 script: >
|
||||
map([1, 2, 3], (i, v) => 'item ' .. i)
|
||||
E1012: Type mismatch; expected list<number> but got list<string>
|
||||
Instead use |mapnew()|.
|
||||
E1012: Type mismatch; expected number but got string
|
||||
Instead use |mapnew()|. If the item type was determined to be "any" it can
|
||||
change to a more specific type. E.g. when a list of mixed types gets changed
|
||||
to a list of numbers.
|
||||
Same for |extend()|, use |extendnew()| instead, and for |flatten()|, use
|
||||
|flattennew()| instead.
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -999,9 +1056,9 @@ that you don't do that.
|
||||
Namespace ~
|
||||
*vim9-namespace*
|
||||
To recognize a file that can be imported the `vim9script` statement must
|
||||
appear as the first statement in the file. It tells Vim to interpret the
|
||||
script in its own namespace, instead of the global namespace. If a file
|
||||
starts with: >
|
||||
appear as the first statement in the file (see |vim9-mix| for an exception).
|
||||
It tells Vim to interpret the script in its own namespace, instead of the
|
||||
global namespace. If a file starts with: >
|
||||
vim9script
|
||||
var myvar = 'yes'
|
||||
Then "myvar" will only exist in this file. While without `vim9script` it would
|
||||
@@ -1021,6 +1078,27 @@ Vim default value, like with: >
|
||||
One of the effects is that |line-continuation| is always enabled.
|
||||
The original value of 'cpoptions' is restored at the end of the script.
|
||||
|
||||
*vim9-mix*
|
||||
There is one way to use both legacy and Vim9 syntax in one script file: >
|
||||
" comments may go here
|
||||
if !has('vim9script')
|
||||
" legacy script commands go here
|
||||
finish
|
||||
endif
|
||||
vim9script
|
||||
# Vim9 script commands go here
|
||||
This allows for writing a script that takes advantage of the Vim9 script
|
||||
syntax if possible, but will also work on a Vim version without it.
|
||||
|
||||
This can only work in two ways:
|
||||
1. The "if" statement evaluates to false, the commands up to `endif` are
|
||||
skipped and `vim9script` is then the first command actually executed.
|
||||
2. The "if" statement evaluates to true, the commands up to `endif` are
|
||||
executed and `finish` bails out before reaching `vim9script`.
|
||||
|
||||
TODO: The "vim9script" feature does not exist yet, it will only be added once
|
||||
the Vim9 script syntax has been fully implemented.
|
||||
|
||||
|
||||
Export ~
|
||||
*:export* *:exp*
|
||||
@@ -1090,7 +1168,7 @@ actually needed. A recommended mechanism:
|
||||
|
||||
1. In the plugin define user commands, functions and/or mappings that refer to
|
||||
an autoload script. >
|
||||
command -nargs=1 SearchForStuff call searchfor#Stuff(<f-args>)
|
||||
command -nargs=1 SearchForStuff searchfor#Stuff(<f-args>)
|
||||
|
||||
< This goes in .../plugin/anyname.vim. "anyname.vim" can be freely chosen.
|
||||
|
||||
@@ -1183,12 +1261,12 @@ When compiling lines of Vim commands into instructions as much as possible
|
||||
should be done at compile time. Postponing it to runtime makes the execution
|
||||
slower and means mistakes are found only later. For example, when
|
||||
encountering the "+" character and compiling this into a generic add
|
||||
instruction, at execution time the instruction would have to inspect the type
|
||||
of the arguments and decide what kind of addition to do. And when the
|
||||
type is dictionary throw an error. If the types are known to be numbers then
|
||||
an "add number" instruction can be used, which is faster. The error can be
|
||||
given at compile time, no error handling is needed at runtime, since adding
|
||||
two numbers cannot fail.
|
||||
instruction, at runtime the instruction would have to inspect the type of the
|
||||
arguments and decide what kind of addition to do. And when the type is
|
||||
dictionary throw an error. If the types are known to be numbers then an "add
|
||||
number" instruction can be used, which is faster. The error can be given at
|
||||
compile time, no error handling is needed at runtime, since adding two numbers
|
||||
cannot fail.
|
||||
|
||||
The syntax for types, using <type> for compound types, is similar to Java. It
|
||||
is easy to understand and widely used. The type names are what were used in
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*windows.txt* For Vim version 8.2. Last change: 2020 Dec 18
|
||||
*windows.txt* For Vim version 8.2. Last change: 2021 Feb 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -138,10 +138,12 @@ status line is inverted anyway; you will only see this problem on terminals
|
||||
that have termcap codes for italics.
|
||||
|
||||
*filler-lines*
|
||||
The lines after the last buffer line in a window are called filler lines.
|
||||
These lines start with a tilde (~) character. By default, these are
|
||||
highlighted as NonText (|hl-NonText|). The EndOfBuffer highlight group
|
||||
(|hl-EndOfBuffer|) can be used to change the highlighting of filler lines.
|
||||
The lines after the last buffer line in a window are called filler lines. By
|
||||
default, these lines start with a tilde (~) character. The 'eob' item in the
|
||||
'fillchars' option can be used to change this character. By default, these
|
||||
characters are highlighted as NonText (|hl-NonText|). The EndOfBuffer
|
||||
highlight group (|hl-EndOfBuffer|) can be used to change the highlighting of
|
||||
the filler characters.
|
||||
|
||||
==============================================================================
|
||||
3. Opening and closing a window *opening-window* *E36*
|
||||
@@ -208,7 +210,9 @@ CTRL-W CTRL_N *CTRL-W_CTRL-N*
|
||||
:[N]new [++opt] [+cmd] {file}
|
||||
:[N]sp[lit] [++opt] [+cmd] {file} *:split_f*
|
||||
Create a new window and start editing file {file} in it. This
|
||||
behaves like a ":split" first, and then an ":e" command.
|
||||
behaves almost like a ":split" first, and then an ":edit"
|
||||
command, but the alternate file name in the original window is
|
||||
set to {file}.
|
||||
If [+cmd] is given, execute the command when the file has been
|
||||
loaded |+cmd|.
|
||||
Also see |++opt|.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2020 Dec 24
|
||||
" Last Change: 2021 Jan 21
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -216,6 +216,9 @@ au BufNewFile,BufRead *.bc setf bc
|
||||
" BDF font
|
||||
au BufNewFile,BufRead *.bdf setf bdf
|
||||
|
||||
" Beancount
|
||||
au BufNewFile,BufRead *.beancount setf beancount
|
||||
|
||||
" BibTeX bibliography database file
|
||||
au BufNewFile,BufRead *.bib setf bib
|
||||
|
||||
@@ -589,6 +592,9 @@ au BufNewFile,BufRead *.fan,*.fwt setf fan
|
||||
" Factor
|
||||
au BufNewFile,BufRead *.factor setf factor
|
||||
|
||||
" Fennel
|
||||
autocmd BufRead,BufNewFile *.fnl setf fennel
|
||||
|
||||
" Fetchmail RC file
|
||||
au BufNewFile,BufRead .fetchmailrc setf fetchmail
|
||||
|
||||
@@ -1173,9 +1179,10 @@ au BufNewFile,BufRead *.papp,*.pxml,*.pxsl setf papp
|
||||
" Password file
|
||||
au BufNewFile,BufRead */etc/passwd,*/etc/passwd-,*/etc/passwd.edit,*/etc/shadow,*/etc/shadow-,*/etc/shadow.edit,*/var/backups/passwd.bak,*/var/backups/shadow.bak setf passwd
|
||||
|
||||
" Pascal (also *.p)
|
||||
" Pascal (also *.p, *.pp, *.inc)
|
||||
au BufNewFile,BufRead *.pas setf pascal
|
||||
|
||||
" Pascal or Puppet manifest
|
||||
au BufNewFile,BufRead *.pp call dist#ft#FTpp()
|
||||
|
||||
" Delphi or Lazarus program file
|
||||
@@ -1266,7 +1273,7 @@ au BufNewFile,BufRead *.pov setf pov
|
||||
" Povray configuration
|
||||
au BufNewFile,BufRead .povrayrc setf povini
|
||||
|
||||
" Povray, PHP or assembly
|
||||
" Povray, Pascal, PHP or assembly
|
||||
au BufNewFile,BufRead *.inc call dist#ft#FTinc()
|
||||
|
||||
" Printcap and Termcap
|
||||
@@ -1275,13 +1282,19 @@ au BufNewFile,BufRead *printcap
|
||||
au BufNewFile,BufRead *termcap
|
||||
\ let b:ptcap_type = "term" | setf ptcap
|
||||
|
||||
" PCCTS / ANTRL
|
||||
"au BufNewFile,BufRead *.g setf antrl
|
||||
" PCCTS / ANTLR
|
||||
"au BufNewFile,BufRead *.g setf antlr
|
||||
au BufNewFile,BufRead *.g setf pccts
|
||||
|
||||
" PPWizard
|
||||
au BufNewFile,BufRead *.it,*.ih setf ppwiz
|
||||
|
||||
" Puppet
|
||||
au BufNewFile,BufRead Puppetfile setf ruby
|
||||
|
||||
" Embedded Puppet
|
||||
au BufNewFile,BufRead *.epp setf epuppet
|
||||
|
||||
" Obj 3D file format
|
||||
" TODO: is there a way to avoid MS-Windows Object files?
|
||||
au BufNewFile,BufRead *.obj setf obj
|
||||
@@ -1424,8 +1437,8 @@ au BufNewFile,BufRead *.rb,*.rbw setf ruby
|
||||
" RubyGems
|
||||
au BufNewFile,BufRead *.gemspec setf ruby
|
||||
|
||||
" Rust
|
||||
au BufNewFile,BufRead *.rs setf rust
|
||||
" RBS (Ruby Signature)
|
||||
au BufNewFile,BufRead *.rbs setf rbs
|
||||
|
||||
" Rackup
|
||||
au BufNewFile,BufRead *.ru setf ruby
|
||||
@@ -1439,6 +1452,9 @@ au BufNewFile,BufRead *.builder,*.rxml,*.rjs setf ruby
|
||||
" Rantfile and Rakefile is like Ruby
|
||||
au BufNewFile,BufRead [rR]antfile,*.rant,[rR]akefile,*.rake setf ruby
|
||||
|
||||
" Rust
|
||||
au BufNewFile,BufRead *.rs setf rust
|
||||
|
||||
" S-lang (or shader language, or SmallLisp)
|
||||
au BufNewFile,BufRead *.sl setf slang
|
||||
|
||||
@@ -1475,6 +1491,9 @@ au BufNewFile,BufRead *.sdl,*.pr setf sdl
|
||||
" sed
|
||||
au BufNewFile,BufRead *.sed setf sed
|
||||
|
||||
" svelte
|
||||
au BufNewFile,BufRead *.svelte setf svelte
|
||||
|
||||
" Sieve (RFC 3028, 5228)
|
||||
au BufNewFile,BufRead *.siv,*.sieve setf sieve
|
||||
|
||||
@@ -1731,8 +1750,13 @@ au BufNewFile,BufRead *.tli setf tli
|
||||
" Telix Salt
|
||||
au BufNewFile,BufRead *.slt setf tsalt
|
||||
|
||||
" Tera Term Language
|
||||
au BufRead,BufNewFile *.ttl setf teraterm
|
||||
" Tera Term Language or Turtle
|
||||
au BufRead,BufNewFile *.ttl
|
||||
\ if getline(1) =~ '^@\?\(prefix\|base\)' |
|
||||
\ setf turtle |
|
||||
\ else |
|
||||
\ setf teraterm |
|
||||
\ endif
|
||||
|
||||
" Terminfo
|
||||
au BufNewFile,BufRead *.ti setf terminfo
|
||||
|
||||
@@ -159,40 +159,41 @@ if exists("g:ada_abbrev")
|
||||
endif
|
||||
|
||||
" Section: Commands, Mapping, Menus {{{1
|
||||
"
|
||||
call ada#Map_Popup (
|
||||
\ 'Tag.List',
|
||||
\ 'l',
|
||||
\ 'call ada#List_Tag ()')
|
||||
call ada#Map_Popup (
|
||||
\'Tag.Jump',
|
||||
\'j',
|
||||
\'call ada#Jump_Tag ()')
|
||||
call ada#Map_Menu (
|
||||
\'Tag.Create File',
|
||||
\':AdaTagFile',
|
||||
\'call ada#Create_Tags (''file'')')
|
||||
call ada#Map_Menu (
|
||||
\'Tag.Create Dir',
|
||||
\':AdaTagDir',
|
||||
\'call ada#Create_Tags (''dir'')')
|
||||
if !exists(':AdaTagFile')
|
||||
call ada#Map_Popup (
|
||||
\ 'Tag.List',
|
||||
\ 'l',
|
||||
\ 'call ada#List_Tag ()')
|
||||
call ada#Map_Popup (
|
||||
\'Tag.Jump',
|
||||
\'j',
|
||||
\'call ada#Jump_Tag ()')
|
||||
call ada#Map_Menu (
|
||||
\'Tag.Create File',
|
||||
\':AdaTagFile',
|
||||
\'call ada#Create_Tags (''file'')')
|
||||
call ada#Map_Menu (
|
||||
\'Tag.Create Dir',
|
||||
\':AdaTagDir',
|
||||
\'call ada#Create_Tags (''dir'')')
|
||||
|
||||
call ada#Map_Menu (
|
||||
\'Highlight.Toggle Space Errors',
|
||||
\ ':AdaSpaces',
|
||||
\'call ada#Switch_Syntax_Option (''space_errors'')')
|
||||
call ada#Map_Menu (
|
||||
\'Highlight.Toggle Lines Errors',
|
||||
\ ':AdaLines',
|
||||
\'call ada#Switch_Syntax_Option (''line_errors'')')
|
||||
call ada#Map_Menu (
|
||||
\'Highlight.Toggle Rainbow Color',
|
||||
\ ':AdaRainbow',
|
||||
\'call ada#Switch_Syntax_Option (''rainbow_color'')')
|
||||
call ada#Map_Menu (
|
||||
\'Highlight.Toggle Standard Types',
|
||||
\ ':AdaTypes',
|
||||
\'call ada#Switch_Syntax_Option (''standard_types'')')
|
||||
call ada#Map_Menu (
|
||||
\'Highlight.Toggle Space Errors',
|
||||
\ ':AdaSpaces',
|
||||
\'call ada#Switch_Syntax_Option (''space_errors'')')
|
||||
call ada#Map_Menu (
|
||||
\'Highlight.Toggle Lines Errors',
|
||||
\ ':AdaLines',
|
||||
\'call ada#Switch_Syntax_Option (''line_errors'')')
|
||||
call ada#Map_Menu (
|
||||
\'Highlight.Toggle Rainbow Color',
|
||||
\ ':AdaRainbow',
|
||||
\'call ada#Switch_Syntax_Option (''rainbow_color'')')
|
||||
call ada#Map_Menu (
|
||||
\'Highlight.Toggle Standard Types',
|
||||
\ ':AdaTypes',
|
||||
\'call ada#Switch_Syntax_Option (''standard_types'')')
|
||||
endif
|
||||
|
||||
" 1}}}
|
||||
" Reset cpoptions
|
||||
|
||||
27
runtime/ftplugin/basic.vim
Normal file
27
runtime/ftplugin/basic.vim
Normal file
@@ -0,0 +1,27 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: BASIC
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2015 Jan 10
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal comments=:REM,:'
|
||||
setlocal commentstring='\ %s
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "BASIC Source Files (*.bas)\t*.bas\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setl fo< com< cms< sua<" .
|
||||
\ " | unlet! b:browsefilter"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Bazel (http://bazel.io)
|
||||
" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl)
|
||||
" Last Change: 2015 Aug 11
|
||||
" Last Change: 2021 Jan 19
|
||||
|
||||
""
|
||||
" @section Introduction, intro
|
||||
@@ -51,6 +51,8 @@ if get(g:, 'ft_bzl_fold', 0)
|
||||
endif
|
||||
|
||||
if exists('*BzlFoldText')
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Clojure
|
||||
" Author: Meikel Brandmeyer <mb@kotka.de>
|
||||
"
|
||||
" Maintainer: Sung Pae <self@sungpae.com>
|
||||
" URL: https://github.com/guns/vim-clojure-static
|
||||
" License: Same as Vim
|
||||
" Last Change: 18 July 2016
|
||||
" Language: Clojure
|
||||
" Maintainer: Alex Vear <av@axvr.io>
|
||||
" Former Maintainers: Sung Pae <self@sungpae.com>
|
||||
" Meikel Brandmeyer <mb@kotka.de>
|
||||
" URL: https://github.com/clojure-vim/clojure.vim
|
||||
" License: Vim (see :h license)
|
||||
" Last Change: 2021-02-13
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -43,7 +43,7 @@ setlocal commentstring=;\ %s
|
||||
" specially and hence are not indented specially.
|
||||
"
|
||||
" -*- LISPWORDS -*-
|
||||
" Generated from https://github.com/guns/vim-clojure-static/blob/vim-release-011/clj/src/vim_clojure_static/generate.clj
|
||||
" Generated from https://github.com/clojure-vim/clojure.vim/blob/f8594e7030cdfb0b7990ac92953c77a08a7220f0/clj/src/vim_clojure_static/generate.clj
|
||||
setlocal lispwords=as->,binding,bound-fn,case,catch,cond->,cond->>,condp,def,definline,definterface,defmacro,defmethod,defmulti,defn,defn-,defonce,defprotocol,defrecord,defstruct,deftest,deftest-,deftype,doseq,dotimes,doto,extend,extend-protocol,extend-type,fn,for,if,if-let,if-not,if-some,let,letfn,locking,loop,ns,proxy,reify,set-test,testing,when,when-first,when-let,when-not,when-some,while,with-bindings,with-in-str,with-local-vars,with-open,with-precision,with-redefs,with-redefs-fn,with-test
|
||||
|
||||
" Provide insert mode completions for special forms and clojure.core. As
|
||||
@@ -57,21 +57,6 @@ for s:setting in ['omnifunc', 'completefunc']
|
||||
endif
|
||||
endfor
|
||||
|
||||
" Take all directories of the CLOJURE_SOURCE_DIRS environment variable
|
||||
" and add them to the path option.
|
||||
"
|
||||
" This is a legacy option for VimClojure users.
|
||||
if exists('$CLOJURE_SOURCE_DIRS')
|
||||
for s:dir in split($CLOJURE_SOURCE_DIRS, (has("win32") || has("win64")) ? ';' : ':')
|
||||
let s:dir = fnameescape(s:dir)
|
||||
" Whitespace escaping for Windows
|
||||
let s:dir = substitute(s:dir, '\', '\\\\', 'g')
|
||||
let s:dir = substitute(s:dir, '\ ', '\\ ', 'g')
|
||||
execute "setlocal path+=" . s:dir . "/**"
|
||||
endfor
|
||||
let b:undo_ftplugin .= ' | setlocal path<'
|
||||
endif
|
||||
|
||||
" Skip brackets in ignored syntax regions when using the % command
|
||||
if exists('loaded_matchit')
|
||||
let b:match_words = &matchpairs
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2008-07-19
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo< inc< | unlet! b:matchwords"
|
||||
|
||||
setlocal comments=s1:/*,mb:*,ex:*/,:// commentstring=/*\ %s\ */
|
||||
|
||||
13
runtime/ftplugin/freebasic.vim
Normal file
13
runtime/ftplugin/freebasic.vim
Normal file
@@ -0,0 +1,13 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: FreeBasic
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2015 Jan 10
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
runtime! ftplugin/basic.vim
|
||||
|
||||
" vim: ts=8
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: Hamster Script
|
||||
" Version: 2.0.6.0
|
||||
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
|
||||
" Last Change: 2017 Mar 18
|
||||
" Last Change: 2021 Jan 19
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -57,6 +57,9 @@ if exists("loaded_matchit")
|
||||
endif
|
||||
|
||||
setlocal ignorecase
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
setlocal cpo+=M " makes \%( match \)
|
||||
|
||||
" Disabled, 'cpo' is a global option.
|
||||
" setlocal cpo+=M " makes \%( match \)
|
||||
|
||||
@@ -14,13 +14,11 @@ endif
|
||||
" Don't load another plugin for this buffer
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setl comments=:;
|
||||
setl comments=:;;;;,:;;;,:;;,:;,sr:#\|,mb:\|,ex:\|#
|
||||
setl define=^\\s*(def\\k*
|
||||
setl formatoptions-=t
|
||||
setl iskeyword+=+,-,*,/,%,<,=,>,:,$,?,!,@-@,94
|
||||
setl lisp
|
||||
setl commentstring=;%s
|
||||
|
||||
setl comments^=:;;;,:;;,sr:#\|,mb:\|,ex:\|#
|
||||
|
||||
let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp< commentstring<"
|
||||
|
||||
@@ -159,6 +159,8 @@ let b:undo_ftplugin = "setlocal efm< foldmethod< foldexpr<"
|
||||
" - Only definitions below, executed once -------------------------------------
|
||||
|
||||
if exists("*OMLetFoldLevel")
|
||||
let &cpoptions = s:cposet
|
||||
unlet s:cposet
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -635,7 +637,7 @@ endfunction
|
||||
nnoremap <silent> <Plug>OCamlPrintType :<C-U>call Ocaml_print_type("normal")<CR>
|
||||
xnoremap <silent> <Plug>OCamlPrintType :<C-U>call Ocaml_print_type("visual")<CR>`<
|
||||
|
||||
let &cpoptions=s:cposet
|
||||
let &cpoptions = s:cposet
|
||||
unlet s:cposet
|
||||
|
||||
" vim:sw=2 fdm=indent
|
||||
|
||||
32
runtime/ftplugin/tidy.vim
Normal file
32
runtime/ftplugin/tidy.vim
Normal file
@@ -0,0 +1,32 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: HMTL Tidy Configuration
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2020 Sep 4
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal comments=:#,://
|
||||
setlocal commentstring=#\ %s
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "HTML Tidy Files (tidyrc, .tidyrc, tidy.conf)\ttidyrc;.tidyrc;tidy.conf\n" .
|
||||
\ "HTML Files (*.html, *.htm)\t*.html;*.htm\n" .
|
||||
\ "XHTML Files (*.xhtml, *.xhtm)\t*.xhtml;*.xhtm\n" .
|
||||
\ "XML Files (*.xml)\t*.xml\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setl fo< com< cms<" .
|
||||
\ " | unlet! b:browsefilter"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Vim
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2021 Jan 05
|
||||
" Last Change: 2021 Feb 20
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -51,12 +51,12 @@ setlocal keywordprg=:help
|
||||
if "\n" .. getline(1, 10)->join("\n") =~# '\n\s*vim9\%[script]\>'
|
||||
" Set 'comments' to format dashed lists in comments
|
||||
setlocal com=sO:#\ -,mO:#\ \ ,eO:##,:#
|
||||
" Comments start with a double quote in a legacy script;
|
||||
" with # in a Vim9 script
|
||||
setlocal commentstring=\"%s
|
||||
else
|
||||
setlocal com=sO:\"\ -,mO:\"\ \ ,:\"
|
||||
" Comments starts with # in Vim9 script
|
||||
setlocal commentstring=#%s
|
||||
else
|
||||
setlocal com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"
|
||||
" Comments starts with a double quote in legacy script
|
||||
setlocal commentstring=\"%s
|
||||
endif
|
||||
|
||||
|
||||
@@ -88,8 +88,13 @@ endif
|
||||
" Let the matchit plugin know what items can be matched.
|
||||
if exists("loaded_matchit")
|
||||
let b:match_ignorecase = 0
|
||||
" "func" can also be used as a type:
|
||||
" var Ref: func
|
||||
" or to list functions:
|
||||
" func name
|
||||
" require a parenthesis following, then there can be an "endfunc".
|
||||
let b:match_words =
|
||||
\ '\<\%(fu\%[nction]\|def\)\>)\@!:\<retu\%[rn]\>:\<\%(endf\%[unction]\|enddef\)\>,' .
|
||||
\ '\<\%(fu\%[nction]\|def\)!\=\s\+\S\+(:\<retu\%[rn]\>:\<\%(endf\%[unction]\|enddef\)\>,' .
|
||||
\ '\<\(wh\%[ile]\|for\)\>:\<brea\%[k]\>:\<con\%[tinue]\>:\<end\(w\%[hile]\|fo\%[r]\)\>,' .
|
||||
\ '\<if\>:\<el\%[seif]\>:\<en\%[dif]\>,' .
|
||||
\ '{:},' .
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
" Vim indent file
|
||||
" Language: Clojure
|
||||
" Author: Meikel Brandmeyer <mb@kotka.de>
|
||||
" URL: http://kotka.de/projects/clojure/vimclojure.html
|
||||
"
|
||||
" Maintainer: Sung Pae <self@sungpae.com>
|
||||
" URL: https://github.com/guns/vim-clojure-static
|
||||
" License: Same as Vim
|
||||
" Last Change: 18 July 2016
|
||||
" Language: Clojure
|
||||
" Maintainer: Alex Vear <av@axvr.io>
|
||||
" Former Maintainers: Sung Pae <self@sungpae.com>
|
||||
" Meikel Brandmeyer <mb@kotka.de>
|
||||
" URL: https://github.com/clojure-vim/clojure.vim
|
||||
" License: Vim (see :h license)
|
||||
" Last Change: 2021-02-13
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
@@ -87,7 +86,7 @@ if exists("*searchpairpos")
|
||||
function! s:match_pairs(open, close, stopat)
|
||||
" Stop only on vector and map [ resp. {. Ignore the ones in strings and
|
||||
" comments.
|
||||
if a:stopat == 0
|
||||
if a:stopat == 0 && g:clojure_maxlines > 0
|
||||
let stopat = max([line(".") - g:clojure_maxlines, 0])
|
||||
else
|
||||
let stopat = a:stopat
|
||||
@@ -121,7 +120,7 @@ if exists("*searchpairpos")
|
||||
if s:syn_id_name() !~? "string"
|
||||
return -1
|
||||
endif
|
||||
if s:current_char() != '\\'
|
||||
if s:current_char() != '\'
|
||||
return -1
|
||||
endif
|
||||
call cursor(0, col("$") - 1)
|
||||
@@ -170,7 +169,35 @@ if exists("*searchpairpos")
|
||||
|
||||
call search('\S', 'W')
|
||||
let w = s:strip_namespace_and_macro_chars(s:current_word())
|
||||
|
||||
if g:clojure_special_indent_words =~# '\V\<' . w . '\>'
|
||||
|
||||
" `letfn` is a special-special-case.
|
||||
if w ==# 'letfn'
|
||||
" Earlier code left the cursor at:
|
||||
" (letfn [...] ...)
|
||||
" ^
|
||||
|
||||
" Search and get coordinates of first `[`
|
||||
" (letfn [...] ...)
|
||||
" ^
|
||||
call search('\[', 'W')
|
||||
let pos = getcurpos()
|
||||
let letfn_bracket = [pos[1], pos[2]]
|
||||
|
||||
" Move cursor to start of the form this function was
|
||||
" initially called on. Grab the coordinates of the
|
||||
" closest outer `[`.
|
||||
call cursor(a:position)
|
||||
let outer_bracket = s:match_pairs('\[', '\]', 0)
|
||||
|
||||
" If the located square brackets are not the same,
|
||||
" don't use special-case formatting.
|
||||
if outer_bracket != letfn_bracket
|
||||
return 0
|
||||
endif
|
||||
endif
|
||||
|
||||
return 1
|
||||
endif
|
||||
|
||||
@@ -190,11 +217,7 @@ if exists("*searchpairpos")
|
||||
" Check if form is a reader conditional, that is, it is prefixed by #?
|
||||
" or @#?
|
||||
function! s:is_reader_conditional_special_case(position)
|
||||
if getline(a:position[0])[a:position[1] - 3 : a:position[1] - 2] == "#?"
|
||||
return 1
|
||||
endif
|
||||
|
||||
return 0
|
||||
return getline(a:position[0])[a:position[1] - 3 : a:position[1] - 2] == "#?"
|
||||
endfunction
|
||||
|
||||
" Returns 1 for opening brackets, -1 for _anything else_.
|
||||
@@ -261,7 +284,7 @@ if exists("*searchpairpos")
|
||||
call cursor(paren)
|
||||
|
||||
if s:is_method_special_case(paren)
|
||||
return [paren[0], paren[1] + shiftwidth() - 1]
|
||||
return [paren[0], paren[1] + &shiftwidth - 1]
|
||||
endif
|
||||
|
||||
if s:is_reader_conditional_special_case(paren)
|
||||
@@ -292,6 +315,19 @@ if exists("*searchpairpos")
|
||||
return paren
|
||||
endif
|
||||
|
||||
" If the keyword begins with #, check if it is an anonymous
|
||||
" function or set, in which case we indent by the shiftwidth
|
||||
" (minus one if g:clojure_align_subforms = 1), or if it is
|
||||
" ignored, in which case we use the ( position for indent.
|
||||
if w[0] == "#"
|
||||
" TODO: Handle #=() and other rare reader invocations?
|
||||
if w[1] == '(' || w[1] == '{'
|
||||
return [paren[0], paren[1] + (g:clojure_align_subforms ? 0 : &shiftwidth - 1)]
|
||||
elseif w[1] == '_'
|
||||
return paren
|
||||
endif
|
||||
endif
|
||||
|
||||
" Test words without namespace qualifiers and leading reader macro
|
||||
" metacharacters.
|
||||
"
|
||||
@@ -299,19 +335,19 @@ if exists("*searchpairpos")
|
||||
let ww = s:strip_namespace_and_macro_chars(w)
|
||||
|
||||
if &lispwords =~# '\V\<' . ww . '\>'
|
||||
return [paren[0], paren[1] + shiftwidth() - 1]
|
||||
return [paren[0], paren[1] + &shiftwidth - 1]
|
||||
endif
|
||||
|
||||
if g:clojure_fuzzy_indent
|
||||
\ && !s:match_one(g:clojure_fuzzy_indent_blacklist, ww)
|
||||
\ && s:match_one(g:clojure_fuzzy_indent_patterns, ww)
|
||||
return [paren[0], paren[1] + shiftwidth() - 1]
|
||||
return [paren[0], paren[1] + &shiftwidth - 1]
|
||||
endif
|
||||
|
||||
call search('\v\_s', 'cW')
|
||||
call search('\v\S', 'W')
|
||||
if paren[0] < line(".")
|
||||
return [paren[0], paren[1] + (g:clojure_align_subforms ? 0 : shiftwidth() - 1)]
|
||||
return [paren[0], paren[1] + (g:clojure_align_subforms ? 0 : &shiftwidth - 1)]
|
||||
endif
|
||||
|
||||
call search('\v\S', 'bW')
|
||||
|
||||
@@ -74,11 +74,15 @@ endif
|
||||
if (b:fortran_fixed_source == 1)
|
||||
setlocal indentexpr=FortranGetFixedIndent()
|
||||
if exists("*FortranGetFixedIndent")
|
||||
let &cpoptions = s:cposet
|
||||
unlet s:cposet
|
||||
finish
|
||||
endif
|
||||
else
|
||||
setlocal indentexpr=FortranGetFreeIndent()
|
||||
if exists("*FortranGetFreeIndent")
|
||||
let &cpoptions = s:cposet
|
||||
unlet s:cposet
|
||||
finish
|
||||
endif
|
||||
endif
|
||||
@@ -213,7 +217,7 @@ function FortranGetFixedIndent()
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
let &cpoptions=s:cposet
|
||||
let &cpoptions = s:cposet
|
||||
unlet s:cposet
|
||||
|
||||
" vim:sw=2 tw=130
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim indent script for HTML
|
||||
" Maintainer: Bram Moolenaar
|
||||
" Original Author: Andy Wokula <anwoku@yahoo.de>
|
||||
" Last Change: 2020 Dec 11
|
||||
" Last Change: 2021 Jan 26
|
||||
" Version: 1.0 "{{{
|
||||
" Description: HTML indent script with cached state for faster indenting on a
|
||||
" range of lines.
|
||||
@@ -941,11 +941,11 @@ func! s:InsideTag(foundHtmlString)
|
||||
let idx = match(text, '<' . s:tagname . '\s\+\zs\w')
|
||||
endif
|
||||
if idx == -1
|
||||
" after just "<tag" indent one level more
|
||||
" after just "<tag" indent two levels more
|
||||
let idx = match(text, '<' . s:tagname . '$')
|
||||
if idx >= 0
|
||||
call cursor(lnum, idx)
|
||||
return virtcol('.') + shiftwidth()
|
||||
call cursor(lnum, idx + 1)
|
||||
return virtcol('.') - 1 + shiftwidth() * 2
|
||||
endif
|
||||
endif
|
||||
if idx > 0
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
" Previous Maintainer: Nikolai Weibull <now at bitwi.se>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2019 Dec 08
|
||||
|
||||
" 0. Initialization {{{1
|
||||
" =================
|
||||
@@ -27,7 +26,12 @@ endif
|
||||
|
||||
if !exists('g:ruby_indent_block_style')
|
||||
" Possible values: "expression", "do"
|
||||
let g:ruby_indent_block_style = 'expression'
|
||||
let g:ruby_indent_block_style = 'do'
|
||||
endif
|
||||
|
||||
if !exists('g:ruby_indent_hanging_elements')
|
||||
" Non-zero means hanging indents are enabled, zero means disabled
|
||||
let g:ruby_indent_hanging_elements = 1
|
||||
endif
|
||||
|
||||
setlocal nosmartindent
|
||||
@@ -322,7 +326,11 @@ function! s:ClosingBracketOnEmptyLine(cline_info) abort
|
||||
|
||||
if searchpair(escape(bracket_pair[0], '\['), '', bracket_pair[1], 'bW', s:skip_expr) > 0
|
||||
if closing_bracket == ')' && col('.') != col('$') - 1
|
||||
let ind = virtcol('.') - 1
|
||||
if g:ruby_indent_hanging_elements
|
||||
let ind = virtcol('.') - 1
|
||||
else
|
||||
let ind = indent(line('.'))
|
||||
end
|
||||
elseif g:ruby_indent_block_style == 'do'
|
||||
let ind = indent(line('.'))
|
||||
else " g:ruby_indent_block_style == 'expression'
|
||||
@@ -547,7 +555,9 @@ function! s:AfterUnbalancedBracket(pline_info) abort
|
||||
let [opening, closing] = s:ExtraBrackets(info.plnum)
|
||||
|
||||
if opening.pos != -1
|
||||
if opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
|
||||
if !g:ruby_indent_hanging_elements
|
||||
return indent(info.plnum) + info.sw
|
||||
elseif opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
|
||||
if col('.') + 1 == col('$')
|
||||
return indent(info.plnum) + info.sw
|
||||
else
|
||||
@@ -632,8 +642,7 @@ function! s:PreviousNotMSL(msl_info) abort
|
||||
" TODO (2016-10-07) Wrong/unused? How could it be "1"?
|
||||
return indent(info.plnum) - 1
|
||||
" If previous line is a continuation return its indent.
|
||||
" TODO: the || s:IsInString() thing worries me a bit.
|
||||
elseif s:Match(info.plnum, s:non_bracket_continuation_regex) || s:IsInString(info.plnum, strlen(line))
|
||||
elseif s:Match(info.plnum, s:non_bracket_continuation_regex)
|
||||
return indent(info.plnum)
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -19,7 +19,7 @@ div#d2 { color: green; }
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="foo bar">
|
||||
class="foo bar">
|
||||
text
|
||||
</div>
|
||||
|
||||
|
||||
@@ -10,6 +10,26 @@ let cmd =
|
||||
\ 'some '
|
||||
\ 'string'
|
||||
|
||||
if 1
|
||||
let x = [
|
||||
\ ]
|
||||
endif
|
||||
|
||||
" TODO: add searchpair() to find matching {
|
||||
"for x in [
|
||||
"{
|
||||
"key: 'value'
|
||||
"},
|
||||
"]
|
||||
"eval 0
|
||||
"endfor
|
||||
|
||||
for x in [
|
||||
{key: 'value'},
|
||||
]
|
||||
eval 0
|
||||
endfor
|
||||
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
|
||||
@@ -10,6 +10,26 @@ let cmd =
|
||||
\ 'some '
|
||||
\ 'string'
|
||||
|
||||
if 1
|
||||
let x = [
|
||||
\ ]
|
||||
endif
|
||||
|
||||
" TODO: add searchpair() to find matching {
|
||||
"for x in [
|
||||
"{
|
||||
"key: 'value'
|
||||
"},
|
||||
"]
|
||||
"eval 0
|
||||
"endfor
|
||||
|
||||
for x in [
|
||||
{key: 'value'},
|
||||
]
|
||||
eval 0
|
||||
endfor
|
||||
|
||||
" END_INDENT
|
||||
|
||||
" START_INDENT
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: Vim script
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2021 Jan 06
|
||||
" Last Change: 2021 Feb 18
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
@@ -38,6 +38,9 @@ function GetVimIndentIntern()
|
||||
" Find a non-blank line above the current line.
|
||||
let lnum = prevnonblank(v:lnum - 1)
|
||||
|
||||
" The previous line, ignoring line continuation
|
||||
let prev_text_end = lnum > 0 ? getline(lnum) : ''
|
||||
|
||||
" If the current line doesn't start with '\' or '"\ ' and below a line that
|
||||
" starts with '\' or '"\ ', use the indent of the line above it.
|
||||
let cur_text = getline(v:lnum)
|
||||
@@ -51,6 +54,8 @@ function GetVimIndentIntern()
|
||||
if lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
" the start of the previous line, skipping over line continuation
|
||||
let prev_text = getline(lnum)
|
||||
let found_cont = 0
|
||||
|
||||
@@ -94,7 +99,9 @@ function GetVimIndentIntern()
|
||||
let ind = ind + shiftwidth()
|
||||
else
|
||||
" A line starting with :au does not increment/decrement indent.
|
||||
if prev_text !~ '^\s*au\%[tocmd]'
|
||||
" A { may start a block or a dict. Assume that when a } follows it's a
|
||||
" terminated dict.
|
||||
if prev_text !~ '^\s*au\%[tocmd]' && prev_text !~ '^\s*{.*}'
|
||||
let i = match(prev_text, '\(^\||\)\s*\(export\s\+\)\?\({\|\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\|finall\%[y]\|fu\%[nction]\|def\|el\%[seif]\)\>\)')
|
||||
if i >= 0
|
||||
let ind += shiftwidth()
|
||||
@@ -147,13 +154,17 @@ function GetVimIndentIntern()
|
||||
endif
|
||||
|
||||
" Below a line starting with "]" we must be below the end of a list.
|
||||
if prev_text =~ '^\s*]'
|
||||
" Include a "}" and "},} in case a dictionary ends too.
|
||||
if prev_text_end =~ '^\s*\(},\=\s*\)\=]'
|
||||
let ind = ind - shiftwidth()
|
||||
endif
|
||||
|
||||
" A line ending in "{"/"[} is most likely the start of a dict/list literal,
|
||||
" indent the next line more. Not for a continuation line.
|
||||
if prev_text =~ '[{[]\s*$' && !found_cont
|
||||
let ends_in_comment = has('syntax_items')
|
||||
\ && synIDattr(synID(lnum, len(getline(lnum)), 1), "name") =~ '\(Comment\|String\)$'
|
||||
|
||||
" A line ending in "{" or "[" is most likely the start of a dict/list literal,
|
||||
" indent the next line more. Not for a continuation line or {{{.
|
||||
if !ends_in_comment && prev_text_end =~ '\s[{[]\s*$' && !found_cont
|
||||
let ind = ind + shiftwidth()
|
||||
endif
|
||||
|
||||
|
||||
@@ -2,16 +2,13 @@
|
||||
" Language: YAML
|
||||
" Maintainer: Nikolai Pavlov <zyx.vim@gmail.com>
|
||||
" Last Update: Lukas Reineke
|
||||
" Last Change: 2020 Jun 07
|
||||
" Last Change: 2021 Jan 19
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetYAMLIndent(v:lnum)
|
||||
@@ -25,6 +22,9 @@ if exists('*GetYAMLIndent')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function s:FindPrevLessIndentedLine(lnum, ...)
|
||||
let prevlnum = prevnonblank(a:lnum-1)
|
||||
let curindent = a:0 ? a:1 : indent(a:lnum)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types in scripts
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last change: 2020 Aug 15
|
||||
" Last change: 2021 Jan 22
|
||||
|
||||
" This file is called by an autocommand for every file that has just been
|
||||
" loaded into a buffer. It checks if the type of file can be recognized by
|
||||
@@ -186,6 +186,10 @@ if s:line1 =~# "^#!"
|
||||
elseif s:name =~# 'instantfpc\>'
|
||||
set ft=pascal
|
||||
|
||||
" Fennel
|
||||
elseif s:name =~# 'fennel\>'
|
||||
set ft=fennel
|
||||
|
||||
endif
|
||||
unlet s:name
|
||||
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
" Vim syntax file
|
||||
" Language: BASIC
|
||||
" Maintainer: Allan Kelly <allan@fruitloaf.co.uk>
|
||||
" Last Change: 2011 Dec 25 by Thilo Six
|
||||
" Language: BASIC
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Allan Kelly <allan@fruitloaf.co.uk>
|
||||
" Contributors: Thilo Six
|
||||
" Last Change: 2015 Jan 10
|
||||
|
||||
" First version based on Micro$soft QBASIC circa 1989, as documented in
|
||||
" 'Learn BASIC Now' by Halvorson&Rygmyr. Microsoft Press 1989.
|
||||
" This syntax file not a complete implementation yet. Send suggestions to the
|
||||
" maintainer.
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
" Prelude {{{1
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
@@ -16,7 +18,7 @@ endif
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" A bunch of useful BASIC keywords
|
||||
" Keywords {{{1
|
||||
syn keyword basicStatement BEEP beep Beep BLOAD bload Bload BSAVE bsave Bsave
|
||||
syn keyword basicStatement CALL call Call ABSOLUTE absolute Absolute
|
||||
syn keyword basicStatement CHAIN chain Chain CHDIR chdir Chdir
|
||||
@@ -116,32 +118,39 @@ syn keyword basicFunction RIGHT$ right$ Right$ RTRIM$ rtrim$ Rtrim$
|
||||
syn keyword basicFunction SPACE$ space$ Space$ STR$ str$ Str$
|
||||
syn keyword basicFunction STRING$ string$ String$ TIME$ time$ Time$
|
||||
syn keyword basicFunction UCASE$ ucase$ Ucase$ VARPTR$ varptr$ Varptr$
|
||||
syn keyword basicTodo contained TODO
|
||||
|
||||
"integer number, or floating point number without a dot.
|
||||
" Numbers {{{1
|
||||
" Integer number, or floating point number without a dot.
|
||||
syn match basicNumber "\<\d\+\>"
|
||||
"floating point number, with dot
|
||||
" Floating point number, with dot
|
||||
syn match basicNumber "\<\d\+\.\d*\>"
|
||||
"floating point number, starting with a dot
|
||||
" Floating point number, starting with a dot
|
||||
syn match basicNumber "\.\d\+\>"
|
||||
|
||||
" String and Character contstants
|
||||
syn match basicSpecial contained "\\\d\d\d\|\\."
|
||||
syn region basicString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=basicSpecial
|
||||
" String and Character constants {{{1
|
||||
syn match basicSpecial "\\\d\d\d\|\\." contained
|
||||
syn region basicString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=basicSpecial
|
||||
|
||||
syn region basicComment start="REM" end="$" contains=basicTodo
|
||||
syn region basicComment start="^[ \t]*'" end="$" contains=basicTodo
|
||||
" Line numbers {{{1
|
||||
syn region basicLineNumber start="^\d" end="\s"
|
||||
syn match basicTypeSpecifier "[a-zA-Z0-9][\$%&!#]"ms=s+1
|
||||
|
||||
" Data-type suffixes {{{1
|
||||
syn match basicTypeSpecifier "[a-zA-Z0-9][$%&!#]"ms=s+1
|
||||
" Used with OPEN statement
|
||||
syn match basicFilenumber "#\d\+"
|
||||
"syn sync ccomment basicComment
|
||||
|
||||
" Mathematical operators {{{1
|
||||
" syn match basicMathsOperator "[<>+\*^/\\=-]"
|
||||
syn match basicMathsOperator "-\|=\|[:<>+\*^/\\]\|AND\|OR"
|
||||
syn match basicMathsOperator "-\|=\|[:<>+\*^/\\]\|AND\|OR"
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
" Comments {{{1
|
||||
syn keyword basicTodo TODO FIXME XXX NOTE contained
|
||||
syn region basicComment start="^\s*\zsREM\>" start="\%(:\s*\)\@<=REM\>" end="$" contains=basicTodo
|
||||
syn region basicComment start="'" end="$" contains=basicTodo
|
||||
|
||||
"syn sync ccomment basicComment
|
||||
|
||||
" Default Highlighting {{{1
|
||||
hi def link basicLabel Label
|
||||
hi def link basicConditional Conditional
|
||||
hi def link basicRepeat Repeat
|
||||
@@ -150,17 +159,18 @@ hi def link basicNumber Number
|
||||
hi def link basicError Error
|
||||
hi def link basicStatement Statement
|
||||
hi def link basicString String
|
||||
hi def link basicComment Comment
|
||||
hi def link basicSpecial Special
|
||||
hi def link basicComment Comment
|
||||
hi def link basicSpecial Special
|
||||
hi def link basicTodo Todo
|
||||
hi def link basicFunction Identifier
|
||||
hi def link basicTypeSpecifier Type
|
||||
hi def link basicFilenumber basicTypeSpecifier
|
||||
hi def link basicFunction Identifier
|
||||
hi def link basicTypeSpecifier Type
|
||||
hi def link basicFilenumber basicTypeSpecifier
|
||||
"hi basicMathsOperator term=bold cterm=bold gui=bold
|
||||
|
||||
|
||||
" Postscript {{{1
|
||||
let b:current_syntax = "basic"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
" vim: ts=8
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2020 Aug 28
|
||||
" Last Change: 2021 Jan 11
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -13,6 +13,9 @@ set cpo&vim
|
||||
|
||||
let s:ft = matchstr(&ft, '^\([^.]\)\+')
|
||||
|
||||
" check if this was included from cpp.vim
|
||||
let s:in_cpp_family = exists("b:filetype_in_cpp_family")
|
||||
|
||||
" Optional embedded Autodoc parsing
|
||||
" To enable it add: let g:c_autodoc = 1
|
||||
" to your .vimrc
|
||||
@@ -55,7 +58,7 @@ if !exists("c_no_cformat")
|
||||
endif
|
||||
|
||||
" cCppString: same as cString, but ends at end of line
|
||||
if s:ft ==# "cpp" && !exists("cpp_no_cpp11") && !exists("c_no_cformat")
|
||||
if s:in_cpp_family && !exists("cpp_no_cpp11") && !exists("c_no_cformat")
|
||||
" ISO C++11
|
||||
syn region cString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
|
||||
syn region cCppString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
|
||||
@@ -87,7 +90,7 @@ syn match cSpecialCharacter display "L\='\\\o\{1,3}'"
|
||||
syn match cSpecialCharacter display "'\\x\x\{1,2}'"
|
||||
syn match cSpecialCharacter display "L'\\x\x\+'"
|
||||
|
||||
if (s:ft ==# "c" && !exists("c_no_c11")) || (s:ft ==# "cpp" && !exists("cpp_no_cpp11"))
|
||||
if (s:ft ==# "c" && !exists("c_no_c11")) || (s:in_cpp_family && !exists("cpp_no_cpp11"))
|
||||
" ISO C11 or ISO C++ 11
|
||||
if exists("c_no_cformat")
|
||||
syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
|
||||
@@ -130,7 +133,7 @@ endif
|
||||
" But avoid matching <::.
|
||||
syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserLabel,cBitField,cOctalZero,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
|
||||
if exists("c_no_curly_error")
|
||||
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
||||
if s:in_cpp_family && !exists("cpp_no_cpp11")
|
||||
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell
|
||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
||||
@@ -144,7 +147,7 @@ if exists("c_no_curly_error")
|
||||
syn match cErrInParen display contained "^[{}]\|^<%\|^%>"
|
||||
endif
|
||||
elseif exists("c_no_bracket_error")
|
||||
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
||||
if s:in_cpp_family && !exists("cpp_no_cpp11")
|
||||
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell
|
||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
||||
@@ -158,7 +161,7 @@ elseif exists("c_no_bracket_error")
|
||||
syn match cErrInParen display contained "[{}]\|<%\|%>"
|
||||
endif
|
||||
else
|
||||
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
||||
if s:in_cpp_family && !exists("cpp_no_cpp11")
|
||||
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell
|
||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
|
||||
@@ -278,7 +281,7 @@ syn keyword cStorageClass static register auto volatile extern const
|
||||
if exists("c_gnu")
|
||||
syn keyword cStorageClass inline __attribute__
|
||||
endif
|
||||
if !exists("c_no_c99") && s:ft !=# 'cpp'
|
||||
if !exists("c_no_c99") && !s:in_cpp_family
|
||||
syn keyword cStorageClass inline restrict
|
||||
endif
|
||||
if !exists("c_no_c11")
|
||||
@@ -420,7 +423,7 @@ endif
|
||||
syn cluster cLabelGroup contains=cUserLabel
|
||||
syn match cUserCont display "^\s*\zs\I\i*\s*:$" contains=@cLabelGroup
|
||||
syn match cUserCont display ";\s*\zs\I\i*\s*:$" contains=@cLabelGroup
|
||||
if s:ft ==# 'cpp'
|
||||
if s:in_cpp_family
|
||||
syn match cUserCont display "^\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
|
||||
syn match cUserCont display ";\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
|
||||
else
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -2,13 +2,16 @@
|
||||
" Language: C++
|
||||
" Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
|
||||
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
|
||||
" Last Change: 2019 Dec 18
|
||||
" Last Change: 2021 Jan 12
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" inform C syntax that the file was included from cpp.vim
|
||||
let b:filetype_in_cpp_family = 1
|
||||
|
||||
" Read the C syntax to start with
|
||||
runtime! syntax/c.vim
|
||||
unlet b:current_syntax
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
" Language: Groovy
|
||||
" Original Author: Alessio Pace <billy.corgan AT tiscali.it>
|
||||
" Maintainer: Tobias Rapp <yahuxo+vim AT mailbox.org>
|
||||
" Version: 0.1.17
|
||||
" Version: 0.1.18
|
||||
" URL: http://www.vim.org/scripts/script.php?script_id=945
|
||||
" Last Change: 2020 May 26
|
||||
" Last Change: 2021 Feb 03
|
||||
|
||||
" THE ORIGINAL AUTHOR'S NOTES:
|
||||
"
|
||||
@@ -253,7 +253,8 @@ if exists("groovy_regex_strings")
|
||||
endif
|
||||
" syn region groovyELExpr start=+${+ end=+}+ keepend contained
|
||||
syn match groovyELExpr /\${.\{-}}/ contained
|
||||
syn match groovyELExpr /\$[a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE_][a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE0-9_.]*/ contained
|
||||
" Fix: force use of the NFA regexp engine (2), see GitHub issue #7280
|
||||
syn match groovyELExpr /\%#=2\$[a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE_][a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE0-9_.]*/ contained
|
||||
hi def link groovyELExpr Identifier
|
||||
|
||||
" TODO: better matching. I am waiting to understand how it really works in groovy
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
" Vim syntax file
|
||||
" Language: HTML
|
||||
" Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
|
||||
" Previous Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
|
||||
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
|
||||
" Repository: https://notabug.org/jorgesumle/vim-html-syntax
|
||||
" Last Change: 2020 Mar 17
|
||||
" Included patch from Florian Breisch to add the summary element
|
||||
" Last Change: 2021 Feb 25
|
||||
" Included patch #7900 to fix comments
|
||||
"
|
||||
|
||||
" Please check :help html.vim for some comments and a description of the options
|
||||
@@ -141,9 +141,21 @@ syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
|
||||
if exists("html_wrong_comments")
|
||||
syn region htmlComment start=+<!--+ end=+--\s*>+ contains=@Spell
|
||||
else
|
||||
syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentPart,htmlCommentError,@Spell
|
||||
syn match htmlCommentError contained "[^><!]"
|
||||
syn region htmlCommentPart contained start=+--+ end=+--\s*+ contains=@htmlPreProc,@Spell
|
||||
" The HTML 5.2 syntax 8.2.4.41-42: bogus comment is parser error; browser skips until next >
|
||||
" Note: must stand first to get lesser :syn-priority
|
||||
syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentError
|
||||
" Normal comment opening <!-- ...>
|
||||
syn region htmlComment start=+<!--+ end=+>+ contains=htmlCommentPart,@Spell
|
||||
" Idem 8.2.4.43-44: <!--> and <!---> are parser errors; browser treats as comments
|
||||
syn match htmlComment "<!---\?>" contains=htmlCommentError
|
||||
" Idem 8.2.4.51: any number of consecutive dashes within comment is okay; --> closes comment
|
||||
" Idem 8.2.4.52: closing comment by dash-dash-bang (--!>) is error ignored by parser(!); closes comment
|
||||
syn region htmlCommentPart contained start=+--+ end=+--!\?>+me=e-1 contains=htmlCommentNested,@htmlPreProc,@Spell
|
||||
" Idem 8.2.4.49: opening nested comment <!-- is parser error, ignored by browser, except <!--> is all right
|
||||
syn match htmlCommentNested contained "<!--[^>]"me=e-1
|
||||
syn match htmlCommentNested contained "<!--->"me=e-3
|
||||
syn match htmlCommentNested contained "<!---\?!>"me=e-4
|
||||
syn match htmlCommentError contained "[^><!]"
|
||||
endif
|
||||
syn region htmlComment start=+<!DOCTYPE+ keepend end=+>+
|
||||
|
||||
@@ -317,6 +329,7 @@ hi def link htmlStatement Statement
|
||||
hi def link htmlComment Comment
|
||||
hi def link htmlCommentPart Comment
|
||||
hi def link htmlValue String
|
||||
hi def link htmlCommentNested htmlCommentError
|
||||
hi def link htmlCommentError htmlError
|
||||
hi def link htmlTagError htmlError
|
||||
hi def link htmlEvent javaScript
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
" Vim syntax file
|
||||
" Language: Haskell with literate comments, Bird style,
|
||||
" TeX style and plain text surrounding
|
||||
" Markdown style, TeX style and plain text surrounding
|
||||
" \begin{code} \end{code} blocks
|
||||
" Maintainer: Haskell Cafe mailinglist <haskell-cafe@haskell.org>
|
||||
" Original Author: Arthur van Leeuwen <arthurvl@cs.uu.nl>
|
||||
" Last Change: 2010 Apr 11
|
||||
" Version: 1.04
|
||||
" Last Change: 2020 Feb 25
|
||||
" Version: 1.05
|
||||
"
|
||||
" Thanks to Ian Lynagh for thoughtful comments on initial versions and
|
||||
" for the inspiration for writing this in the first place.
|
||||
@@ -44,8 +44,8 @@ endif
|
||||
" First off, see if we can inherit a user preference for lhs_markup
|
||||
if !exists("b:lhs_markup")
|
||||
if exists("lhs_markup")
|
||||
if lhs_markup =~ '\<\%(tex\|none\)\>'
|
||||
let b:lhs_markup = matchstr(lhs_markup,'\<\%(tex\|none\)\>')
|
||||
if lhs_markup =~ '\<\%(tex\|md\|none\)\>'
|
||||
let b:lhs_markup = matchstr(lhs_markup,'\<\%(tex\|md\|none\)\>')
|
||||
else
|
||||
echohl WarningMsg | echo "Unknown value of lhs_markup" | echohl None
|
||||
let b:lhs_markup = "unknown"
|
||||
@@ -54,7 +54,7 @@ if !exists("b:lhs_markup")
|
||||
let b:lhs_markup = "unknown"
|
||||
endif
|
||||
else
|
||||
if b:lhs_markup !~ '\<\%(tex\|none\)\>'
|
||||
if b:lhs_markup !~ '\<\%(tex\|md\|none\)\>'
|
||||
let b:lhs_markup = "unknown"
|
||||
endif
|
||||
endif
|
||||
@@ -74,6 +74,8 @@ call cursor(1,1)
|
||||
if b:lhs_markup == "unknown"
|
||||
if search('\\documentclass\|\\begin{\(code}\)\@!\|\\\(sub\)*section\|\\chapter|\\part','W') != 0
|
||||
let b:lhs_markup = "tex"
|
||||
elseif search('```haskell','W') != 0
|
||||
let b:lhs_markup = "md"
|
||||
else
|
||||
let b:lhs_markup = "plain"
|
||||
endif
|
||||
@@ -86,6 +88,10 @@ if b:lhs_markup == "tex"
|
||||
" Tex.vim removes "_" from 'iskeyword', but we need it for Haskell.
|
||||
setlocal isk+=_
|
||||
syntax cluster lhsTeXContainer contains=tex.*Zone,texAbstract
|
||||
elseif b:lhs_markup == "md"
|
||||
runtime! syntax/markdown.vim
|
||||
unlet b:current_syntax
|
||||
syntax cluster lhsTeXContainer contains=markdown.*
|
||||
else
|
||||
syntax cluster lhsTeXContainer contains=.*
|
||||
endif
|
||||
@@ -96,9 +102,12 @@ syntax include @haskellTop syntax/haskell.vim
|
||||
|
||||
syntax region lhsHaskellBirdTrack start="^>" end="\%(^[^>]\)\@=" contains=@haskellTop,lhsBirdTrack containedin=@lhsTeXContainer
|
||||
syntax region lhsHaskellBeginEndBlock start="^\\begin{code}\s*$" matchgroup=NONE end="\%(^\\end{code}.*$\)\@=" contains=@haskellTop,beginCodeBegin containedin=@lhsTeXContainer
|
||||
syntax region lhsHaskellMDBlock start="^```haskell$" matchgroup=NONE end="^```$" keepend contains=@haskellTop,lhsMarkdownCode containedin=@lhsTeXContainer
|
||||
|
||||
syntax match lhsBirdTrack "^>" contained
|
||||
|
||||
syntax match lhsMarkdownCode "^\(```haskell\|^```\)$" contained
|
||||
|
||||
syntax match beginCodeBegin "^\\begin" nextgroup=beginCodeCode contained
|
||||
syntax region beginCodeCode matchgroup=texDelimiter start="{" end="}"
|
||||
|
||||
@@ -107,6 +116,8 @@ syntax region beginCodeCode matchgroup=texDelimiter start="{" end="}"
|
||||
|
||||
hi def link lhsBirdTrack Comment
|
||||
|
||||
hi def link lhsMarkdownCode Comment
|
||||
|
||||
hi def link beginCodeBegin texCmdName
|
||||
hi def link beginCodeCode texSection
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
" Latest Revision: 2008-06-29
|
||||
" Changes: 2008-06-29 support for RFC3339 tuimestamps James Vega
|
||||
" 2016 Jan 19: messagesDate changed by Bram
|
||||
" 2021 Jan 27: messagesHourRFC3339 changed from #946
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -26,7 +27,7 @@ syn match messagesDateRFC3339 contained display '\d\{4}-\d\d-\d\d'
|
||||
syn match messagesRFC3339T contained display '\cT'
|
||||
\ nextgroup=messagesHourRFC3339
|
||||
|
||||
syn match messagesHourRFC3339 contained display '\c\d\d:\d\d:\d\d\(\.\d\+\)\=\([+-]\d\d:\d\d\|Z\)'
|
||||
syn match messagesHourRFC3339 contained display '\c\d\d:\d\d:\d\d\(\.\d\+\)\=\([+-]\d\d:\d\d\|Z\)\s*'
|
||||
\ nextgroup=messagesHost
|
||||
|
||||
syn match messagesHost contained display '\S*\s*'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: Python
|
||||
" Maintainer: Zvezdan Petkovic <zpetkovic@acm.org>
|
||||
" Last Change: 2016 Oct 29
|
||||
" Last Change: 2021 Feb 15
|
||||
" Credits: Neil Schemenauer <nas@python.ca>
|
||||
" Dmitry Vasiliev
|
||||
"
|
||||
@@ -71,30 +71,17 @@ endif
|
||||
|
||||
" Keep Python keywords in alphabetical order inside groups for easy
|
||||
" comparison with the table in the 'Python Language Reference'
|
||||
" https://docs.python.org/2/reference/lexical_analysis.html#keywords,
|
||||
" https://docs.python.org/3/reference/lexical_analysis.html#keywords.
|
||||
" https://docs.python.org/reference/lexical_analysis.html#keywords.
|
||||
" Groups are in the order presented in NAMING CONVENTIONS in syntax.txt.
|
||||
" Exceptions come last at the end of each group (class and def below).
|
||||
"
|
||||
" Keywords 'with' and 'as' are new in Python 2.6
|
||||
" (use 'from __future__ import with_statement' in Python 2.5).
|
||||
" The list can be checked using:
|
||||
"
|
||||
" Some compromises had to be made to support both Python 3 and 2.
|
||||
" We include Python 3 features, but when a definition is duplicated,
|
||||
" the last definition takes precedence.
|
||||
"
|
||||
" - 'False', 'None', and 'True' are keywords in Python 3 but they are
|
||||
" built-ins in 2 and will be highlighted as built-ins below.
|
||||
" - 'exec' is a built-in in Python 3 and will be highlighted as
|
||||
" built-in below.
|
||||
" - 'nonlocal' is a keyword in Python 3 and will be highlighted.
|
||||
" - 'print' is a built-in in Python 3 and will be highlighted as
|
||||
" built-in below (use 'from __future__ import print_function' in 2)
|
||||
" - async and await were added in Python 3.5 and are soft keywords.
|
||||
" python3 -c 'import keyword, pprint; pprint.pprint(keyword.kwlist, compact=True)'
|
||||
"
|
||||
syn keyword pythonStatement False None True
|
||||
syn keyword pythonStatement as assert break continue del exec global
|
||||
syn keyword pythonStatement lambda nonlocal pass print return with yield
|
||||
syn keyword pythonStatement as assert break continue del global
|
||||
syn keyword pythonStatement lambda nonlocal pass return with yield
|
||||
syn keyword pythonStatement class def nextgroup=pythonFunction skipwhite
|
||||
syn keyword pythonConditional elif else if
|
||||
syn keyword pythonRepeat for while
|
||||
@@ -103,7 +90,7 @@ syn keyword pythonException except finally raise try
|
||||
syn keyword pythonInclude from import
|
||||
syn keyword pythonAsync async await
|
||||
|
||||
" Decorators (new in Python 2.4)
|
||||
" Decorators
|
||||
" A dot must be allowed because of @MyClass.myfunc decorators.
|
||||
syn match pythonDecorator "@" display contained
|
||||
syn match pythonDecoratorName "@\s*\h\%(\w\|\.\)*" display contains=pythonDecorator
|
||||
@@ -168,8 +155,7 @@ syn match pythonEscape "\\$"
|
||||
" - 08e0 or 08j are highlighted,
|
||||
"
|
||||
" and so on, as specified in the 'Python Language Reference'.
|
||||
" https://docs.python.org/2/reference/lexical_analysis.html#numeric-literals
|
||||
" https://docs.python.org/3/reference/lexical_analysis.html#numeric-literals
|
||||
" https://docs.python.org/reference/lexical_analysis.html#numeric-literals
|
||||
if !exists("python_no_number_highlight")
|
||||
" numbers (including longs and complex)
|
||||
syn match pythonNumber "\<0[oO]\=\o\+[Ll]\=\>"
|
||||
@@ -186,37 +172,37 @@ endif
|
||||
|
||||
" Group the built-ins in the order in the 'Python Library Reference' for
|
||||
" easier comparison.
|
||||
" https://docs.python.org/2/library/constants.html
|
||||
" https://docs.python.org/3/library/constants.html
|
||||
" http://docs.python.org/2/library/functions.html
|
||||
" http://docs.python.org/3/library/functions.html
|
||||
" http://docs.python.org/2/library/functions.html#non-essential-built-in-functions
|
||||
" http://docs.python.org/3/library/functions.html#non-essential-built-in-functions
|
||||
" https://docs.python.org/library/constants.html
|
||||
" http://docs.python.org/library/functions.html
|
||||
" Python built-in functions are in alphabetical order.
|
||||
"
|
||||
" The list can be checked using:
|
||||
"
|
||||
" python3 -c 'import builtins, pprint; pprint.pprint(dir(builtins), compact=True)'
|
||||
"
|
||||
" The constants added by the `site` module are not listed below because they
|
||||
" should not be used in programs, only in interactive interpreter.
|
||||
" Similarly for some other attributes and functions `__`-enclosed from the
|
||||
" output of the above command.
|
||||
"
|
||||
if !exists("python_no_builtin_highlight")
|
||||
" built-in constants
|
||||
" 'False', 'True', and 'None' are also reserved words in Python 3
|
||||
syn keyword pythonBuiltin False True None
|
||||
syn keyword pythonBuiltin NotImplemented Ellipsis __debug__
|
||||
" constants added by the `site` module
|
||||
syn keyword pythonBuiltin quit exit copyright credits license
|
||||
" built-in functions
|
||||
syn keyword pythonBuiltin abs all any bin bool bytearray callable chr
|
||||
syn keyword pythonBuiltin classmethod compile complex delattr dict dir
|
||||
syn keyword pythonBuiltin divmod enumerate eval filter float format
|
||||
syn keyword pythonBuiltin frozenset getattr globals hasattr hash
|
||||
syn keyword pythonBuiltin help hex id input int isinstance
|
||||
syn keyword pythonBuiltin abs all any ascii bin bool breakpoint bytearray
|
||||
syn keyword pythonBuiltin bytes callable chr classmethod compile complex
|
||||
syn keyword pythonBuiltin delattr dict dir divmod enumerate eval exec
|
||||
syn keyword pythonBuiltin filter float format frozenset getattr globals
|
||||
syn keyword pythonBuiltin hasattr hash help hex id input int isinstance
|
||||
syn keyword pythonBuiltin issubclass iter len list locals map max
|
||||
syn keyword pythonBuiltin memoryview min next object oct open ord pow
|
||||
syn keyword pythonBuiltin print property range repr reversed round set
|
||||
syn keyword pythonBuiltin setattr slice sorted staticmethod str
|
||||
syn keyword pythonBuiltin sum super tuple type vars zip __import__
|
||||
" Python 2 only
|
||||
syn keyword pythonBuiltin basestring cmp execfile file
|
||||
syn keyword pythonBuiltin long raw_input reduce reload unichr
|
||||
syn keyword pythonBuiltin unicode xrange
|
||||
" Python 3 only
|
||||
syn keyword pythonBuiltin ascii bytes exec
|
||||
" non-essential built-in functions; Python 2 only
|
||||
syn keyword pythonBuiltin apply buffer coerce intern
|
||||
syn keyword pythonBuiltin setattr slice sorted staticmethod str sum super
|
||||
syn keyword pythonBuiltin tuple type vars zip __import__
|
||||
" avoid highlighting attributes as builtins
|
||||
syn match pythonAttribute /\.\h\w*/hs=s+1
|
||||
\ contains=ALLBUT,pythonBuiltin,pythonFunction,pythonAsync
|
||||
@@ -224,28 +210,27 @@ if !exists("python_no_builtin_highlight")
|
||||
endif
|
||||
|
||||
" From the 'Python Library Reference' class hierarchy at the bottom.
|
||||
" http://docs.python.org/2/library/exceptions.html
|
||||
" http://docs.python.org/3/library/exceptions.html
|
||||
" http://docs.python.org/library/exceptions.html
|
||||
if !exists("python_no_exception_highlight")
|
||||
" builtin base exceptions (used mostly as base classes for other exceptions)
|
||||
syn keyword pythonExceptions BaseException Exception
|
||||
syn keyword pythonExceptions ArithmeticError BufferError
|
||||
syn keyword pythonExceptions LookupError
|
||||
" builtin base exceptions removed in Python 3
|
||||
syn keyword pythonExceptions EnvironmentError StandardError
|
||||
syn keyword pythonExceptions ArithmeticError BufferError LookupError
|
||||
" builtin exceptions (actually raised)
|
||||
syn keyword pythonExceptions AssertionError AttributeError
|
||||
syn keyword pythonExceptions EOFError FloatingPointError GeneratorExit
|
||||
syn keyword pythonExceptions ImportError IndentationError
|
||||
syn keyword pythonExceptions IndexError KeyError KeyboardInterrupt
|
||||
syn keyword pythonExceptions MemoryError NameError NotImplementedError
|
||||
syn keyword pythonExceptions OSError OverflowError ReferenceError
|
||||
syn keyword pythonExceptions RuntimeError StopIteration SyntaxError
|
||||
syn keyword pythonExceptions AssertionError AttributeError EOFError
|
||||
syn keyword pythonExceptions FloatingPointError GeneratorExit ImportError
|
||||
syn keyword pythonExceptions IndentationError IndexError KeyError
|
||||
syn keyword pythonExceptions KeyboardInterrupt MemoryError
|
||||
syn keyword pythonExceptions ModuleNotFoundError NameError
|
||||
syn keyword pythonExceptions NotImplementedError OSError OverflowError
|
||||
syn keyword pythonExceptions RecursionError ReferenceError RuntimeError
|
||||
syn keyword pythonExceptions StopAsyncIteration StopIteration SyntaxError
|
||||
syn keyword pythonExceptions SystemError SystemExit TabError TypeError
|
||||
syn keyword pythonExceptions UnboundLocalError UnicodeError
|
||||
syn keyword pythonExceptions UnicodeDecodeError UnicodeEncodeError
|
||||
syn keyword pythonExceptions UnboundLocalError UnicodeDecodeError
|
||||
syn keyword pythonExceptions UnicodeEncodeError UnicodeError
|
||||
syn keyword pythonExceptions UnicodeTranslateError ValueError
|
||||
syn keyword pythonExceptions ZeroDivisionError
|
||||
" builtin exception aliases for OSError
|
||||
syn keyword pythonExceptions EnvironmentError IOError WindowsError
|
||||
" builtin OS exceptions in Python 3
|
||||
syn keyword pythonExceptions BlockingIOError BrokenPipeError
|
||||
syn keyword pythonExceptions ChildProcessError ConnectionAbortedError
|
||||
@@ -253,18 +238,13 @@ if !exists("python_no_exception_highlight")
|
||||
syn keyword pythonExceptions ConnectionResetError FileExistsError
|
||||
syn keyword pythonExceptions FileNotFoundError InterruptedError
|
||||
syn keyword pythonExceptions IsADirectoryError NotADirectoryError
|
||||
syn keyword pythonExceptions PermissionError ProcessLookupError
|
||||
syn keyword pythonExceptions RecursionError StopAsyncIteration
|
||||
syn keyword pythonExceptions TimeoutError
|
||||
" builtin exceptions deprecated/removed in Python 3
|
||||
syn keyword pythonExceptions IOError VMSError WindowsError
|
||||
syn keyword pythonExceptions PermissionError ProcessLookupError TimeoutError
|
||||
" builtin warnings
|
||||
syn keyword pythonExceptions BytesWarning DeprecationWarning FutureWarning
|
||||
syn keyword pythonExceptions ImportWarning PendingDeprecationWarning
|
||||
syn keyword pythonExceptions RuntimeWarning SyntaxWarning UnicodeWarning
|
||||
syn keyword pythonExceptions ResourceWarning RuntimeWarning
|
||||
syn keyword pythonExceptions SyntaxWarning UnicodeWarning
|
||||
syn keyword pythonExceptions UserWarning Warning
|
||||
" builtin warnings in Python 3
|
||||
syn keyword pythonExceptions ResourceWarning
|
||||
endif
|
||||
|
||||
if exists("python_space_error_highlight")
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
" Vim syntax file
|
||||
" Language: HMTL Tidy configuration file (/etc/tidyrc ~/.tidyrc)
|
||||
" Language: HMTL Tidy Configuration
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2016 Apr 24
|
||||
" Last Change: 2020 Sep 4
|
||||
|
||||
" Preamble {{{1
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
@@ -12,10 +13,15 @@ set cpo&vim
|
||||
|
||||
syn iskeyword @,48-57,-,_
|
||||
|
||||
" Values {{{1
|
||||
syn match tidyWordSeparator contained ",\|\s" nextgroup=tidyWord skipwhite skipnl
|
||||
syn match tidyMuteIDSeparator contained ",\|\s" nextgroup=tidyMuteID skipwhite skipnl
|
||||
|
||||
syn case ignore
|
||||
syn keyword tidyBoolean contained t[rue] f[alse] y[es] n[o] 1 0
|
||||
syn keyword tidyAutoBoolean contained t[rue] f[alse] y[es] n[o] 1 0 auto
|
||||
syn case match
|
||||
syn keyword tidyCustomTags contained no blocklevel empty inline pre
|
||||
syn keyword tidyDoctype contained html5 omit auto strict loose transitional user
|
||||
syn keyword tidyEncoding contained raw ascii latin0 latin1 utf8 iso2022 mac win1252 ibm858 utf16le utf16be utf16 big5 shiftjis
|
||||
syn keyword tidyNewline contained LF CRLF CR
|
||||
@@ -24,36 +30,148 @@ syn keyword tidyRepeat contained keep-first keep-last
|
||||
syn keyword tidySorter contained alpha none
|
||||
syn region tidyString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ oneline
|
||||
syn region tidyString contained start=+'+ skip=+\\\\\|\\'+ end=+'+ oneline
|
||||
syn match tidyTags contained "\<\w\+\(\s*,\s*\w\+\)*\>"
|
||||
" Tag and attribute lists
|
||||
syn match tidyWord contained "\<\k\+\>:\@!" nextgroup=tidyWordSeparator skipwhite skipnl
|
||||
|
||||
syn keyword tidyBooleanOption add-xml-decl add-xml-pi add-xml-space
|
||||
\ anchor-as-name ascii-chars assume-xml-procins bare break-before-br
|
||||
\ clean coerce-endtags decorate-inferred-ul drop-empty-paras
|
||||
\ drop-empty-elements drop-font-tags drop-proprietary-attributes
|
||||
\ enclose-block-text enclose-text escape-cdata escape-scripts
|
||||
\ fix-backslash fix-bad-comments fix-uri force-output gdoc gnu-emacs
|
||||
\ hide-comments hide-endtags indent-attributes indent-cdata
|
||||
\ indent-with-tabs input-xml join-classes join-styles keep-time
|
||||
\ language literal-attributes logical-emphasis lower-literals markup
|
||||
\ merge-emphasis ncr numeric-entities omit-optional-tags output-html
|
||||
\ output-xhtml output-xml preserve-entities punctuation-wrap quiet
|
||||
\ quote-ampersand quote-marks quote-nbsp raw replace-color show-info
|
||||
\ show-warnings skip-nested split strict-tags-attributes tidy-mark
|
||||
\ uppercase-attributes uppercase-tags word-2000 wrap-asp
|
||||
\ wrap-attributes wrap-jste wrap-php wrap-script-literals
|
||||
\ wrap-sections write-back
|
||||
" Mute Message IDs {{{2
|
||||
syn keyword tidyMuteID ADDED_MISSING_CHARSET ANCHOR_DUPLICATED
|
||||
\ ANCHOR_NOT_UNIQUE APOS_UNDEFINED APPLET_MISSING_ALT AREA_MISSING_ALT
|
||||
\ ASCII_REQUIRES_DESCRIPTION ASSOCIATE_LABELS_EXPLICITLY
|
||||
\ ASSOCIATE_LABELS_EXPLICITLY_FOR ASSOCIATE_LABELS_EXPLICITLY_ID
|
||||
\ ATTRIBUTE_IS_NOT_ALLOWED ATTRIBUTE_VALUE_REPLACED
|
||||
\ ATTR_VALUE_NOT_LCASE AUDIO_MISSING_TEXT_AIFF AUDIO_MISSING_TEXT_AU
|
||||
\ AUDIO_MISSING_TEXT_RA AUDIO_MISSING_TEXT_RM AUDIO_MISSING_TEXT_SND
|
||||
\ AUDIO_MISSING_TEXT_WAV BACKSLASH_IN_URI BAD_ATTRIBUTE_VALUE
|
||||
\ BAD_ATTRIBUTE_VALUE_REPLACED BAD_CDATA_CONTENT BAD_SUMMARY_HTML5
|
||||
\ BAD_SURROGATE_LEAD BAD_SURROGATE_PAIR BAD_SURROGATE_TAIL
|
||||
\ CANT_BE_NESTED COERCE_TO_ENDTAG COLOR_CONTRAST_ACTIVE_LINK
|
||||
\ COLOR_CONTRAST_LINK COLOR_CONTRAST_TEXT COLOR_CONTRAST_VISITED_LINK
|
||||
\ CONTENT_AFTER_BODY CUSTOM_TAG_DETECTED DATA_TABLE_MISSING_HEADERS
|
||||
\ DATA_TABLE_MISSING_HEADERS_COLUMN DATA_TABLE_MISSING_HEADERS_ROW
|
||||
\ DATA_TABLE_REQUIRE_MARKUP_COLUMN_HEADERS
|
||||
\ DATA_TABLE_REQUIRE_MARKUP_ROW_HEADERS DISCARDING_UNEXPECTED
|
||||
\ DOCTYPE_AFTER_TAGS DOCTYPE_MISSING DUPLICATE_FRAMESET
|
||||
\ ELEMENT_NOT_EMPTY ELEMENT_VERS_MISMATCH_ERROR
|
||||
\ ELEMENT_VERS_MISMATCH_WARN ENCODING_MISMATCH
|
||||
\ ENSURE_PROGRAMMATIC_OBJECTS_ACCESSIBLE_APPLET
|
||||
\ ENSURE_PROGRAMMATIC_OBJECTS_ACCESSIBLE_EMBED
|
||||
\ ENSURE_PROGRAMMATIC_OBJECTS_ACCESSIBLE_OBJECT
|
||||
\ ENSURE_PROGRAMMATIC_OBJECTS_ACCESSIBLE_SCRIPT ESCAPED_ILLEGAL_URI
|
||||
\ FILE_CANT_OPEN FILE_CANT_OPEN_CFG FILE_NOT_FILE FIXED_BACKSLASH
|
||||
\ FOUND_STYLE_IN_BODY FRAME_MISSING_LONGDESC FRAME_MISSING_NOFRAMES
|
||||
\ FRAME_MISSING_TITLE FRAME_SRC_INVALID FRAME_TITLE_INVALID_NULL
|
||||
\ FRAME_TITLE_INVALID_SPACES HEADERS_IMPROPERLY_NESTED
|
||||
\ HEADER_USED_FORMAT_TEXT ID_NAME_MISMATCH ILLEGAL_NESTING
|
||||
\ ILLEGAL_URI_CODEPOINT ILLEGAL_URI_REFERENCE
|
||||
\ IMAGE_MAP_SERVER_SIDE_REQUIRES_CONVERSION
|
||||
\ IMG_ALT_SUSPICIOUS_FILENAME IMG_ALT_SUSPICIOUS_FILE_SIZE
|
||||
\ IMG_ALT_SUSPICIOUS_PLACEHOLDER IMG_ALT_SUSPICIOUS_TOO_LONG
|
||||
\ IMG_BUTTON_MISSING_ALT IMG_MAP_CLIENT_MISSING_TEXT_LINKS
|
||||
\ IMG_MAP_SERVER_REQUIRES_TEXT_LINKS IMG_MISSING_ALT IMG_MISSING_DLINK
|
||||
\ IMG_MISSING_LONGDESC IMG_MISSING_LONGDESC_DLINK
|
||||
\ INFORMATION_NOT_CONVEYED_APPLET INFORMATION_NOT_CONVEYED_IMAGE
|
||||
\ INFORMATION_NOT_CONVEYED_INPUT INFORMATION_NOT_CONVEYED_OBJECT
|
||||
\ INFORMATION_NOT_CONVEYED_SCRIPT INSERTING_AUTO_ATTRIBUTE
|
||||
\ INSERTING_TAG INVALID_ATTRIBUTE INVALID_NCR INVALID_SGML_CHARS
|
||||
\ INVALID_UTF16 INVALID_UTF8 INVALID_XML_ID JOINING_ATTRIBUTE
|
||||
\ LANGUAGE_INVALID LANGUAGE_NOT_IDENTIFIED
|
||||
\ LAYOUT_TABLES_LINEARIZE_PROPERLY LAYOUT_TABLE_INVALID_MARKUP
|
||||
\ LINK_TEXT_MISSING LINK_TEXT_NOT_MEANINGFUL
|
||||
\ LINK_TEXT_NOT_MEANINGFUL_CLICK_HERE LINK_TEXT_TOO_LONG
|
||||
\ LIST_USAGE_INVALID_LI LIST_USAGE_INVALID_OL LIST_USAGE_INVALID_UL
|
||||
\ MALFORMED_COMMENT MALFORMED_COMMENT_DROPPING MALFORMED_COMMENT_EOS
|
||||
\ MALFORMED_COMMENT_WARN MALFORMED_DOCTYPE METADATA_MISSING
|
||||
\ METADATA_MISSING_REDIRECT_AUTOREFRESH MISMATCHED_ATTRIBUTE_ERROR
|
||||
\ MISMATCHED_ATTRIBUTE_WARN MISSING_ATTRIBUTE MISSING_ATTR_VALUE
|
||||
\ MISSING_DOCTYPE MISSING_ENDTAG_BEFORE MISSING_ENDTAG_FOR
|
||||
\ MISSING_ENDTAG_OPTIONAL MISSING_IMAGEMAP MISSING_QUOTEMARK
|
||||
\ MISSING_QUOTEMARK_OPEN MISSING_SEMICOLON MISSING_SEMICOLON_NCR
|
||||
\ MISSING_STARTTAG MISSING_TITLE_ELEMENT MOVED_STYLE_TO_HEAD
|
||||
\ MULTIMEDIA_REQUIRES_TEXT NESTED_EMPHASIS NESTED_QUOTATION
|
||||
\ NEWLINE_IN_URI NEW_WINDOWS_REQUIRE_WARNING_BLANK
|
||||
\ NEW_WINDOWS_REQUIRE_WARNING_NEW NOFRAMES_CONTENT
|
||||
\ NOFRAMES_INVALID_CONTENT NOFRAMES_INVALID_LINK
|
||||
\ NOFRAMES_INVALID_NO_VALUE NON_MATCHING_ENDTAG OBJECT_MISSING_ALT
|
||||
\ OBSOLETE_ELEMENT OPTION_REMOVED OPTION_REMOVED_APPLIED
|
||||
\ OPTION_REMOVED_UNAPPLIED POTENTIAL_HEADER_BOLD
|
||||
\ POTENTIAL_HEADER_ITALICS POTENTIAL_HEADER_UNDERLINE
|
||||
\ PREVIOUS_LOCATION PROGRAMMATIC_OBJECTS_REQUIRE_TESTING_APPLET
|
||||
\ PROGRAMMATIC_OBJECTS_REQUIRE_TESTING_EMBED
|
||||
\ PROGRAMMATIC_OBJECTS_REQUIRE_TESTING_OBJECT
|
||||
\ PROGRAMMATIC_OBJECTS_REQUIRE_TESTING_SCRIPT PROPRIETARY_ATTRIBUTE
|
||||
\ PROPRIETARY_ATTR_VALUE PROPRIETARY_ELEMENT REMOVED_HTML5
|
||||
\ REMOVE_AUTO_REDIRECT REMOVE_AUTO_REFRESH REMOVE_BLINK_MARQUEE
|
||||
\ REMOVE_FLICKER_ANIMATED_GIF REMOVE_FLICKER_APPLET
|
||||
\ REMOVE_FLICKER_EMBED REMOVE_FLICKER_OBJECT REMOVE_FLICKER_SCRIPT
|
||||
\ REPEATED_ATTRIBUTE REPLACE_DEPRECATED_HTML_APPLET
|
||||
\ REPLACE_DEPRECATED_HTML_BASEFONT REPLACE_DEPRECATED_HTML_CENTER
|
||||
\ REPLACE_DEPRECATED_HTML_DIR REPLACE_DEPRECATED_HTML_FONT
|
||||
\ REPLACE_DEPRECATED_HTML_ISINDEX REPLACE_DEPRECATED_HTML_MENU
|
||||
\ REPLACE_DEPRECATED_HTML_S REPLACE_DEPRECATED_HTML_STRIKE
|
||||
\ REPLACE_DEPRECATED_HTML_U REPLACING_ELEMENT REPLACING_UNEX_ELEMENT
|
||||
\ SCRIPT_MISSING_NOSCRIPT SCRIPT_NOT_KEYBOARD_ACCESSIBLE_ON_CLICK
|
||||
\ SCRIPT_NOT_KEYBOARD_ACCESSIBLE_ON_MOUSE_DOWN
|
||||
\ SCRIPT_NOT_KEYBOARD_ACCESSIBLE_ON_MOUSE_MOVE
|
||||
\ SCRIPT_NOT_KEYBOARD_ACCESSIBLE_ON_MOUSE_OUT
|
||||
\ SCRIPT_NOT_KEYBOARD_ACCESSIBLE_ON_MOUSE_OVER
|
||||
\ SCRIPT_NOT_KEYBOARD_ACCESSIBLE_ON_MOUSE_UP SKIPOVER_ASCII_ART
|
||||
\ SPACE_PRECEDING_XMLDECL STRING_ARGUMENT_BAD STRING_CONTENT_LOOKS
|
||||
\ STRING_DOCTYPE_GIVEN STRING_MISSING_MALFORMED STRING_MUTING_TYPE
|
||||
\ STRING_NO_SYSID STRING_UNKNOWN_OPTION
|
||||
\ STYLESHEETS_REQUIRE_TESTING_LINK
|
||||
\ STYLESHEETS_REQUIRE_TESTING_STYLE_ATTR
|
||||
\ STYLESHEETS_REQUIRE_TESTING_STYLE_ELEMENT
|
||||
\ STYLE_SHEET_CONTROL_PRESENTATION SUSPECTED_MISSING_QUOTE
|
||||
\ TABLE_MAY_REQUIRE_HEADER_ABBR TABLE_MAY_REQUIRE_HEADER_ABBR_NULL
|
||||
\ TABLE_MAY_REQUIRE_HEADER_ABBR_SPACES TABLE_MISSING_CAPTION
|
||||
\ TABLE_MISSING_SUMMARY TABLE_SUMMARY_INVALID_NULL
|
||||
\ TABLE_SUMMARY_INVALID_PLACEHOLDER TABLE_SUMMARY_INVALID_SPACES
|
||||
\ TAG_NOT_ALLOWED_IN TEXT_EQUIVALENTS_REQUIRE_UPDATING_APPLET
|
||||
\ TEXT_EQUIVALENTS_REQUIRE_UPDATING_OBJECT
|
||||
\ TEXT_EQUIVALENTS_REQUIRE_UPDATING_SCRIPT TOO_MANY_ELEMENTS
|
||||
\ TOO_MANY_ELEMENTS_IN TRIM_EMPTY_ELEMENT UNESCAPED_AMPERSAND
|
||||
\ UNEXPECTED_ENDTAG UNEXPECTED_ENDTAG_ERR UNEXPECTED_ENDTAG_IN
|
||||
\ UNEXPECTED_END_OF_FILE UNEXPECTED_END_OF_FILE_ATTR
|
||||
\ UNEXPECTED_EQUALSIGN UNEXPECTED_GT UNEXPECTED_QUOTEMARK
|
||||
\ UNKNOWN_ELEMENT UNKNOWN_ELEMENT_LOOKS_CUSTOM UNKNOWN_ENTITY
|
||||
\ USING_BR_INPLACE_OF VENDOR_SPECIFIC_CHARS WHITE_IN_URI
|
||||
\ XML_DECLARATION_DETECTED XML_ID_SYNTAX
|
||||
\ contained nextgroup=tidyMuteIDSeparator skipwhite skipnl
|
||||
|
||||
" Options {{{1
|
||||
syn keyword tidyCustomTagsOption custom-tags contained nextgroup=tidyCustomTagsDelimiter
|
||||
syn match tidyCustomTagsDelimiter ":" nextgroup=tidyCustomTags contained skipwhite
|
||||
|
||||
syn keyword tidyBooleanOption add-meta-charset add-xml-decl
|
||||
\ add-xml-pi add-xml-space anchor-as-name ascii-chars
|
||||
\ assume-xml-procins bare break-before-br clean coerce-endtags
|
||||
\ decorate-inferred-ul drop-empty-paras drop-empty-elements
|
||||
\ drop-font-tags drop-proprietary-attributes enclose-block-text
|
||||
\ enclose-text escape-cdata escape-scripts fix-backslash
|
||||
\ fix-style-tags fix-uri force-output gdoc gnu-emacs hide-comments
|
||||
\ hide-endtags indent-attributes indent-cdata indent-with-tabs
|
||||
\ input-xml join-classes join-styles keep-tabs keep-time language
|
||||
\ literal-attributes logical-emphasis lower-literals markup
|
||||
\ merge-emphasis mute-id ncr numeric-entities omit-optional-tags
|
||||
\ output-html output-xhtml output-xml preserve-entities
|
||||
\ punctuation-wrap quiet quote-ampersand quote-marks quote-nbsp raw
|
||||
\ replace-color show-filename show-info show-meta-change show-warnings
|
||||
\ skip-nested split strict-tags-attributes tidy-mark
|
||||
\ uppercase-attributes uppercase-tags warn-proprietary-attributes
|
||||
\ word-2000 wrap-asp wrap-attributes wrap-jste wrap-php
|
||||
\ wrap-script-literals wrap-sections write-back
|
||||
\ contained nextgroup=tidyBooleanDelimiter
|
||||
|
||||
syn match tidyBooleanDelimiter ":" nextgroup=tidyBoolean contained skipwhite
|
||||
|
||||
syn keyword tidyAutoBooleanOption indent merge-divs merge-spans output-bom show-body-only vertical-space contained nextgroup=tidyAutoBooleanDelimiter
|
||||
syn keyword tidyAutoBooleanOption fix-bad-comments indent merge-divs merge-spans output-bom show-body-only vertical-space contained nextgroup=tidyAutoBooleanDelimiter
|
||||
syn match tidyAutoBooleanDelimiter ":" nextgroup=tidyAutoBoolean contained skipwhite
|
||||
|
||||
syn keyword tidyCSSSelectorOption css-prefix contained nextgroup=tidyCSSSelectorDelimiter
|
||||
syn match tidyCSSSelectorDelimiter ":" nextgroup=tidyCSSSelector contained skipwhite
|
||||
|
||||
syn keyword tidyDoctypeOption doctype contained nextgroup=tidyDoctypeDelimiter
|
||||
syn match tidyDoctypeDelimiter ":" nextgroup=tidyDoctype contained skipwhite
|
||||
syn match tidyDoctypeDelimiter ":" nextgroup=tidyDoctype,tidyString contained skipwhite
|
||||
|
||||
syn keyword tidyEncodingOption char-encoding input-encoding output-encoding contained nextgroup=tidyEncodingDelimiter
|
||||
syn match tidyEncodingDelimiter ":" nextgroup=tidyEncoding contained skipwhite
|
||||
@@ -67,8 +185,11 @@ syn match tidyNameDelimiter ":" nextgroup=tidyName contained skipwhite
|
||||
syn keyword tidyNewlineOption newline contained nextgroup=tidyNewlineDelimiter
|
||||
syn match tidyNewlineDelimiter ":" nextgroup=tidyNewline contained skipwhite
|
||||
|
||||
syn keyword tidyAttributesOption priority-attributes contained nextgroup=tidyAttributesDelimiter
|
||||
syn match tidyAttributesDelimiter ":" nextgroup=tidyWord contained skipwhite
|
||||
|
||||
syn keyword tidyTagsOption new-blocklevel-tags new-empty-tags new-inline-tags new-pre-tags contained nextgroup=tidyTagsDelimiter
|
||||
syn match tidyTagsDelimiter ":" nextgroup=tidyTags contained skipwhite
|
||||
syn match tidyTagsDelimiter ":" nextgroup=tidyWord contained skipwhite
|
||||
|
||||
syn keyword tidyRepeatOption repeated-attributes contained nextgroup=tidyRepeatDelimiter
|
||||
syn match tidyRepeatDelimiter ":" nextgroup=tidyRepeat contained skipwhite
|
||||
@@ -79,57 +200,77 @@ syn match tidySorterDelimiter ":" nextgroup=tidySorter contained skipwhite
|
||||
syn keyword tidyStringOption alt-text error-file gnu-emacs-file output-file contained nextgroup=tidyStringDelimiter
|
||||
syn match tidyStringDelimiter ":" nextgroup=tidyString contained skipwhite
|
||||
|
||||
syn keyword tidyMuteOption mute contained nextgroup=tidyMuteDelimiter
|
||||
syn match tidyMuteDelimiter ":" nextgroup=tidyMuteID contained skipwhite
|
||||
|
||||
syn cluster tidyOptions contains=tidy.*Option
|
||||
|
||||
" Option line anchor {{{1
|
||||
syn match tidyStart "^" nextgroup=@tidyOptions
|
||||
" Long standing bug - option lines (except the first) with leading whitespace
|
||||
" are silently ignored.
|
||||
syn match tidyErrorStart '^\s\+\ze\S'
|
||||
|
||||
" Comments {{{1
|
||||
syn match tidyComment "^\s*//.*$" contains=tidyTodo
|
||||
syn match tidyComment "^\s*#.*$" contains=tidyTodo
|
||||
syn keyword tidyTodo TODO NOTE FIXME XXX contained
|
||||
|
||||
" Default highlighting {{{1
|
||||
hi def link tidyAttributesOption Identifier
|
||||
hi def link tidyAutoBooleanOption Identifier
|
||||
hi def link tidyBooleanOption Identifier
|
||||
hi def link tidyCSSSelectorOption Identifier
|
||||
hi def link tidyCustomTagsOption Identifier
|
||||
hi def link tidyDoctypeOption Identifier
|
||||
hi def link tidyEncodingOption Identifier
|
||||
hi def link tidyIntegerOption Identifier
|
||||
hi def link tidyMuteOption Identifier
|
||||
hi def link tidyNameOption Identifier
|
||||
hi def link tidyNewlineOption Identifier
|
||||
hi def link tidyTagsOption Identifier
|
||||
hi def link tidyRepeatOption Identifier
|
||||
hi def link tidySorterOption Identifier
|
||||
hi def link tidyStringOption Identifier
|
||||
hi def link tidyTagsOption Identifier
|
||||
|
||||
hi def link tidyAttributesDelimiter Special
|
||||
hi def link tidyAutoBooleanDelimiter Special
|
||||
hi def link tidyBooleanDelimiter Special
|
||||
hi def link tidyCSSSelectorDelimiter Special
|
||||
hi def link tidyCustomTagsDelimiter Special
|
||||
hi def link tidyDoctypeDelimiter Special
|
||||
hi def link tidyEncodingDelimiter Special
|
||||
hi def link tidyIntegerDelimiter Special
|
||||
hi def link tidyMuteDelimiter Special
|
||||
hi def link tidyNameDelimiter Special
|
||||
hi def link tidyNewlineDelimiter Special
|
||||
hi def link tidyTagsDelimiter Special
|
||||
hi def link tidyRepeatDelimiter Special
|
||||
hi def link tidySorterDelimiter Special
|
||||
hi def link tidyStringDelimiter Special
|
||||
hi def link tidyTagsDelimiter Special
|
||||
|
||||
hi def link tidyAutoBoolean Boolean
|
||||
hi def link tidyBoolean Boolean
|
||||
hi def link tidyCustomTags Constant
|
||||
hi def link tidyDoctype Constant
|
||||
hi def link tidyEncoding Constant
|
||||
hi def link tidyMuteID Constant
|
||||
hi def link tidyNewline Constant
|
||||
hi def link tidyTags Constant
|
||||
hi def link tidyNumber Number
|
||||
hi def link tidyRepeat Constant
|
||||
hi def link tidySorter Constant
|
||||
hi def link tidyString String
|
||||
hi def link tidyWord Constant
|
||||
|
||||
hi def link tidyComment Comment
|
||||
hi def link tidyTodo Todo
|
||||
|
||||
hi def link tidyErrorStart Error
|
||||
|
||||
" Postscript {{{1
|
||||
let b:current_syntax = "tidy"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: ts=8
|
||||
" vim: ts=8 fdm=marker
|
||||
|
||||
@@ -907,7 +907,7 @@ ce 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
|
||||
5. <TAB> 을 눌러 ":edit" 명령어를 완성해 봅니다.
|
||||
|
||||
6. 이제 빈칸 하나를 추가한 뒤, 존재 파일 이름을 앞 부분을 입력합니다: :edit FIL
|
||||
6. 이제 빈칸 하나를 추가한 뒤, 존재하는 파일 이름의 앞 부분을 입력합니다: :edit FIL
|
||||
|
||||
7. <TAB> 을 눌러 파일 이름을 완성 시킵니다.
|
||||
|
||||
|
||||
@@ -907,7 +907,7 @@ ce
|
||||
|
||||
5. <TAB> <20><> <20><><EFBFBD><EFBFBD> ":edit" <20><><EFBFBD>ɾ <20>ϼ<EFBFBD><CFBC><EFBFBD> <20><><EFBFBD>ϴ<EFBFBD>.
|
||||
|
||||
6. <20><><EFBFBD><EFBFBD> <20><>ĭ <20>ϳ<EFBFBD><CFB3><EFBFBD> <20>߰<EFBFBD><DFB0><EFBFBD> <20><>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20≯<EFBFBD><CCB8><EFBFBD> <20><> <20>κ<EFBFBD><CEBA><EFBFBD> <20>Է<EFBFBD><D4B7>մϴ<D5B4>: :edit FIL
|
||||
6. <20><><EFBFBD><EFBFBD> <20><>ĭ <20>ϳ<EFBFBD><CFB3><EFBFBD> <20>߰<EFBFBD><DFB0><EFBFBD> <20><>, <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20><><EFBFBD><EFBFBD> <20≯<EFBFBD><CCB8><EFBFBD> <20><> <20>κ<EFBFBD><CEBA><EFBFBD> <20>Է<EFBFBD><D4B7>մϴ<D5B4>: :edit FIL
|
||||
|
||||
7. <TAB> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20≯<EFBFBD><CCB8><EFBFBD> <20>ϼ<EFBFBD> <20><>ŵ<EFBFBD>ϴ<EFBFBD>.
|
||||
|
||||
|
||||
@@ -907,7 +907,7 @@ ce 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
|
||||
5. <TAB> 을 눌러 ":edit" 명령어를 완성해 봅니다.
|
||||
|
||||
6. 이제 빈칸 하나를 추가한 뒤, 존재 파일 이름을 앞 부분을 입력합니다: :edit FIL
|
||||
6. 이제 빈칸 하나를 추가한 뒤, 존재하는 파일 이름의 앞 부분을 입력합니다: :edit FIL
|
||||
|
||||
7. <TAB> 을 눌러 파일 이름을 완성 시킵니다.
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@ WINVER = 0x0501
|
||||
endif
|
||||
CXX := $(CROSS_COMPILE)g++
|
||||
WINDRES := $(CROSS_COMPILE)windres
|
||||
WINDRES_CXX = $(CXX)
|
||||
WINDRES_FLAGS = --preprocessor="$(WINDRES_CXX) -E -xc" -DRC_INVOKED
|
||||
# this used to have --preprocessor, but it's no longer supported
|
||||
WINDRES_FLAGS =
|
||||
LIBS := -luuid -lgdi32
|
||||
RES := gvimext.res
|
||||
DEFFILE = gvimext_ming.def
|
||||
|
||||
42
src/INSTALL
42
src/INSTALL
@@ -39,13 +39,53 @@ version of Vim that is small and starts up quickly, see the Makefile for how
|
||||
to disable the GUI and X11. If you don't have GUI libraries and/or X11, these
|
||||
features will be disabled automatically.
|
||||
|
||||
To built Vim on Ubuntu from scratch on a clean system using git:
|
||||
Install tools required to be able to get and build Vim:
|
||||
% sudo apt install git
|
||||
% sudo apt install make
|
||||
% sudo apt install clang
|
||||
|
||||
Build Vim with default features:
|
||||
% git clone https://github.com/vim/vim.git
|
||||
% cd vim/src
|
||||
% make
|
||||
|
||||
Run tests to check there are no problems:
|
||||
% make test
|
||||
|
||||
Install Vim in /usr/local:
|
||||
% sudo make install
|
||||
|
||||
Add X windows clipboard support (also needed for GUI):
|
||||
% sudo apt install libxt-dev
|
||||
% make reconfig
|
||||
|
||||
Add GUI support (ignore compiler warnings):
|
||||
% sudo apt install libgtk2.0-dev
|
||||
% make reconfig
|
||||
|
||||
Add Python 3 support:
|
||||
% sudo apt install libpython3-dev
|
||||
Uncomment this line in Makefile:
|
||||
"CONF_OPT_PYTHON3 = --enable-python3interp"
|
||||
% make reconfig
|
||||
|
||||
Debugging:
|
||||
% sudo apt install valgrind
|
||||
Uncomment this line in Makefile:
|
||||
CFLAGS = -g -Wall -Wextra -Wshadow -Wmissing-prototypes -Wunreachable-code -Wno-deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
|
||||
% make reconfig
|
||||
% make test_{test-name}
|
||||
See output in testdir/valgrind.test_{test-name}
|
||||
|
||||
|
||||
See the start of Makefile for more detailed instructions about how to compile
|
||||
Vim.
|
||||
|
||||
If you need extra compiler and/or linker arguments, set $CFLAGS and/or $LIBS
|
||||
before starting configure. Example:
|
||||
|
||||
env CFLAGS=-I/usr/local/include LIBS=-lm make
|
||||
env CFLAGS=-I/usr/local/include LIBS=-lm make
|
||||
|
||||
This is only needed for things that configure doesn't offer a specific argument
|
||||
for or figures out by itself. First try running configure without extra
|
||||
|
||||
@@ -220,7 +220,6 @@ WINDRES := $(CROSS_COMPILE)windres
|
||||
else
|
||||
WINDRES := windres
|
||||
endif
|
||||
WINDRES_CC = $(CC)
|
||||
|
||||
# Get the default ARCH.
|
||||
ifndef ARCH
|
||||
@@ -514,7 +513,8 @@ endif
|
||||
|
||||
CFLAGS = -I. -Iproto $(DEFINES) -pipe -march=$(ARCH) -Wall
|
||||
CXXFLAGS = -std=gnu++11
|
||||
WINDRES_FLAGS = --preprocessor="$(WINDRES_CC) -E -xc" -DRC_INVOKED
|
||||
# This used to have --preprocessor, but it's no longer supported
|
||||
WINDRES_FLAGS =
|
||||
EXTRA_LIBS =
|
||||
|
||||
ifdef GETTEXT
|
||||
|
||||
@@ -1489,6 +1489,16 @@ $(NEW_TESTS):
|
||||
$(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\$(VIMTESTTARGET) report
|
||||
cd ..
|
||||
|
||||
# Run Vim9 tests.
|
||||
# These do not depend on the executable, compile it when needed.
|
||||
test_vim9:
|
||||
cd testdir
|
||||
-del test_vim9_*.res
|
||||
$(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\$(VIMTESTTARGET) nolog
|
||||
$(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\$(VIMTESTTARGET) $(TEST_VIM9_RES)
|
||||
$(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\$(VIMTESTTARGET) report
|
||||
cd ..
|
||||
|
||||
###########################################################################
|
||||
|
||||
# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
|
||||
|
||||
@@ -2294,9 +2294,12 @@ run_message_test: $(MESSAGE_TEST_TARGET)
|
||||
|
||||
# Run the libvterm tests.
|
||||
# This works only on GNU make, not on BSD make.
|
||||
# Libtool requires "gcc".
|
||||
test_libvterm:
|
||||
@if $(MAKE) --version 2>/dev/null | grep -qs "GNU Make"; then \
|
||||
cd libvterm; $(MAKE) -f Makefile test CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"; \
|
||||
if test -x "/usr/bin/gcc"; then \
|
||||
cd libvterm; $(MAKE) -f Makefile test CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"; \
|
||||
fi \
|
||||
fi
|
||||
|
||||
# Run individual OLD style test.
|
||||
|
||||
@@ -17,12 +17,29 @@
|
||||
#define AL_ADD 2
|
||||
#define AL_DEL 3
|
||||
|
||||
// This flag is set whenever the argument list is being changed and calling a
|
||||
// function that might trigger an autocommand.
|
||||
static int arglist_locked = FALSE;
|
||||
|
||||
static int
|
||||
check_arglist_locked(void)
|
||||
{
|
||||
if (arglist_locked)
|
||||
{
|
||||
emsg(_(e_cannot_change_arglist_recursively));
|
||||
return FAIL;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Clear an argument list: free all file names and reset it to zero entries.
|
||||
*/
|
||||
void
|
||||
alist_clear(alist_T *al)
|
||||
{
|
||||
if (check_arglist_locked() == FAIL)
|
||||
return;
|
||||
while (--al->al_ga.ga_len >= 0)
|
||||
vim_free(AARGLIST(al)[al->al_ga.ga_len].ae_fname);
|
||||
ga_clear(&al->al_ga);
|
||||
@@ -126,14 +143,9 @@ alist_set(
|
||||
int fnum_len)
|
||||
{
|
||||
int i;
|
||||
static int recursive = 0;
|
||||
|
||||
if (recursive)
|
||||
{
|
||||
emsg(_(e_au_recursive));
|
||||
if (check_arglist_locked() == FAIL)
|
||||
return;
|
||||
}
|
||||
++recursive;
|
||||
|
||||
alist_clear(al);
|
||||
if (ga_grow(&al->al_ga, count) == OK)
|
||||
@@ -152,7 +164,11 @@ alist_set(
|
||||
// May set buffer name of a buffer previously used for the
|
||||
// argument list, so that it's re-used by alist_add.
|
||||
if (fnum_list != NULL && i < fnum_len)
|
||||
{
|
||||
arglist_locked = TRUE;
|
||||
buf_set_name(fnum_list[i], files[i]);
|
||||
arglist_locked = FALSE;
|
||||
}
|
||||
|
||||
alist_add(al, files[i], use_curbuf ? 2 : 1);
|
||||
ui_breakcheck();
|
||||
@@ -163,8 +179,6 @@ alist_set(
|
||||
FreeWild(count, files);
|
||||
if (al == &global_alist)
|
||||
arg_had_last = FALSE;
|
||||
|
||||
--recursive;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -179,6 +193,10 @@ alist_add(
|
||||
{
|
||||
if (fname == NULL) // don't add NULL file names
|
||||
return;
|
||||
if (check_arglist_locked() == FAIL)
|
||||
return;
|
||||
arglist_locked = TRUE;
|
||||
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
slash_adjust(fname);
|
||||
#endif
|
||||
@@ -187,6 +205,8 @@ alist_add(
|
||||
AARGLIST(al)[al->al_ga.ga_len].ae_fnum =
|
||||
buflist_add(fname, BLN_LISTED | (set_fnum == 2 ? BLN_CURBUF : 0));
|
||||
++al->al_ga.ga_len;
|
||||
|
||||
arglist_locked = FALSE;
|
||||
}
|
||||
|
||||
#if defined(BACKSLASH_IN_FILENAME) || defined(PROTO)
|
||||
@@ -295,10 +315,10 @@ get_arglist_exp(
|
||||
return FAIL;
|
||||
if (wig == TRUE)
|
||||
i = expand_wildcards(ga.ga_len, (char_u **)ga.ga_data,
|
||||
fcountp, fnamesp, EW_FILE|EW_NOTFOUND);
|
||||
fcountp, fnamesp, EW_FILE|EW_NOTFOUND|EW_NOTWILD);
|
||||
else
|
||||
i = gen_expand_wildcards(ga.ga_len, (char_u **)ga.ga_data,
|
||||
fcountp, fnamesp, EW_FILE|EW_NOTFOUND);
|
||||
fcountp, fnamesp, EW_FILE|EW_NOTFOUND|EW_NOTWILD);
|
||||
|
||||
ga_clear(&ga);
|
||||
return i;
|
||||
@@ -334,7 +354,8 @@ alist_add_list(
|
||||
int i;
|
||||
int old_argcount = ARGCOUNT;
|
||||
|
||||
if (ga_grow(&ALIST(curwin)->al_ga, count) == OK)
|
||||
if (check_arglist_locked() != FAIL
|
||||
&& ga_grow(&ALIST(curwin)->al_ga, count) == OK)
|
||||
{
|
||||
if (after < 0)
|
||||
after = 0;
|
||||
@@ -343,6 +364,7 @@ alist_add_list(
|
||||
if (after < ARGCOUNT)
|
||||
mch_memmove(&(ARGLIST[after + count]), &(ARGLIST[after]),
|
||||
(ARGCOUNT - after) * sizeof(aentry_T));
|
||||
arglist_locked = TRUE;
|
||||
for (i = 0; i < count; ++i)
|
||||
{
|
||||
int flags = BLN_LISTED | (will_edit ? BLN_CURBUF : 0);
|
||||
@@ -350,6 +372,7 @@ alist_add_list(
|
||||
ARGLIST[after + i].ae_fname = files[i];
|
||||
ARGLIST[after + i].ae_fnum = buflist_add(files[i], flags);
|
||||
}
|
||||
arglist_locked = FALSE;
|
||||
ALIST(curwin)->al_ga.ga_len += count;
|
||||
if (old_argcount > 0 && curwin->w_arg_idx >= after)
|
||||
curwin->w_arg_idx += count;
|
||||
@@ -382,6 +405,9 @@ do_arglist(
|
||||
int match;
|
||||
int arg_escaped = TRUE;
|
||||
|
||||
if (check_arglist_locked() == FAIL)
|
||||
return FAIL;
|
||||
|
||||
// Set default argument for ":argadd" command.
|
||||
if (what == AL_ADD && *str == NUL)
|
||||
{
|
||||
@@ -531,6 +557,8 @@ ex_args(exarg_T *eap)
|
||||
|
||||
if (eap->cmdidx != CMD_args)
|
||||
{
|
||||
if (check_arglist_locked() == FAIL)
|
||||
return;
|
||||
alist_unlink(ALIST(curwin));
|
||||
if (eap->cmdidx == CMD_argglobal)
|
||||
ALIST(curwin) = &global_alist;
|
||||
@@ -540,6 +568,8 @@ ex_args(exarg_T *eap)
|
||||
|
||||
if (*eap->arg != NUL)
|
||||
{
|
||||
if (check_arglist_locked() == FAIL)
|
||||
return;
|
||||
// ":args file ..": define new argument list, handle like ":next"
|
||||
// Also for ":argslocal file .." and ":argsglobal file ..".
|
||||
ex_next(eap);
|
||||
@@ -776,6 +806,9 @@ ex_argdelete(exarg_T *eap)
|
||||
int i;
|
||||
int n;
|
||||
|
||||
if (check_arglist_locked() == FAIL)
|
||||
return;
|
||||
|
||||
if (eap->addr_count > 0 || *eap->arg == NUL)
|
||||
{
|
||||
// ":argdel" works like ":.argdel"
|
||||
@@ -884,6 +917,13 @@ do_arg_all(
|
||||
win_T *new_curwin = NULL;
|
||||
tabpage_T *new_curtab = NULL;
|
||||
|
||||
#ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
{
|
||||
emsg(_(e_cmdwin));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (ARGCOUNT <= 0)
|
||||
{
|
||||
// Don't give an error message. We don't want it when the ":all"
|
||||
|
||||
39
src/auto/configure
vendored
39
src/auto/configure
vendored
@@ -4482,7 +4482,7 @@ with_x_arg="$with_x"
|
||||
|
||||
if test -z "$CFLAGS"; then
|
||||
CFLAGS="-O"
|
||||
test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall"
|
||||
test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall -Wno-deprecated-declarations"
|
||||
fi
|
||||
if test "$GCC" = yes; then
|
||||
gccversion=`$CC -dumpversion`
|
||||
@@ -4510,9 +4510,9 @@ if test x"$CLANG_VERSION_STRING" != x"" ; then
|
||||
CLANG_VERSION=`expr $CLANG_MAJOR '*' 1000000 '+' $CLANG_MINOR '*' 1000 '+' $CLANG_REVISION`
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CLANG_VERSION" >&5
|
||||
$as_echo "$CLANG_VERSION" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if clang supports -fno-strength-reduce" >&5
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if clang supports -fno-strength-reduce" >&5
|
||||
$as_echo_n "checking if clang supports -fno-strength-reduce... " >&6; }
|
||||
if test "$CLANG_VERSION" -ge 500002075 ; then
|
||||
if test "$CLANG_MAJOR" -ge 10 -o "$CLANG_VERSION" -ge 500002075 ; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
CFLAGS=`echo "$CFLAGS" | sed -e 's/-fno-strength-reduce/ /'`
|
||||
@@ -9262,6 +9262,7 @@ $as_echo "no GUI support" >&6; } ;;
|
||||
$as_echo "yes/auto - automatic GUI support" >&6; }
|
||||
gui_auto=yes
|
||||
SKIP_GTK2=
|
||||
SKIP_GTK3=
|
||||
SKIP_GNOME=
|
||||
SKIP_MOTIF=
|
||||
SKIP_ATHENA=
|
||||
@@ -9523,6 +9524,8 @@ $as_echo "gtk test disabled" >&6; }
|
||||
fi
|
||||
|
||||
if test "x$PKG_CONFIG" != "xno"; then
|
||||
save_skip_gtk3=$SKIP_GTK3
|
||||
SKIP_GTK3=YES
|
||||
|
||||
if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then
|
||||
{
|
||||
@@ -9666,6 +9669,8 @@ $as_echo "no" >&6; }
|
||||
SKIP_MOTIF=YES
|
||||
GUITYPE=GTK
|
||||
|
||||
else
|
||||
SKIP_GTK3=$save_skip_gtk3
|
||||
fi
|
||||
fi
|
||||
if test "x$GUITYPE" = "xGTK"; then
|
||||
@@ -9778,6 +9783,8 @@ $as_echo "gtk test disabled" >&6; }
|
||||
fi
|
||||
|
||||
if test "x$PKG_CONFIG" != "xno"; then
|
||||
save_skip_gtk2=$SKIP_GTK2
|
||||
SKIP_GTK2=YES
|
||||
|
||||
if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then
|
||||
{
|
||||
@@ -9924,6 +9931,8 @@ $as_echo "no" >&6; }
|
||||
|
||||
$as_echo "#define USE_GTK3 1" >>confdefs.h
|
||||
|
||||
else
|
||||
SKIP_GTK2=$save_skip_gtk2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -13934,6 +13943,30 @@ $as_echo "not usable" >&6; }
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _SC_SIGSTKSZ via sysconf()" >&5
|
||||
$as_echo_n "checking for _SC_SIGSTKSZ via sysconf()... " >&6; }
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <unistd.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
(void)sysconf(_SC_SIGSTKSZ);
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }; $as_echo "#define HAVE_SYSCONF_SIGSTKSZ 1" >>confdefs.h
|
||||
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable" >&5
|
||||
$as_echo "not usable" >&6; }
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
# The cast to long int works around a bug in the HP C Compiler
|
||||
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
|
||||
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
|
||||
|
||||
@@ -956,11 +956,14 @@ do_autocmd(char_u *arg_in, int forceit)
|
||||
last_group = AUGROUP_ERROR; // for listing the group name
|
||||
if (*arg == '*' || *arg == NUL || *arg == '|')
|
||||
{
|
||||
for (event = (event_T)0; (int)event < (int)NUM_EVENTS;
|
||||
event = (event_T)((int)event + 1))
|
||||
if (do_autocmd_event(event, pat,
|
||||
once, nested, cmd, forceit, group) == FAIL)
|
||||
break;
|
||||
if (!forceit && *cmd != NUL)
|
||||
emsg(_(e_cannot_define_autocommands_for_all_events));
|
||||
else
|
||||
for (event = (event_T)0; (int)event < (int)NUM_EVENTS;
|
||||
event = (event_T)((int)event + 1))
|
||||
if (do_autocmd_event(event, pat,
|
||||
once, nested, cmd, forceit, group) == FAIL)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
64
src/buffer.c
64
src/buffer.c
@@ -595,6 +595,7 @@ close_buffer(
|
||||
if (buf->b_nwindows == 1)
|
||||
{
|
||||
++buf->b_locked;
|
||||
++buf->b_locked_split;
|
||||
if (apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname, buf->b_fname,
|
||||
FALSE, buf)
|
||||
&& !bufref_valid(&bufref))
|
||||
@@ -605,6 +606,7 @@ aucmd_abort:
|
||||
return FALSE;
|
||||
}
|
||||
--buf->b_locked;
|
||||
--buf->b_locked_split;
|
||||
if (abort_if_last && one_window())
|
||||
// Autocommands made this the only window.
|
||||
goto aucmd_abort;
|
||||
@@ -614,12 +616,14 @@ aucmd_abort:
|
||||
if (!unload_buf)
|
||||
{
|
||||
++buf->b_locked;
|
||||
++buf->b_locked_split;
|
||||
if (apply_autocmds(EVENT_BUFHIDDEN, buf->b_fname, buf->b_fname,
|
||||
FALSE, buf)
|
||||
&& !bufref_valid(&bufref))
|
||||
// Autocommands deleted the buffer.
|
||||
goto aucmd_abort;
|
||||
--buf->b_locked;
|
||||
--buf->b_locked_split;
|
||||
if (abort_if_last && one_window())
|
||||
// Autocommands made this the only window.
|
||||
goto aucmd_abort;
|
||||
@@ -800,6 +804,7 @@ buf_freeall(buf_T *buf, int flags)
|
||||
|
||||
// Make sure the buffer isn't closed by autocommands.
|
||||
++buf->b_locked;
|
||||
++buf->b_locked_split;
|
||||
set_bufref(&bufref, buf);
|
||||
if (buf->b_ml.ml_mfp != NULL)
|
||||
{
|
||||
@@ -826,6 +831,7 @@ buf_freeall(buf_T *buf, int flags)
|
||||
return;
|
||||
}
|
||||
--buf->b_locked;
|
||||
--buf->b_locked_split;
|
||||
|
||||
// If the buffer was in curwin and the window has changed, go back to that
|
||||
// window, if it still exists. This avoids that ":edit x" triggering a
|
||||
@@ -1718,8 +1724,8 @@ set_curbuf(buf_T *buf, int action)
|
||||
set_bufref(&prevbufref, prevbuf);
|
||||
set_bufref(&newbufref, buf);
|
||||
|
||||
// Autocommands may delete the current buffer and/or the buffer we want to go
|
||||
// to. In those cases don't close the buffer.
|
||||
// Autocommands may delete the current buffer and/or the buffer we want to
|
||||
// go to. In those cases don't close the buffer.
|
||||
if (!apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf)
|
||||
|| (bufref_valid(&prevbufref)
|
||||
&& bufref_valid(&newbufref)
|
||||
@@ -2564,12 +2570,15 @@ buflist_findpat(
|
||||
char_u *p;
|
||||
int toggledollar;
|
||||
|
||||
if (pattern_end == pattern + 1 && (*pattern == '%' || *pattern == '#'))
|
||||
// "%" is current file, "%%" or "#" is alternate file
|
||||
if ((pattern_end == pattern + 1 && (*pattern == '%' || *pattern == '#'))
|
||||
|| (in_vim9script() && pattern_end == pattern + 2
|
||||
&& pattern[0] == '%' && pattern[1] == '%'))
|
||||
{
|
||||
if (*pattern == '%')
|
||||
match = curbuf->b_fnum;
|
||||
else
|
||||
if (*pattern == '#' || pattern_end == pattern + 2)
|
||||
match = curwin->w_alt_fnum;
|
||||
else
|
||||
match = curbuf->b_fnum;
|
||||
#ifdef FEAT_DIFF
|
||||
if (diffmode && !diff_mode_buf(buflist_findnr(match)))
|
||||
match = -1;
|
||||
@@ -4148,9 +4157,6 @@ build_stl_str_hl(
|
||||
|
||||
if (fillchar == 0)
|
||||
fillchar = ' ';
|
||||
// Can't handle a multi-byte fill character yet.
|
||||
else if (mb_char2len(fillchar) > 1)
|
||||
fillchar = '-';
|
||||
|
||||
// The cursor in windows other than the current one isn't always
|
||||
// up-to-date, esp. because of autocommands and timers.
|
||||
@@ -4326,7 +4332,7 @@ build_stl_str_hl(
|
||||
|
||||
// Fill up space left over by half a double-wide char.
|
||||
while (++l < stl_items[stl_groupitem[groupdepth]].stl_minwid)
|
||||
*p++ = fillchar;
|
||||
MB_CHAR2BYTES(fillchar, p);
|
||||
|
||||
// correct the start of the items for the truncation
|
||||
for (l = stl_groupitem[groupdepth] + 1; l < curitem; l++)
|
||||
@@ -4345,20 +4351,20 @@ build_stl_str_hl(
|
||||
// fill by appending characters
|
||||
n = 0 - n;
|
||||
while (l++ < n && p + 1 < out + outlen)
|
||||
*p++ = fillchar;
|
||||
MB_CHAR2BYTES(fillchar, p);
|
||||
}
|
||||
else
|
||||
{
|
||||
// fill by inserting characters
|
||||
mch_memmove(t + n - l, t, (size_t)(p - t));
|
||||
l = n - l;
|
||||
l = (n - l) * MB_CHAR2LEN(fillchar);
|
||||
mch_memmove(t + l, t, (size_t)(p - t));
|
||||
if (p + l >= out + outlen)
|
||||
l = (long)((out + outlen) - p - 1);
|
||||
p += l;
|
||||
for (n = stl_groupitem[groupdepth] + 1; n < curitem; n++)
|
||||
stl_items[n].stl_start += l;
|
||||
for ( ; l > 0; l--)
|
||||
*t++ = fillchar;
|
||||
MB_CHAR2BYTES(fillchar, t);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
@@ -4540,7 +4546,7 @@ build_stl_str_hl(
|
||||
case STL_VIRTCOL_ALT:
|
||||
// In list mode virtcol needs to be recomputed
|
||||
virtcol = wp->w_virtcol;
|
||||
if (wp->w_p_list && lcs_tab1 == NUL)
|
||||
if (wp->w_p_list && wp->w_lcs_chars.tab1 == NUL)
|
||||
{
|
||||
wp->w_p_list = FALSE;
|
||||
getvcol(wp, &wp->w_cursor, NULL, &virtcol, NULL);
|
||||
@@ -4737,23 +4743,24 @@ build_stl_str_hl(
|
||||
if (l + 1 == minwid && fillchar == '-' && VIM_ISDIGIT(*t))
|
||||
*p++ = ' ';
|
||||
else
|
||||
*p++ = fillchar;
|
||||
MB_CHAR2BYTES(fillchar, p);
|
||||
}
|
||||
minwid = 0;
|
||||
}
|
||||
else
|
||||
minwid *= -1;
|
||||
while (*t && p + 1 < out + outlen)
|
||||
for (; *t && p + 1 < out + outlen; t++)
|
||||
{
|
||||
*p++ = *t++;
|
||||
// Change a space by fillchar, unless fillchar is '-' and a
|
||||
// digit follows.
|
||||
if (fillable && p[-1] == ' '
|
||||
&& (!VIM_ISDIGIT(*t) || fillchar != '-'))
|
||||
p[-1] = fillchar;
|
||||
if (fillable && *t == ' '
|
||||
&& (!VIM_ISDIGIT(*(t + 1)) || fillchar != '-'))
|
||||
MB_CHAR2BYTES(fillchar, p);
|
||||
else
|
||||
*p++ = *t;
|
||||
}
|
||||
for (; l < minwid && p + 1 < out + outlen; l++)
|
||||
*p++ = fillchar;
|
||||
MB_CHAR2BYTES(fillchar, p);
|
||||
}
|
||||
else if (num >= 0)
|
||||
{
|
||||
@@ -4856,7 +4863,7 @@ build_stl_str_hl(
|
||||
}
|
||||
// Fill up for half a double-wide character.
|
||||
while (++width < maxwidth)
|
||||
*s++ = fillchar;
|
||||
MB_CHAR2BYTES(fillchar, s);
|
||||
}
|
||||
else
|
||||
s = out + maxwidth - 1;
|
||||
@@ -4888,7 +4895,7 @@ build_stl_str_hl(
|
||||
while (++width < maxwidth)
|
||||
{
|
||||
s = s + STRLEN(s);
|
||||
*s++ = fillchar;
|
||||
MB_CHAR2BYTES(fillchar, s);
|
||||
*s = NUL;
|
||||
}
|
||||
|
||||
@@ -4911,12 +4918,13 @@ build_stl_str_hl(
|
||||
break;
|
||||
if (l < itemcnt)
|
||||
{
|
||||
p = stl_items[l].stl_start + maxwidth - width;
|
||||
int middlelength = (maxwidth - width) * MB_CHAR2LEN(fillchar);
|
||||
p = stl_items[l].stl_start + middlelength;
|
||||
STRMOVE(p, stl_items[l].stl_start);
|
||||
for (s = stl_items[l].stl_start; s < p; s++)
|
||||
*s = fillchar;
|
||||
for (s = stl_items[l].stl_start; s < p;)
|
||||
MB_CHAR2BYTES(fillchar, s);
|
||||
for (l++; l < itemcnt; l++)
|
||||
stl_items[l].stl_start += maxwidth - width;
|
||||
stl_items[l].stl_start += middlelength;
|
||||
width = maxwidth;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1496,6 +1496,9 @@ buf_write(
|
||||
#endif
|
||||
#if defined(HAVE_SELINUX) || defined(HAVE_SMACK)
|
||||
mch_copy_sec(fname, backup);
|
||||
#endif
|
||||
#ifdef MSWIN
|
||||
(void)mch_copy_file_attribute(fname, backup);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -1909,12 +1912,7 @@ restore_backup:
|
||||
|
||||
#if defined(MSWIN)
|
||||
if (backup != NULL && overwriting && !append)
|
||||
{
|
||||
if (backup_copy)
|
||||
(void)mch_copy_file_attribute(wfname, backup);
|
||||
else
|
||||
(void)mch_copy_file_attribute(backup, wfname);
|
||||
}
|
||||
(void)mch_copy_file_attribute(backup, wfname);
|
||||
|
||||
if (!overwriting && !append)
|
||||
{
|
||||
|
||||
@@ -753,7 +753,7 @@ vim_strnsize(char_u *s, int len)
|
||||
|
||||
#ifdef FEAT_VARTABS
|
||||
# define RET_WIN_BUF_CHARTABSIZE(wp, buf, p, col) \
|
||||
if (*(p) == TAB && (!(wp)->w_p_list || lcs_tab1)) \
|
||||
if (*(p) == TAB && (!(wp)->w_p_list || wp->w_lcs_chars.tab1)) \
|
||||
{ \
|
||||
return tabstop_padding(col, (buf)->b_p_ts, (buf)->b_p_vts_array); \
|
||||
} \
|
||||
@@ -761,7 +761,7 @@ vim_strnsize(char_u *s, int len)
|
||||
return ptr2cells(p);
|
||||
#else
|
||||
# define RET_WIN_BUF_CHARTABSIZE(wp, buf, p, col) \
|
||||
if (*(p) == TAB && (!(wp)->w_p_list || lcs_tab1)) \
|
||||
if (*(p) == TAB && (!(wp)->w_p_list || wp->w_lcs_chars.tab1)) \
|
||||
{ \
|
||||
int ts; \
|
||||
ts = (buf)->b_p_ts; \
|
||||
@@ -1153,7 +1153,7 @@ win_nolbr_chartabsize(
|
||||
{
|
||||
int n;
|
||||
|
||||
if (*s == TAB && (!wp->w_p_list || lcs_tab1))
|
||||
if (*s == TAB && (!wp->w_p_list || wp->w_lcs_chars.tab1))
|
||||
{
|
||||
# ifdef FEAT_VARTABS
|
||||
return tabstop_padding(col, wp->w_buffer->b_p_ts,
|
||||
@@ -1248,7 +1248,7 @@ getvcol(
|
||||
* use a simple loop.
|
||||
* Also use this when 'list' is set but tabs take their normal size.
|
||||
*/
|
||||
if ((!wp->w_p_list || lcs_tab1 != NUL)
|
||||
if ((!wp->w_p_list || wp->w_lcs_chars.tab1 != NUL)
|
||||
#ifdef FEAT_LINEBREAK
|
||||
&& !wp->w_p_lbr && *get_showbreak_value(wp) == NUL && !wp->w_p_bri
|
||||
#endif
|
||||
|
||||
@@ -496,3 +496,6 @@
|
||||
|
||||
/* Define to inline symbol or empty */
|
||||
#undef inline
|
||||
|
||||
/* Define if _SC_SIGSTKSZ is available via sysconf() */
|
||||
#undef HAVE_SYSCONF_SIGSTKSZ
|
||||
|
||||
@@ -90,7 +90,7 @@ with_x_arg="$with_x"
|
||||
dnl Set default value for CFLAGS if none is defined or it's empty
|
||||
if test -z "$CFLAGS"; then
|
||||
CFLAGS="-O"
|
||||
test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall"
|
||||
test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall -Wno-deprecated-declarations"
|
||||
fi
|
||||
if test "$GCC" = yes; then
|
||||
dnl method that should work for nearly all versions
|
||||
@@ -127,8 +127,9 @@ if test x"$CLANG_VERSION_STRING" != x"" ; then
|
||||
dnl change the constant 500002075 below appropriately. To get the
|
||||
dnl integer corresponding to a version number, refer to the
|
||||
dnl definition of CLANG_VERSION above.
|
||||
dnl Clang 11 reports "11", assume Clang 10 and later work like this.
|
||||
AC_MSG_CHECKING(if clang supports -fno-strength-reduce)
|
||||
if test "$CLANG_VERSION" -ge 500002075 ; then
|
||||
if test "$CLANG_MAJOR" -ge 10 -o "$CLANG_VERSION" -ge 500002075 ; then
|
||||
AC_MSG_RESULT(no)
|
||||
CFLAGS=`echo "$CFLAGS" | sed -e 's/-fno-strength-reduce/ /'`
|
||||
else
|
||||
@@ -2447,6 +2448,7 @@ else
|
||||
yes|""|auto) AC_MSG_RESULT(yes/auto - automatic GUI support)
|
||||
gui_auto=yes
|
||||
SKIP_GTK2=
|
||||
SKIP_GTK3=
|
||||
SKIP_GNOME=
|
||||
SKIP_MOTIF=
|
||||
SKIP_ATHENA=
|
||||
@@ -2758,6 +2760,10 @@ if test -z "$SKIP_GTK2"; then
|
||||
if test "x$PKG_CONFIG" != "xno"; then
|
||||
dnl First try finding version 2.2.0 or later. The 2.0.x series has
|
||||
dnl problems (bold fonts, --remote doesn't work).
|
||||
dnl Disable checking for GTK3 here, otherwise it's found when GTK2 is not
|
||||
dnl found.
|
||||
save_skip_gtk3=$SKIP_GTK3
|
||||
SKIP_GTK3=YES
|
||||
AM_PATH_GTK(2.2.0,
|
||||
[GUI_LIB_LOC="$GTK_LIBDIR"
|
||||
GTK_LIBNAME="$GTK_LIBS"
|
||||
@@ -2769,6 +2775,8 @@ if test -z "$SKIP_GTK2"; then
|
||||
SKIP_MOTIF=YES
|
||||
GUITYPE=GTK
|
||||
AC_SUBST(GTK_LIBNAME)
|
||||
else
|
||||
SKIP_GTK3=$save_skip_gtk3
|
||||
fi
|
||||
fi
|
||||
if test "x$GUITYPE" = "xGTK"; then
|
||||
@@ -2804,6 +2812,8 @@ if test -z "$SKIP_GTK3"; then
|
||||
fi
|
||||
|
||||
if test "x$PKG_CONFIG" != "xno"; then
|
||||
save_skip_gtk2=$SKIP_GTK2
|
||||
SKIP_GTK2=YES
|
||||
AM_PATH_GTK(3.0.0,
|
||||
[GUI_LIB_LOC="$GTK_LIBDIR"
|
||||
GTK_LIBNAME="$GTK_LIBS"
|
||||
@@ -2817,6 +2827,8 @@ if test -z "$SKIP_GTK3"; then
|
||||
GUITYPE=GTK
|
||||
AC_SUBST(GTK_LIBNAME)
|
||||
AC_DEFINE(USE_GTK3)
|
||||
else
|
||||
SKIP_GTK2=$save_skip_gtk2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -4093,6 +4105,15 @@ AC_TRY_COMPILE(
|
||||
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCONF),
|
||||
AC_MSG_RESULT(not usable))
|
||||
|
||||
dnl check if we have _SC_SIGSTKSZ via sysconf()
|
||||
AC_MSG_CHECKING(for _SC_SIGSTKSZ via sysconf())
|
||||
AC_TRY_COMPILE(
|
||||
[#include <unistd.h>],
|
||||
[ (void)sysconf(_SC_SIGSTKSZ);
|
||||
],
|
||||
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCONF_SIGSTKSZ),
|
||||
AC_MSG_RESULT(not usable))
|
||||
|
||||
AC_CHECK_SIZEOF([int])
|
||||
AC_CHECK_SIZEOF([long])
|
||||
AC_CHECK_SIZEOF([time_t])
|
||||
|
||||
@@ -864,7 +864,7 @@ has_profiling(
|
||||
*/
|
||||
static linenr_T
|
||||
debuggy_find(
|
||||
int file, // TRUE for a file, FALSE for a function
|
||||
int is_file, // TRUE for a file, FALSE for a function
|
||||
char_u *fname, // file or function name
|
||||
linenr_T after, // after this line number
|
||||
garray_T *gap, // either &dbg_breakp or &prof_ga
|
||||
@@ -873,20 +873,25 @@ debuggy_find(
|
||||
struct debuggy *bp;
|
||||
int i;
|
||||
linenr_T lnum = 0;
|
||||
char_u *name = fname;
|
||||
char_u *name = NULL;
|
||||
char_u *short_name = fname;
|
||||
int prev_got_int;
|
||||
|
||||
// Return quickly when there are no breakpoints.
|
||||
if (gap->ga_len == 0)
|
||||
return (linenr_T)0;
|
||||
|
||||
// Replace K_SNR in function name with "<SNR>".
|
||||
if (!file && fname[0] == K_SPECIAL)
|
||||
// For a script-local function remove the prefix, so that
|
||||
// "profile func Func" matches "Func" in any script. Otherwise it's very
|
||||
// difficult to profile/debug a script-local function. It may match a
|
||||
// function in the wrong script, but that is much better than not being
|
||||
// able to profile/debug a function in a script with unknown ID.
|
||||
// Also match a script-specific name.
|
||||
if (!is_file && fname[0] == K_SPECIAL)
|
||||
{
|
||||
short_name = vim_strchr(fname, '_') + 1;
|
||||
name = alloc(STRLEN(fname) + 3);
|
||||
if (name == NULL)
|
||||
name = fname;
|
||||
else
|
||||
if (name != NULL)
|
||||
{
|
||||
STRCPY(name, "<SNR>");
|
||||
STRCPY(name + 5, fname + 3);
|
||||
@@ -898,8 +903,8 @@ debuggy_find(
|
||||
// Skip entries that are not useful or are for a line that is beyond
|
||||
// an already found breakpoint.
|
||||
bp = &DEBUGGY(gap, i);
|
||||
if (((bp->dbg_type == DBG_FILE) == file &&
|
||||
bp->dbg_type != DBG_EXPR && (
|
||||
if (((bp->dbg_type == DBG_FILE) == is_file
|
||||
&& bp->dbg_type != DBG_EXPR && (
|
||||
#ifdef FEAT_PROFILE
|
||||
gap == &prof_ga ||
|
||||
#endif
|
||||
@@ -910,7 +915,10 @@ debuggy_find(
|
||||
// while matching should abort it.
|
||||
prev_got_int = got_int;
|
||||
got_int = FALSE;
|
||||
if (vim_regexec_prog(&bp->dbg_prog, FALSE, name, (colnr_T)0))
|
||||
if ((name != NULL
|
||||
&& vim_regexec_prog(&bp->dbg_prog, FALSE, name, (colnr_T)0))
|
||||
|| vim_regexec_prog(&bp->dbg_prog, FALSE,
|
||||
short_name, (colnr_T)0))
|
||||
{
|
||||
lnum = bp->dbg_lnum;
|
||||
if (fp != NULL)
|
||||
@@ -932,9 +940,9 @@ debuggy_find(
|
||||
{
|
||||
if (bp->dbg_val == NULL)
|
||||
{
|
||||
debug_oldval = typval_tostring(NULL);
|
||||
debug_oldval = typval_tostring(NULL, TRUE);
|
||||
bp->dbg_val = tv;
|
||||
debug_newval = typval_tostring(bp->dbg_val);
|
||||
debug_newval = typval_tostring(bp->dbg_val, TRUE);
|
||||
line = TRUE;
|
||||
}
|
||||
else
|
||||
@@ -945,11 +953,11 @@ debuggy_find(
|
||||
typval_T *v;
|
||||
|
||||
line = TRUE;
|
||||
debug_oldval = typval_tostring(bp->dbg_val);
|
||||
debug_oldval = typval_tostring(bp->dbg_val, TRUE);
|
||||
// Need to evaluate again, typval_compare() overwrites
|
||||
// "tv".
|
||||
v = eval_expr(bp->dbg_name, NULL);
|
||||
debug_newval = typval_tostring(v);
|
||||
debug_newval = typval_tostring(v, TRUE);
|
||||
free_tv(bp->dbg_val);
|
||||
bp->dbg_val = v;
|
||||
}
|
||||
@@ -958,8 +966,8 @@ debuggy_find(
|
||||
}
|
||||
else if (bp->dbg_val != NULL)
|
||||
{
|
||||
debug_oldval = typval_tostring(bp->dbg_val);
|
||||
debug_newval = typval_tostring(NULL);
|
||||
debug_oldval = typval_tostring(bp->dbg_val, TRUE);
|
||||
debug_newval = typval_tostring(NULL, TRUE);
|
||||
free_tv(bp->dbg_val);
|
||||
bp->dbg_val = NULL;
|
||||
line = TRUE;
|
||||
|
||||
22
src/dict.c
22
src/dict.c
@@ -945,7 +945,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
|
||||
if (**arg != ':')
|
||||
{
|
||||
if (*skipwhite(*arg) == ':')
|
||||
semsg(_(e_no_white_space_allowed_before_str), ":");
|
||||
semsg(_(e_no_white_space_allowed_before_str_str), ":", *arg);
|
||||
else
|
||||
semsg(_(e_missing_dict_colon), *arg);
|
||||
clear_tv(&tvkey);
|
||||
@@ -953,11 +953,13 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
|
||||
}
|
||||
if (evaluate)
|
||||
{
|
||||
if (vim9script && check_for_string(&tvkey) == FAIL)
|
||||
#ifdef FEAT_FLOAT
|
||||
if (tvkey.v_type == VAR_FLOAT)
|
||||
{
|
||||
clear_tv(&tvkey);
|
||||
goto failret;
|
||||
tvkey.vval.v_string = typval_tostring(&tvkey, TRUE);
|
||||
tvkey.v_type = VAR_STRING;
|
||||
}
|
||||
#endif
|
||||
key = tv_get_string_buf_chk(&tvkey, buf);
|
||||
if (key == NULL)
|
||||
{
|
||||
@@ -968,7 +970,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
|
||||
}
|
||||
if (vim9script && (*arg)[1] != NUL && !VIM_ISWHITE((*arg)[1]))
|
||||
{
|
||||
semsg(_(e_white_space_required_after_str), ":");
|
||||
semsg(_(e_white_space_required_after_str_str), ":", *arg);
|
||||
clear_tv(&tvkey);
|
||||
goto failret;
|
||||
}
|
||||
@@ -1010,7 +1012,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
|
||||
{
|
||||
if (vim9script && (*arg)[1] != NUL && !VIM_ISWHITE((*arg)[1]))
|
||||
{
|
||||
semsg(_(e_white_space_required_after_str), ",");
|
||||
semsg(_(e_white_space_required_after_str_str), ",", *arg);
|
||||
goto failret;
|
||||
}
|
||||
*arg = skipwhite(*arg + 1);
|
||||
@@ -1023,7 +1025,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
|
||||
if (!had_comma)
|
||||
{
|
||||
if (**arg == ',')
|
||||
semsg(_(e_no_white_space_allowed_before_str), ",");
|
||||
semsg(_(e_no_white_space_allowed_before_str_str), ",", *arg);
|
||||
else
|
||||
semsg(_(e_missing_dict_comma), *arg);
|
||||
goto failret;
|
||||
@@ -1032,7 +1034,8 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
|
||||
|
||||
if (**arg != '}')
|
||||
{
|
||||
semsg(_(e_missing_dict_end), *arg);
|
||||
if (evalarg != NULL)
|
||||
semsg(_(e_missing_dict_end), *arg);
|
||||
failret:
|
||||
if (d != NULL)
|
||||
dict_free(d);
|
||||
@@ -1086,7 +1089,8 @@ dict_extend(dict_T *d1, dict_T *d2, char_u *action)
|
||||
}
|
||||
|
||||
if (type != NULL
|
||||
&& check_typval_type(type, &HI2DI(hi2)->di_tv, 0) == FAIL)
|
||||
&& check_typval_arg_type(type, &HI2DI(hi2)->di_tv, 0)
|
||||
== FAIL)
|
||||
break;
|
||||
|
||||
if (di1 == NULL)
|
||||
|
||||
22
src/diff.c
22
src/diff.c
@@ -36,6 +36,7 @@ static int diff_need_update = FALSE; // ex_diffupdate needs to be called
|
||||
#define DIFF_HIDDEN_OFF 0x100 // diffoff when hidden
|
||||
#define DIFF_INTERNAL 0x200 // use internal xdiff algorithm
|
||||
#define DIFF_CLOSE_OFF 0x400 // diffoff when closing window
|
||||
#define DIFF_FOLLOWWRAP 0x800 // follow the wrap option
|
||||
#define ALL_WHITE_DIFF (DIFF_IWHITE | DIFF_IWHITEALL | DIFF_IWHITEEOL)
|
||||
static int diff_flags = DIFF_INTERNAL | DIFF_FILLER | DIFF_CLOSE_OFF;
|
||||
|
||||
@@ -1454,9 +1455,12 @@ diff_win_options(
|
||||
if (!wp->w_p_diff)
|
||||
wp->w_p_crb_save = wp->w_p_crb;
|
||||
wp->w_p_crb = TRUE;
|
||||
if (!wp->w_p_diff)
|
||||
wp->w_p_wrap_save = wp->w_p_wrap;
|
||||
wp->w_p_wrap = FALSE;
|
||||
if (!(diff_flags & DIFF_FOLLOWWRAP))
|
||||
{
|
||||
if (!wp->w_p_diff)
|
||||
wp->w_p_wrap_save = wp->w_p_wrap;
|
||||
wp->w_p_wrap = FALSE;
|
||||
}
|
||||
# ifdef FEAT_FOLDING
|
||||
if (!wp->w_p_diff)
|
||||
{
|
||||
@@ -1517,8 +1521,11 @@ ex_diffoff(exarg_T *eap)
|
||||
wp->w_p_scb = wp->w_p_scb_save;
|
||||
if (wp->w_p_crb)
|
||||
wp->w_p_crb = wp->w_p_crb_save;
|
||||
if (!wp->w_p_wrap)
|
||||
wp->w_p_wrap = wp->w_p_wrap_save;
|
||||
if (!(diff_flags & DIFF_FOLLOWWRAP))
|
||||
{
|
||||
if (!wp->w_p_wrap)
|
||||
wp->w_p_wrap = wp->w_p_wrap_save;
|
||||
}
|
||||
#ifdef FEAT_FOLDING
|
||||
free_string_option(wp->w_p_fdm);
|
||||
wp->w_p_fdm = vim_strsave(
|
||||
@@ -2245,6 +2252,11 @@ diffopt_changed(void)
|
||||
p += 8;
|
||||
diff_flags_new |= DIFF_CLOSE_OFF;
|
||||
}
|
||||
else if (STRNCMP(p, "followwrap", 10) == 0)
|
||||
{
|
||||
p += 10;
|
||||
diff_flags_new |= DIFF_FOLLOWWRAP;
|
||||
}
|
||||
else if (STRNCMP(p, "indent-heuristic", 16) == 0)
|
||||
{
|
||||
p += 16;
|
||||
|
||||
115
src/drawline.c
115
src/drawline.c
@@ -248,9 +248,9 @@ win_line(
|
||||
int c_final = NUL; // final char, mandatory if set
|
||||
int extra_attr = 0; // attributes when n_extra != 0
|
||||
static char_u *at_end_str = (char_u *)""; // used for p_extra when
|
||||
// displaying lcs_eol at end-of-line
|
||||
int lcs_eol_one = lcs_eol; // lcs_eol until it's been used
|
||||
int lcs_prec_todo = lcs_prec; // lcs_prec until it's been used
|
||||
// displaying eol at end-of-line
|
||||
int lcs_eol_one = wp->w_lcs_chars.eol; // eol until it's been used
|
||||
int lcs_prec_todo = wp->w_lcs_chars.prec; // prec until it's been used
|
||||
|
||||
// saved "extra" items for when draw_state becomes WL_LINE (again)
|
||||
int saved_n_extra = 0;
|
||||
@@ -339,6 +339,7 @@ win_line(
|
||||
int change_end = -1; // last col of changed area
|
||||
#endif
|
||||
colnr_T trailcol = MAXCOL; // start of trailing spaces
|
||||
colnr_T leadcol = 0; // start of leading spaces
|
||||
#ifdef FEAT_LINEBREAK
|
||||
int need_showbreak = FALSE; // overlong line, skipping first x
|
||||
// chars
|
||||
@@ -734,16 +735,33 @@ win_line(
|
||||
|
||||
if (wp->w_p_list)
|
||||
{
|
||||
if (lcs_space || lcs_trail || lcs_nbsp)
|
||||
if (wp->w_lcs_chars.space
|
||||
|| wp->w_lcs_chars.trail
|
||||
|| wp->w_lcs_chars.lead
|
||||
|| wp->w_lcs_chars.nbsp)
|
||||
extra_check = TRUE;
|
||||
|
||||
// find start of trailing whitespace
|
||||
if (lcs_trail)
|
||||
if (wp->w_lcs_chars.trail)
|
||||
{
|
||||
trailcol = (colnr_T)STRLEN(ptr);
|
||||
while (trailcol > (colnr_T)0 && VIM_ISWHITE(ptr[trailcol - 1]))
|
||||
--trailcol;
|
||||
trailcol += (colnr_T) (ptr - line);
|
||||
}
|
||||
// find end of leading whitespace
|
||||
if (wp->w_lcs_chars.lead)
|
||||
{
|
||||
leadcol = 0;
|
||||
while (VIM_ISWHITE(ptr[leadcol]))
|
||||
++leadcol;
|
||||
if (ptr[leadcol] == NUL)
|
||||
// in a line full of spaces all of them are treated as trailing
|
||||
leadcol = (colnr_T)0;
|
||||
else
|
||||
// keep track of the first column not filled with spaces
|
||||
leadcol += (colnr_T) (ptr - line) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
wcr_attr = get_wcr_attr(wp);
|
||||
@@ -1013,12 +1031,11 @@ win_line(
|
||||
// Draw the 'foldcolumn'. Allocate a buffer, "extra" may
|
||||
// already be in use.
|
||||
vim_free(p_extra_free);
|
||||
p_extra_free = alloc(12 + 1);
|
||||
|
||||
p_extra_free = alloc(MAX_MCO * fdc + 1);
|
||||
if (p_extra_free != NULL)
|
||||
{
|
||||
fill_foldcolumn(p_extra_free, wp, FALSE, lnum);
|
||||
n_extra = fdc;
|
||||
n_extra = fill_foldcolumn(p_extra_free, wp,
|
||||
FALSE, lnum);
|
||||
p_extra_free[n_extra] = NUL;
|
||||
p_extra = p_extra_free;
|
||||
c_extra = NUL;
|
||||
@@ -1403,7 +1420,12 @@ win_line(
|
||||
// Add any text property that starts in this column.
|
||||
while (text_prop_next < text_prop_count
|
||||
&& bcol >= text_props[text_prop_next].tp_col - 1)
|
||||
text_prop_idxs[text_props_active++] = text_prop_next++;
|
||||
{
|
||||
if (bcol <= text_props[text_prop_next].tp_col - 1
|
||||
+ text_props[text_prop_next].tp_len)
|
||||
text_prop_idxs[text_props_active++] = text_prop_next;
|
||||
++text_prop_next;
|
||||
}
|
||||
|
||||
text_prop_attr = 0;
|
||||
text_prop_combine = FALSE;
|
||||
@@ -1980,21 +2002,23 @@ win_line(
|
||||
}
|
||||
#endif
|
||||
|
||||
// 'list': Change char 160 to lcs_nbsp and space to lcs_space.
|
||||
// But not when the character is followed by a composing
|
||||
// character (use mb_l to check that).
|
||||
// 'list': Change char 160 to 'nbsp' and space to 'space'
|
||||
// setting in 'listchars'. But not when the character is
|
||||
// followed by a composing character (use mb_l to check that).
|
||||
if (wp->w_p_list
|
||||
&& ((((c == 160 && mb_l == 1)
|
||||
|| (mb_utf8
|
||||
&& ((mb_c == 160 && mb_l == 2)
|
||||
|| (mb_c == 0x202f && mb_l == 3))))
|
||||
&& lcs_nbsp)
|
||||
&& wp->w_lcs_chars.nbsp)
|
||||
|| (c == ' '
|
||||
&& mb_l == 1
|
||||
&& lcs_space
|
||||
&& wp->w_lcs_chars.space
|
||||
&& ptr - line >= leadcol
|
||||
&& ptr - line <= trailcol)))
|
||||
{
|
||||
c = (c == ' ') ? lcs_space : lcs_nbsp;
|
||||
c = (c == ' ') ? wp->w_lcs_chars.space :
|
||||
wp->w_lcs_chars.nbsp;
|
||||
if (area_attr == 0 && search_attr == 0)
|
||||
{
|
||||
n_attr = 1;
|
||||
@@ -2012,9 +2036,11 @@ win_line(
|
||||
mb_utf8 = FALSE;
|
||||
}
|
||||
|
||||
if (trailcol != MAXCOL && ptr > line + trailcol && c == ' ')
|
||||
if ((trailcol != MAXCOL && ptr > line + trailcol && c == ' ')
|
||||
|| (leadcol != 0 && ptr < line + leadcol && c == ' '))
|
||||
{
|
||||
c = lcs_trail;
|
||||
c = (ptr > line + trailcol) ? wp->w_lcs_chars.trail
|
||||
: wp->w_lcs_chars.lead;
|
||||
if (!attr_pri)
|
||||
{
|
||||
n_attr = 1;
|
||||
@@ -2039,7 +2065,7 @@ win_line(
|
||||
// when getting a character from the file, we may have to
|
||||
// turn it into something else on the way to putting it
|
||||
// into "ScreenLines".
|
||||
if (c == TAB && (!wp->w_p_list || lcs_tab1))
|
||||
if (c == TAB && (!wp->w_p_list || wp->w_lcs_chars.tab1))
|
||||
{
|
||||
int tab_len = 0;
|
||||
long vcol_adjusted = vcol; // removed showbreak length
|
||||
@@ -2079,18 +2105,19 @@ win_line(
|
||||
// there are characters to conceal
|
||||
tab_len += vcol_off;
|
||||
// boguscols before FIX_FOR_BOGUSCOLS macro from above
|
||||
if (wp->w_p_list && lcs_tab1 && old_boguscols > 0
|
||||
&& n_extra > tab_len)
|
||||
if (wp->w_p_list && wp->w_lcs_chars.tab1
|
||||
&& old_boguscols > 0
|
||||
&& n_extra > tab_len)
|
||||
tab_len += n_extra - tab_len;
|
||||
#endif
|
||||
|
||||
// if n_extra > 0, it gives the number of chars, to
|
||||
// use for a tab, else we need to calculate the width
|
||||
// for a tab
|
||||
len = (tab_len * mb_char2len(lcs_tab2));
|
||||
len = (tab_len * mb_char2len(wp->w_lcs_chars.tab2));
|
||||
if (n_extra > 0)
|
||||
len += n_extra - tab_len;
|
||||
c = lcs_tab1;
|
||||
c = wp->w_lcs_chars.tab1;
|
||||
p = alloc(len + 1);
|
||||
vim_memset(p, ' ', len);
|
||||
p[len] = NUL;
|
||||
@@ -2098,7 +2125,7 @@ win_line(
|
||||
p_extra_free = p;
|
||||
for (i = 0; i < tab_len; i++)
|
||||
{
|
||||
int lcs = lcs_tab2;
|
||||
int lcs = wp->w_lcs_chars.tab2;
|
||||
|
||||
if (*p == NUL)
|
||||
{
|
||||
@@ -2106,10 +2133,10 @@ win_line(
|
||||
break;
|
||||
}
|
||||
|
||||
// if lcs_tab3 is given, need to change the char
|
||||
// if tab3 is given, need to change the char
|
||||
// for tab
|
||||
if (lcs_tab3 && i == tab_len - 1)
|
||||
lcs = lcs_tab3;
|
||||
if (wp->w_lcs_chars.tab3 && i == tab_len - 1)
|
||||
lcs = wp->w_lcs_chars.tab3;
|
||||
mb_char2bytes(lcs, p);
|
||||
p += mb_char2len(lcs);
|
||||
n_extra += mb_char2len(lcs)
|
||||
@@ -2140,21 +2167,23 @@ win_line(
|
||||
// correctly set further below (effectively reverts the
|
||||
// FIX_FOR_BOGSUCOLS macro
|
||||
if (n_extra == tab_len + vc_saved && wp->w_p_list
|
||||
&& lcs_tab1)
|
||||
&& wp->w_lcs_chars.tab1)
|
||||
tab_len += vc_saved;
|
||||
}
|
||||
#endif
|
||||
mb_utf8 = FALSE; // don't draw as UTF-8
|
||||
if (wp->w_p_list)
|
||||
{
|
||||
c = (n_extra == 0 && lcs_tab3) ? lcs_tab3 : lcs_tab1;
|
||||
c = (n_extra == 0 && wp->w_lcs_chars.tab3)
|
||||
? wp->w_lcs_chars.tab3
|
||||
: wp->w_lcs_chars.tab1;
|
||||
#ifdef FEAT_LINEBREAK
|
||||
if (wp->w_p_lbr)
|
||||
c_extra = NUL; // using p_extra from above
|
||||
else
|
||||
#endif
|
||||
c_extra = lcs_tab2;
|
||||
c_final = lcs_tab3;
|
||||
c_extra = wp->w_lcs_chars.tab2;
|
||||
c_final = wp->w_lcs_chars.tab3;
|
||||
n_attr = tab_len + 1;
|
||||
extra_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_8));
|
||||
saved_attr2 = char_attr; // save current attr
|
||||
@@ -2219,8 +2248,8 @@ win_line(
|
||||
c_final = NUL;
|
||||
}
|
||||
}
|
||||
if (wp->w_p_list && lcs_eol > 0)
|
||||
c = lcs_eol;
|
||||
if (wp->w_p_list && wp->w_lcs_chars.eol > 0)
|
||||
c = wp->w_lcs_chars.eol;
|
||||
else
|
||||
c = ' ';
|
||||
lcs_eol_one = -1;
|
||||
@@ -2322,7 +2351,8 @@ win_line(
|
||||
// don't do search HL for the rest of the line
|
||||
if (line_attr != 0 && char_attr == search_attr
|
||||
&& (did_line_attr > 1
|
||||
|| (wp->w_p_list && lcs_eol > 0)))
|
||||
|| (wp->w_p_list &&
|
||||
wp->w_lcs_chars.eol > 0)))
|
||||
char_attr = line_attr;
|
||||
# ifdef FEAT_DIFF
|
||||
if (diff_hlf == HLF_TXD)
|
||||
@@ -2382,8 +2412,8 @@ win_line(
|
||||
c = match_conc;
|
||||
else if (syn_get_sub_char() != NUL)
|
||||
c = syn_get_sub_char();
|
||||
else if (lcs_conceal != NUL)
|
||||
c = lcs_conceal;
|
||||
else if (wp->w_lcs_chars.conceal != NUL)
|
||||
c = wp->w_lcs_chars.conceal;
|
||||
else
|
||||
c = ' ';
|
||||
|
||||
@@ -2526,7 +2556,7 @@ win_line(
|
||||
&& draw_state > WL_NR
|
||||
&& c != NUL)
|
||||
{
|
||||
c = lcs_prec;
|
||||
c = wp->w_lcs_chars.prec;
|
||||
lcs_prec_todo = NUL;
|
||||
if (has_mbyte && (*mb_char2cells)(mb_c) > 1)
|
||||
{
|
||||
@@ -2572,7 +2602,7 @@ win_line(
|
||||
// highlight match at end of line. If it's beyond the last
|
||||
// char on the screen, just overwrite that one (tricky!) Not
|
||||
// needed when a '$' was displayed for 'list'.
|
||||
if (lcs_eol == lcs_eol_one
|
||||
if (wp->w_lcs_chars.eol == lcs_eol_one
|
||||
&& ((area_attr != 0 && vcol == fromcol
|
||||
&& (VIsual_mode != Ctrl_V
|
||||
|| lnum == VIsual.lnum
|
||||
@@ -2742,7 +2772,7 @@ win_line(
|
||||
|
||||
// Show "extends" character from 'listchars' if beyond the line end and
|
||||
// 'list' is set.
|
||||
if (lcs_ext != NUL
|
||||
if (wp->w_lcs_chars.ext != NUL
|
||||
&& wp->w_p_list
|
||||
&& !wp->w_p_wrap
|
||||
#ifdef FEAT_DIFF
|
||||
@@ -2757,7 +2787,7 @@ win_line(
|
||||
|| (wp->w_p_list && lcs_eol_one > 0)
|
||||
|| (n_extra && (c_extra != NUL || *p_extra != NUL))))
|
||||
{
|
||||
c = lcs_ext;
|
||||
c = wp->w_lcs_chars.ext;
|
||||
char_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_AT));
|
||||
mb_c = c;
|
||||
if (enc_utf8 && utf_char2len(c) > 1)
|
||||
@@ -3014,7 +3044,8 @@ win_line(
|
||||
#ifdef FEAT_DIFF
|
||||
|| filler_todo > 0
|
||||
#endif
|
||||
|| (wp->w_p_list && lcs_eol != NUL && p_extra != at_end_str)
|
||||
|| (wp->w_p_list && wp->w_lcs_chars.eol != NUL
|
||||
&& p_extra != at_end_str)
|
||||
|| (n_extra != 0 && (c_extra != NUL || *p_extra != NUL)))
|
||||
)
|
||||
{
|
||||
@@ -3139,7 +3170,7 @@ win_line(
|
||||
#endif
|
||||
saved_char_attr = 0;
|
||||
n_extra = 0;
|
||||
lcs_prec_todo = lcs_prec;
|
||||
lcs_prec_todo = wp->w_lcs_chars.prec;
|
||||
#ifdef FEAT_LINEBREAK
|
||||
# ifdef FEAT_DIFF
|
||||
if (filler_todo <= 0)
|
||||
|
||||
@@ -696,7 +696,7 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum)
|
||||
|
||||
// In list mode virtcol needs to be recomputed
|
||||
virtcol = wp->w_virtcol;
|
||||
if (wp->w_p_list && lcs_tab1 == NUL)
|
||||
if (wp->w_p_list && wp->w_lcs_chars.tab1 == NUL)
|
||||
{
|
||||
wp->w_p_list = FALSE;
|
||||
getvvcol(wp, &wp->w_cursor, NULL, &virtcol, NULL);
|
||||
@@ -1044,7 +1044,9 @@ fold_line(
|
||||
linenr_T lnum,
|
||||
int row)
|
||||
{
|
||||
char_u buf[FOLD_TEXT_LEN];
|
||||
// Max value of 'foldcolumn' is 12 and maximum number of bytes in a
|
||||
// multi-byte character is MAX_MCO.
|
||||
char_u buf[MAX_MCO * 12 + 1];
|
||||
pos_T *top, *bot;
|
||||
linenr_T lnume = lnum + fold_count - 1;
|
||||
int len;
|
||||
@@ -1077,29 +1079,6 @@ fold_line(
|
||||
}
|
||||
#endif
|
||||
|
||||
// 2. Add the 'foldcolumn'
|
||||
// Reduce the width when there is not enough space.
|
||||
fdc = compute_foldcolumn(wp, col);
|
||||
if (fdc > 0)
|
||||
{
|
||||
fill_foldcolumn(buf, wp, TRUE, lnum);
|
||||
#ifdef FEAT_RIGHTLEFT
|
||||
if (wp->w_p_rl)
|
||||
{
|
||||
int i;
|
||||
|
||||
copy_text_attr(off + wp->w_width - fdc - col, buf, fdc,
|
||||
HL_ATTR(HLF_FC));
|
||||
// reverse the fold column
|
||||
for (i = 0; i < fdc; ++i)
|
||||
ScreenLines[off + wp->w_width - i - 1 - col] = buf[i];
|
||||
}
|
||||
else
|
||||
#endif
|
||||
copy_text_attr(off + col, buf, fdc, HL_ATTR(HLF_FC));
|
||||
col += fdc;
|
||||
}
|
||||
|
||||
#ifdef FEAT_RIGHTLEFT
|
||||
# define RL_MEMSET(p, v, l) \
|
||||
do { \
|
||||
@@ -1118,6 +1097,53 @@ fold_line(
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
// 2. Add the 'foldcolumn'
|
||||
// Reduce the width when there is not enough space.
|
||||
fdc = compute_foldcolumn(wp, col);
|
||||
if (fdc > 0)
|
||||
{
|
||||
char_u *p;
|
||||
int i;
|
||||
int idx;
|
||||
|
||||
fill_foldcolumn(buf, wp, TRUE, lnum);
|
||||
p = buf;
|
||||
for (i = 0; i < fdc; i++)
|
||||
{
|
||||
int ch;
|
||||
|
||||
if (has_mbyte)
|
||||
ch = mb_ptr2char_adv(&p);
|
||||
else
|
||||
ch = *p++;
|
||||
#ifdef FEAT_RIGHTLEFT
|
||||
if (wp->w_p_rl)
|
||||
idx = off + wp->w_width - i - 1 - col;
|
||||
else
|
||||
#endif
|
||||
idx = off + col + i;
|
||||
if (enc_utf8)
|
||||
{
|
||||
if (ch >= 0x80)
|
||||
{
|
||||
ScreenLinesUC[idx] = ch;
|
||||
ScreenLinesC[0][idx] = 0;
|
||||
ScreenLines[idx] = 0x80;
|
||||
}
|
||||
else
|
||||
{
|
||||
ScreenLines[idx] = ch;
|
||||
ScreenLinesUC[idx] = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
ScreenLines[idx] = ch;
|
||||
}
|
||||
|
||||
RL_MEMSET(col, HL_ATTR(HLF_FC), fdc);
|
||||
col += fdc;
|
||||
}
|
||||
|
||||
// Set all attributes of the 'number' or 'relativenumber' column and the
|
||||
// text
|
||||
RL_MEMSET(col, HL_ATTR(HLF_FL), wp->w_width - col);
|
||||
@@ -2552,11 +2578,11 @@ win_update(win_T *wp)
|
||||
wp->w_botline = lnum;
|
||||
|
||||
// Make sure the rest of the screen is blank
|
||||
// put '~'s on rows that aren't part of the file.
|
||||
// write the 'fill_eob' character to rows that aren't part of the file
|
||||
if (WIN_IS_POPUP(wp))
|
||||
win_draw_end(wp, ' ', ' ', FALSE, row, wp->w_height, HLF_AT);
|
||||
else
|
||||
win_draw_end(wp, '~', ' ', FALSE, row, wp->w_height, HLF_EOB);
|
||||
win_draw_end(wp, fill_eob, ' ', FALSE, row, wp->w_height, HLF_EOB);
|
||||
}
|
||||
|
||||
#ifdef SYN_TIME_LIMIT
|
||||
|
||||
@@ -196,6 +196,10 @@ edit(
|
||||
#endif
|
||||
ins_apply_autocmds(EVENT_INSERTENTER);
|
||||
|
||||
// Check for changed highlighting, e.g. for ModeMsg.
|
||||
if (need_highlight_changed)
|
||||
highlight_changed();
|
||||
|
||||
// Make sure the cursor didn't move. Do call check_cursor_col() in
|
||||
// case the text was modified. Since Insert mode was not started yet
|
||||
// a call to check_cursor_col() may move the cursor, especially with
|
||||
@@ -1586,7 +1590,7 @@ decodeModifyOtherKeys(int c)
|
||||
// Recognize:
|
||||
// form 0: {lead}{key};{modifier}u
|
||||
// form 1: {lead}27;{modifier};{key}~
|
||||
if ((c == CSI || (c == ESC && *p == '[')) && typebuf.tb_len >= 4)
|
||||
if (typebuf.tb_len >= 4 && (c == CSI || (c == ESC && *p == '[')))
|
||||
{
|
||||
idx = (*p == '[');
|
||||
if (p[idx] == '2' && p[idx + 1] == '7' && p[idx + 2] == ';')
|
||||
|
||||
42
src/errors.h
42
src/errors.h
@@ -84,7 +84,7 @@ EXTERN char e_const_requires_a_value[]
|
||||
EXTERN char e_type_or_initialization_required[]
|
||||
INIT(= N_("E1022: Type or initialization required"));
|
||||
EXTERN char e_using_number_as_bool_nr[]
|
||||
INIT(= N_("E1023: Using a Number as a Bool: %d"));
|
||||
INIT(= N_("E1023: Using a Number as a Bool: %lld"));
|
||||
EXTERN char e_using_number_as_string[]
|
||||
INIT(= N_("E1024: Using a Number as a String"));
|
||||
EXTERN char e_using_rcurly_outside_if_block_scope[]
|
||||
@@ -147,7 +147,7 @@ EXTERN char e_cannot_declare_an_option[]
|
||||
INIT(= N_("E1052: Cannot declare an option: %s"));
|
||||
EXTERN char e_could_not_import_str[]
|
||||
INIT(= N_("E1053: Could not import \"%s\""));
|
||||
EXTERN char e_variable_already_declared_in_script[]
|
||||
EXTERN char e_variable_already_declared_in_script_str[]
|
||||
INIT(= N_("E1054: Variable already declared in the script: %s"));
|
||||
EXTERN char e_missing_name_after_dots[]
|
||||
INIT(= N_("E1055: Missing name after ..."));
|
||||
@@ -173,10 +173,10 @@ EXTERN char e_cannot_declare_a_register_str[]
|
||||
INIT(= N_("E1066: Cannot declare a register: %s"));
|
||||
EXTERN char e_separator_mismatch_str[]
|
||||
INIT(= N_("E1067: Separator mismatch: %s"));
|
||||
EXTERN char e_no_white_space_allowed_before_str[]
|
||||
INIT(= N_("E1068: No white space allowed before '%s'"));
|
||||
EXTERN char e_white_space_required_after_str[]
|
||||
INIT(= N_("E1069: White space required after '%s'"));
|
||||
EXTERN char e_no_white_space_allowed_before_str_str[]
|
||||
INIT(= N_("E1068: No white space allowed before '%s': %s"));
|
||||
EXTERN char e_white_space_required_after_str_str[]
|
||||
INIT(= N_("E1069: White space required after '%s': %s"));
|
||||
EXTERN char e_missing_from[]
|
||||
INIT(= N_("E1070: Missing \"from\""));
|
||||
EXTERN char e_invalid_string_after_from[]
|
||||
@@ -343,3 +343,33 @@ EXTERN char e_mismatched_enddef[]
|
||||
INIT(= N_("E1152: Mismatched enddef"));
|
||||
EXTERN char e_invalid_operation_for_bool[]
|
||||
INIT(= N_("E1153: Invalid operation for bool"));
|
||||
EXTERN char e_divide_by_zero[]
|
||||
INIT(= N_("E1154: Divide by zero"));
|
||||
EXTERN char e_cannot_define_autocommands_for_all_events[]
|
||||
INIT(= N_("E1155: Cannot define autocommands for ALL events"));
|
||||
EXTERN char e_cannot_change_arglist_recursively[]
|
||||
INIT(= N_("E1156: Cannot change the argument list recursively"));
|
||||
EXTERN char e_missing_return_type[]
|
||||
INIT(= N_("E1157: Missing return type"));
|
||||
EXTERN char e_cannot_use_flatten_in_vim9_script[]
|
||||
INIT(= N_("E1158: Cannot use flatten() in Vim9 script"));
|
||||
EXTERN char e_cannot_split_window_when_closing_buffer[]
|
||||
INIT(= N_("E1159: Cannot split a window when closing the buffer"));
|
||||
EXTERN char e_cannot_use_default_for_variable_arguments[]
|
||||
INIT(= N_("E1160: Cannot use a default for variable arguments"));
|
||||
EXTERN char e_cannot_json_encode_str[]
|
||||
INIT(= N_("E1161: Cannot json encode a %s"));
|
||||
EXTERN char e_register_name_must_be_one_char_str[]
|
||||
INIT(= N_("E1162: Register name must be one character: %s"));
|
||||
EXTERN char e_variable_nr_type_mismatch_expected_str_but_got_str[]
|
||||
INIT(= N_("E1163: Variable %d: type mismatch, expected %s but got %s"));
|
||||
EXTERN char e_vim9cmd_must_be_followed_by_command[]
|
||||
INIT(= N_("E1164: vim9cmd must be followed by a command"));
|
||||
EXTERN char e_cannot_use_range_with_assignment_str[]
|
||||
INIT(= N_("E1165: Cannot use a range with an assignment: %s"));
|
||||
EXTERN char e_cannot_use_range_with_dictionary[]
|
||||
INIT(= N_("E1166: Cannot use a range with a dictionary"));
|
||||
EXTERN char e_argument_name_shadows_existing_variable_str[]
|
||||
INIT(= N_("E1167: Argument name shadows existing variable: %s"));
|
||||
EXTERN char e_argument_already_declared_in_script_str[]
|
||||
INIT(= N_("E1168: Argument already declared in the script: %s"));
|
||||
|
||||
183
src/eval.c
183
src/eval.c
@@ -57,14 +57,21 @@ static char_u *make_expanded_name(char_u *in_start, char_u *expr_start, char_u *
|
||||
|
||||
/*
|
||||
* Return "n1" divided by "n2", taking care of dividing by zero.
|
||||
* If "failed" is not NULL set it to TRUE when dividing by zero fails.
|
||||
*/
|
||||
varnumber_T
|
||||
num_divide(varnumber_T n1, varnumber_T n2)
|
||||
num_divide(varnumber_T n1, varnumber_T n2, int *failed)
|
||||
{
|
||||
varnumber_T result;
|
||||
|
||||
if (n2 == 0) // give an error message?
|
||||
if (n2 == 0)
|
||||
{
|
||||
if (in_vim9script())
|
||||
{
|
||||
emsg(_(e_divide_by_zero));
|
||||
if (failed != NULL)
|
||||
*failed = TRUE;
|
||||
}
|
||||
if (n1 == 0)
|
||||
result = VARNUM_MIN; // similar to NaN
|
||||
else if (n1 < 0)
|
||||
@@ -80,11 +87,17 @@ num_divide(varnumber_T n1, varnumber_T n2)
|
||||
|
||||
/*
|
||||
* Return "n1" modulus "n2", taking care of dividing by zero.
|
||||
* If "failed" is not NULL set it to TRUE when dividing by zero fails.
|
||||
*/
|
||||
varnumber_T
|
||||
num_modulus(varnumber_T n1, varnumber_T n2)
|
||||
num_modulus(varnumber_T n1, varnumber_T n2, int *failed)
|
||||
{
|
||||
// Give an error when n2 is 0?
|
||||
if (n2 == 0 && in_vim9script())
|
||||
{
|
||||
emsg(_(e_divide_by_zero));
|
||||
if (failed != NULL)
|
||||
*failed = TRUE;
|
||||
}
|
||||
return (n2 == 0) ? 0 : (n1 % n2);
|
||||
}
|
||||
|
||||
@@ -466,6 +479,45 @@ skip_expr_concatenate(
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert "tv" to a string.
|
||||
* When "convert" is TRUE convert a List into a sequence of lines and convert
|
||||
* a Float to a String.
|
||||
* Returns an allocated string (NULL when out of memory).
|
||||
*/
|
||||
char_u *
|
||||
typval2string(typval_T *tv, int convert)
|
||||
{
|
||||
garray_T ga;
|
||||
char_u *retval;
|
||||
#ifdef FEAT_FLOAT
|
||||
char_u numbuf[NUMBUFLEN];
|
||||
#endif
|
||||
|
||||
if (convert && tv->v_type == VAR_LIST)
|
||||
{
|
||||
ga_init2(&ga, (int)sizeof(char), 80);
|
||||
if (tv->vval.v_list != NULL)
|
||||
{
|
||||
list_join(&ga, tv->vval.v_list, (char_u *)"\n", TRUE, FALSE, 0);
|
||||
if (tv->vval.v_list->lv_len > 0)
|
||||
ga_append(&ga, NL);
|
||||
}
|
||||
ga_append(&ga, NUL);
|
||||
retval = (char_u *)ga.ga_data;
|
||||
}
|
||||
#ifdef FEAT_FLOAT
|
||||
else if (convert && tv->v_type == VAR_FLOAT)
|
||||
{
|
||||
vim_snprintf((char *)numbuf, NUMBUFLEN, "%g", tv->vval.v_float);
|
||||
retval = vim_strsave(numbuf);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
retval = vim_strsave(tv_get_string(tv));
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* Top level evaluation function, returning a string. Does not handle line
|
||||
* breaks.
|
||||
@@ -481,10 +533,6 @@ eval_to_string_eap(
|
||||
{
|
||||
typval_T tv;
|
||||
char_u *retval;
|
||||
garray_T ga;
|
||||
#ifdef FEAT_FLOAT
|
||||
char_u numbuf[NUMBUFLEN];
|
||||
#endif
|
||||
evalarg_T evalarg;
|
||||
|
||||
fill_evalarg_from_eap(&evalarg, eap, eap != NULL && eap->skip);
|
||||
@@ -492,27 +540,7 @@ eval_to_string_eap(
|
||||
retval = NULL;
|
||||
else
|
||||
{
|
||||
if (convert && tv.v_type == VAR_LIST)
|
||||
{
|
||||
ga_init2(&ga, (int)sizeof(char), 80);
|
||||
if (tv.vval.v_list != NULL)
|
||||
{
|
||||
list_join(&ga, tv.vval.v_list, (char_u *)"\n", TRUE, FALSE, 0);
|
||||
if (tv.vval.v_list->lv_len > 0)
|
||||
ga_append(&ga, NL);
|
||||
}
|
||||
ga_append(&ga, NUL);
|
||||
retval = (char_u *)ga.ga_data;
|
||||
}
|
||||
#ifdef FEAT_FLOAT
|
||||
else if (convert && tv.v_type == VAR_FLOAT)
|
||||
{
|
||||
vim_snprintf((char *)numbuf, NUMBUFLEN, "%g", tv.vval.v_float);
|
||||
retval = vim_strsave(numbuf);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
retval = vim_strsave(tv_get_string(&tv));
|
||||
retval = typval2string(&tv, convert);
|
||||
clear_tv(&tv);
|
||||
}
|
||||
clear_evalarg(&evalarg, NULL);
|
||||
@@ -1185,15 +1213,7 @@ get_lval(
|
||||
|
||||
lp->ll_dict = NULL;
|
||||
lp->ll_list = lp->ll_tv->vval.v_list;
|
||||
lp->ll_li = list_find(lp->ll_list, lp->ll_n1);
|
||||
if (lp->ll_li == NULL)
|
||||
{
|
||||
if (lp->ll_n1 < 0)
|
||||
{
|
||||
lp->ll_n1 = 0;
|
||||
lp->ll_li = list_find(lp->ll_list, lp->ll_n1);
|
||||
}
|
||||
}
|
||||
lp->ll_li = list_find_index(lp->ll_list, &lp->ll_n1);
|
||||
if (lp->ll_li == NULL)
|
||||
{
|
||||
clear_tv(&var2);
|
||||
@@ -1271,8 +1291,9 @@ set_var_lval(
|
||||
char_u *endp,
|
||||
typval_T *rettv,
|
||||
int copy,
|
||||
int flags, // ASSIGN_CONST, ASSIGN_NO_DECL
|
||||
char_u *op)
|
||||
int flags, // ASSIGN_CONST, ASSIGN_NO_DECL
|
||||
char_u *op,
|
||||
int var_idx) // index for "let [a, b] = list"
|
||||
{
|
||||
int cc;
|
||||
listitem_T *ri;
|
||||
@@ -1362,9 +1383,10 @@ set_var_lval(
|
||||
else
|
||||
{
|
||||
if (lp->ll_type != NULL
|
||||
&& check_typval_type(lp->ll_type, rettv, 0) == FAIL)
|
||||
&& check_typval_arg_type(lp->ll_type, rettv, 0) == FAIL)
|
||||
return;
|
||||
set_var_const(lp->ll_name, lp->ll_type, rettv, copy, flags);
|
||||
set_var_const(lp->ll_name, lp->ll_type, rettv, copy,
|
||||
flags, var_idx);
|
||||
}
|
||||
*endp = cc;
|
||||
}
|
||||
@@ -1443,7 +1465,7 @@ set_var_lval(
|
||||
}
|
||||
|
||||
if (lp->ll_valtype != NULL
|
||||
&& check_typval_type(lp->ll_valtype, rettv, 0) == FAIL)
|
||||
&& check_typval_arg_type(lp->ll_valtype, rettv, 0) == FAIL)
|
||||
return;
|
||||
|
||||
if (lp->ll_newkey != NULL)
|
||||
@@ -1498,6 +1520,7 @@ tv_op(typval_T *tv1, typval_T *tv2, char_u *op)
|
||||
varnumber_T n;
|
||||
char_u numbuf[NUMBUFLEN];
|
||||
char_u *s;
|
||||
int failed = FALSE;
|
||||
|
||||
// Can't do anything with a Funcref, Dict, v:true on the right.
|
||||
if (tv2->v_type != VAR_FUNC && tv2->v_type != VAR_DICT
|
||||
@@ -1581,8 +1604,10 @@ tv_op(typval_T *tv1, typval_T *tv2, char_u *op)
|
||||
case '+': n += tv_get_number(tv2); break;
|
||||
case '-': n -= tv_get_number(tv2); break;
|
||||
case '*': n *= tv_get_number(tv2); break;
|
||||
case '/': n = num_divide(n, tv_get_number(tv2)); break;
|
||||
case '%': n = num_modulus(n, tv_get_number(tv2)); break;
|
||||
case '/': n = num_divide(n, tv_get_number(tv2),
|
||||
&failed); break;
|
||||
case '%': n = num_modulus(n, tv_get_number(tv2),
|
||||
&failed); break;
|
||||
}
|
||||
clear_tv(tv1);
|
||||
tv1->v_type = VAR_NUMBER;
|
||||
@@ -1601,7 +1626,7 @@ tv_op(typval_T *tv1, typval_T *tv2, char_u *op)
|
||||
tv1->v_type = VAR_STRING;
|
||||
tv1->vval.v_string = s;
|
||||
}
|
||||
return OK;
|
||||
return failed ? FAIL : OK;
|
||||
|
||||
case VAR_FLOAT:
|
||||
#ifdef FEAT_FLOAT
|
||||
@@ -2824,11 +2849,12 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
|
||||
int vim9script = in_vim9script();
|
||||
|
||||
// "." is only string concatenation when scriptversion is 1
|
||||
// "+=" and "-=" are assignment
|
||||
// "+=", "-=" and "..=" are assignments
|
||||
p = eval_next_non_blank(*arg, evalarg, &getnext);
|
||||
op = *p;
|
||||
concat = op == '.' && (*(p + 1) == '.' || current_sctx.sc_version < 2);
|
||||
if ((op != '+' && op != '-' && !concat) || p[1] == '=')
|
||||
if ((op != '+' && op != '-' && !concat) || p[1] == '='
|
||||
|| (p[1] == '.' && p[2] == '='))
|
||||
break;
|
||||
|
||||
evaluate = evalarg == NULL ? 0 : (evalarg->eval_flags & EVAL_EVALUATE);
|
||||
@@ -3055,9 +3081,10 @@ eval6(
|
||||
#endif
|
||||
int error;
|
||||
|
||||
// "*=", "/=" and "%=" are assignments
|
||||
p = eval_next_non_blank(*arg, evalarg, &getnext);
|
||||
op = *p;
|
||||
if (op != '*' && op != '/' && op != '%')
|
||||
if ((op != '*' && op != '/' && op != '%') || p[1] == '=')
|
||||
break;
|
||||
|
||||
evaluate = evalarg == NULL ? 0 : (evalarg->eval_flags & EVAL_EVALUATE);
|
||||
@@ -3103,7 +3130,7 @@ eval6(
|
||||
*/
|
||||
if (evaluate && in_vim9script() && !IS_WHITE_OR_NUL((*arg)[1]))
|
||||
{
|
||||
error_white_both(p, 1);
|
||||
error_white_both(*arg, 1);
|
||||
clear_tv(rettv);
|
||||
return FAIL;
|
||||
}
|
||||
@@ -3178,12 +3205,16 @@ eval6(
|
||||
else
|
||||
#endif
|
||||
{
|
||||
int failed = FALSE;
|
||||
|
||||
if (op == '*')
|
||||
n1 = n1 * n2;
|
||||
else if (op == '/')
|
||||
n1 = num_divide(n1, n2);
|
||||
n1 = num_divide(n1, n2, &failed);
|
||||
else
|
||||
n1 = num_modulus(n1, n2);
|
||||
n1 = num_modulus(n1, n2, &failed);
|
||||
if (failed)
|
||||
return FAIL;
|
||||
|
||||
rettv->v_type = VAR_NUMBER;
|
||||
rettv->vval.v_number = n1;
|
||||
@@ -3384,7 +3415,21 @@ eval7(
|
||||
*/
|
||||
case '(': ret = NOTDONE;
|
||||
if (in_vim9script())
|
||||
{
|
||||
ret = get_lambda_tv(arg, rettv, TRUE, evalarg);
|
||||
if (ret == OK && evaluate)
|
||||
{
|
||||
ufunc_T *ufunc = rettv->vval.v_partial->pt_func;
|
||||
|
||||
// compile it here to get the return type
|
||||
if (compile_def_function(ufunc,
|
||||
TRUE, PROFILING(ufunc), NULL) == FAIL)
|
||||
{
|
||||
clear_tv(rettv);
|
||||
ret = FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ret == NOTDONE)
|
||||
{
|
||||
*arg = skipwhite_and_linebreak(*arg + 1, evalarg);
|
||||
@@ -3636,7 +3681,7 @@ call_func_rettv(
|
||||
|
||||
/*
|
||||
* Evaluate "->method()".
|
||||
* "*arg" points to the '-'.
|
||||
* "*arg" points to "method".
|
||||
* Returns FAIL or OK. "*arg" is advanced to after the ')'.
|
||||
*/
|
||||
static int
|
||||
@@ -3651,8 +3696,6 @@ eval_lambda(
|
||||
typval_T base = *rettv;
|
||||
int ret;
|
||||
|
||||
// Skip over the ->.
|
||||
*arg += 2;
|
||||
rettv->v_type = VAR_UNKNOWN;
|
||||
|
||||
if (**arg == '{')
|
||||
@@ -3700,7 +3743,7 @@ eval_lambda(
|
||||
|
||||
/*
|
||||
* Evaluate "->method()".
|
||||
* "*arg" points to the '-'.
|
||||
* "*arg" points to "method".
|
||||
* Returns FAIL or OK. "*arg" is advanced to after the ')'.
|
||||
*/
|
||||
static int
|
||||
@@ -3718,8 +3761,6 @@ eval_method(
|
||||
int evaluate = evalarg != NULL
|
||||
&& (evalarg->eval_flags & EVAL_EVALUATE);
|
||||
|
||||
// Skip over the ->.
|
||||
*arg += 2;
|
||||
rettv->v_type = VAR_UNKNOWN;
|
||||
|
||||
name = *arg;
|
||||
@@ -3818,11 +3859,23 @@ eval_index(
|
||||
clear_tv(&var1);
|
||||
return FAIL;
|
||||
}
|
||||
else if (evaluate && tv_get_string_chk(&var1) == NULL)
|
||||
else if (evaluate)
|
||||
{
|
||||
// not a number or string
|
||||
clear_tv(&var1);
|
||||
return FAIL;
|
||||
#ifdef FEAT_FLOAT
|
||||
// allow for indexing with float
|
||||
if (vim9 && rettv->v_type == VAR_DICT
|
||||
&& var1.v_type == VAR_FLOAT)
|
||||
{
|
||||
var1.vval.v_string = typval_tostring(&var1, TRUE);
|
||||
var1.v_type = VAR_STRING;
|
||||
}
|
||||
#endif
|
||||
if (tv_get_string_chk(&var1) == NULL)
|
||||
{
|
||||
// not a number or string
|
||||
clear_tv(&var1);
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4034,8 +4087,6 @@ eval_index_inner(
|
||||
n2 = len + n2;
|
||||
else if (n2 >= len)
|
||||
n2 = len;
|
||||
if (exclusive)
|
||||
--n2;
|
||||
if (n1 >= len || n2 < 0 || n1 > n2)
|
||||
s = NULL;
|
||||
else
|
||||
@@ -5730,10 +5781,10 @@ handle_subscript(
|
||||
}
|
||||
else if (p[0] == '-' && p[1] == '>')
|
||||
{
|
||||
*arg = p;
|
||||
*arg = skipwhite(p + 2);
|
||||
if (ret == OK)
|
||||
{
|
||||
if (((*arg)[2] == '{' && !in_vim9script()) || (*arg)[2] == '(')
|
||||
if ((**arg == '{' && !in_vim9script()) || **arg == '(')
|
||||
// expr->{lambda}() or expr->(lambda)()
|
||||
ret = eval_lambda(arg, rettv, evalarg, verbose);
|
||||
else
|
||||
|
||||
@@ -128,7 +128,8 @@ find_win_for_curbuf(void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Set line or list of lines in buffer "buf".
|
||||
* Set line or list of lines in buffer "buf" to "lines".
|
||||
* Any type is allowed and converted to a string.
|
||||
*/
|
||||
static void
|
||||
set_buffer_lines(
|
||||
@@ -187,7 +188,7 @@ set_buffer_lines(
|
||||
li = l->lv_first;
|
||||
}
|
||||
else
|
||||
line = tv_get_string_chk(lines);
|
||||
line = typval_tostring(lines, FALSE);
|
||||
|
||||
// default result is zero == OK
|
||||
for (;;)
|
||||
@@ -197,7 +198,8 @@ set_buffer_lines(
|
||||
// list argument, get next string
|
||||
if (li == NULL)
|
||||
break;
|
||||
line = tv_get_string_chk(&li->li_tv);
|
||||
vim_free(line);
|
||||
line = typval_tostring(&li->li_tv, FALSE);
|
||||
li = li->li_next;
|
||||
}
|
||||
|
||||
@@ -238,6 +240,7 @@ set_buffer_lines(
|
||||
break;
|
||||
++lnum;
|
||||
}
|
||||
vim_free(line);
|
||||
|
||||
if (added > 0)
|
||||
{
|
||||
@@ -497,24 +500,25 @@ f_deletebufline(typval_T *argvars, typval_T *rettv)
|
||||
if (u_save(first - 1, last + 1) == FAIL)
|
||||
{
|
||||
rettv->vval.v_number = 1; // FAIL
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (lnum = first; lnum <= last; ++lnum)
|
||||
ml_delete_flags(first, ML_DEL_MESSAGE);
|
||||
|
||||
for (lnum = first; lnum <= last; ++lnum)
|
||||
ml_delete_flags(first, ML_DEL_MESSAGE);
|
||||
|
||||
FOR_ALL_TAB_WINDOWS(tp, wp)
|
||||
if (wp->w_buffer == buf)
|
||||
{
|
||||
if (wp->w_cursor.lnum > last)
|
||||
wp->w_cursor.lnum -= count;
|
||||
else if (wp->w_cursor.lnum> first)
|
||||
wp->w_cursor.lnum = first;
|
||||
if (wp->w_cursor.lnum > wp->w_buffer->b_ml.ml_line_count)
|
||||
wp->w_cursor.lnum = wp->w_buffer->b_ml.ml_line_count;
|
||||
}
|
||||
check_cursor_col();
|
||||
deleted_lines_mark(first, count);
|
||||
FOR_ALL_TAB_WINDOWS(tp, wp)
|
||||
if (wp->w_buffer == buf)
|
||||
{
|
||||
if (wp->w_cursor.lnum > last)
|
||||
wp->w_cursor.lnum -= count;
|
||||
else if (wp->w_cursor.lnum> first)
|
||||
wp->w_cursor.lnum = first;
|
||||
if (wp->w_cursor.lnum > wp->w_buffer->b_ml.ml_line_count)
|
||||
wp->w_cursor.lnum = wp->w_buffer->b_ml.ml_line_count;
|
||||
}
|
||||
check_cursor_col();
|
||||
deleted_lines_mark(first, count);
|
||||
}
|
||||
|
||||
if (!is_curbuf)
|
||||
{
|
||||
|
||||
264
src/evalfunc.c
264
src/evalfunc.c
@@ -275,6 +275,7 @@ typedef struct {
|
||||
int arg_count; // actual argument count
|
||||
type_T **arg_types; // list of argument types
|
||||
int arg_idx; // current argument index (first arg is zero)
|
||||
cctx_T *arg_cctx;
|
||||
} argcontext_T;
|
||||
|
||||
// A function to check one argument type. The first argument is the type to
|
||||
@@ -282,6 +283,22 @@ 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 *);
|
||||
|
||||
/*
|
||||
* Call need_type() to check an argument type.
|
||||
*/
|
||||
static int
|
||||
check_arg_type(
|
||||
type_T *expected,
|
||||
type_T *actual,
|
||||
argcontext_T *context)
|
||||
{
|
||||
// TODO: would be useful to know if "actual" is a constant and pass it to
|
||||
// need_type() to get a compile time error if possible.
|
||||
return need_type(actual, expected,
|
||||
context->arg_idx - context->arg_count, context->arg_idx + 1,
|
||||
context->arg_cctx, FALSE, FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check "type" is a float or a number.
|
||||
*/
|
||||
@@ -301,7 +318,7 @@ arg_float_or_nr(type_T *type, argcontext_T *context)
|
||||
static int
|
||||
arg_number(type_T *type, argcontext_T *context)
|
||||
{
|
||||
return check_arg_type(&t_number, type, context->arg_idx + 1);
|
||||
return check_arg_type(&t_number, type, context);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -310,7 +327,19 @@ arg_number(type_T *type, argcontext_T *context)
|
||||
static int
|
||||
arg_string(type_T *type, argcontext_T *context)
|
||||
{
|
||||
return check_arg_type(&t_string, type, context->arg_idx + 1);
|
||||
return check_arg_type(&t_string, type, context);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check "type" is a bool or number 0 or 1.
|
||||
*/
|
||||
static int
|
||||
arg_bool(type_T *type, argcontext_T *context)
|
||||
{
|
||||
if (type->tt_type == VAR_ANY
|
||||
|| type->tt_type == VAR_NUMBER || type->tt_type == VAR_BOOL)
|
||||
return OK;
|
||||
return check_arg_type(&t_bool, type, context);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -348,7 +377,7 @@ 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);
|
||||
return check_arg_type(prev_type, type, context);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -362,7 +391,7 @@ arg_same_struct_as_prev(type_T *type, argcontext_T *context)
|
||||
type_T *prev_type = context->arg_types[context->arg_idx - 1];
|
||||
|
||||
if (prev_type->tt_type != context->arg_types[context->arg_idx]->tt_type)
|
||||
return check_arg_type(prev_type, type, context->arg_idx + 1);
|
||||
return check_arg_type(prev_type, type, context);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -384,7 +413,7 @@ arg_item_of_prev(type_T *type, argcontext_T *context)
|
||||
// probably VAR_ANY, can't check
|
||||
return OK;
|
||||
|
||||
return check_arg_type(expected, type, context->arg_idx + 1);
|
||||
return check_arg_type(expected, type, context);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -406,6 +435,8 @@ arg_extend3(type_T *type, argcontext_T *context)
|
||||
/*
|
||||
* Lists of functions that check the argument types of a builtin function.
|
||||
*/
|
||||
argcheck_T arg1_string[] = {arg_string};
|
||||
argcheck_T arg3_string_nr_bool[] = {arg_string, arg_number, arg_bool};
|
||||
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};
|
||||
@@ -432,6 +463,11 @@ ret_bool(int argcount UNUSED, type_T **argtypes UNUSED)
|
||||
return &t_bool;
|
||||
}
|
||||
static type_T *
|
||||
ret_number_bool(int argcount UNUSED, type_T **argtypes UNUSED)
|
||||
{
|
||||
return &t_number_bool;
|
||||
}
|
||||
static type_T *
|
||||
ret_number(int argcount UNUSED, type_T **argtypes UNUSED)
|
||||
{
|
||||
return &t_number;
|
||||
@@ -673,9 +709,9 @@ static funcentry_T global_functions[] =
|
||||
{"and", 2, 2, FEARG_1, NULL,
|
||||
ret_number, f_and},
|
||||
{"append", 2, 2, FEARG_2, NULL,
|
||||
ret_number, f_append},
|
||||
ret_number_bool, f_append},
|
||||
{"appendbufline", 3, 3, FEARG_3, NULL,
|
||||
ret_number, f_appendbufline},
|
||||
ret_number_bool, f_appendbufline},
|
||||
{"argc", 0, 1, 0, NULL,
|
||||
ret_number, f_argc},
|
||||
{"argidx", 0, 0, 0, NULL,
|
||||
@@ -687,29 +723,29 @@ static funcentry_T global_functions[] =
|
||||
{"asin", 1, 1, FEARG_1, NULL,
|
||||
ret_float, FLOAT_FUNC(f_asin)},
|
||||
{"assert_beeps", 1, 2, FEARG_1, NULL,
|
||||
ret_number, f_assert_beeps},
|
||||
ret_number_bool, f_assert_beeps},
|
||||
{"assert_equal", 2, 3, FEARG_2, NULL,
|
||||
ret_number, f_assert_equal},
|
||||
ret_number_bool, f_assert_equal},
|
||||
{"assert_equalfile", 2, 3, FEARG_1, NULL,
|
||||
ret_number, f_assert_equalfile},
|
||||
ret_number_bool, f_assert_equalfile},
|
||||
{"assert_exception", 1, 2, 0, NULL,
|
||||
ret_number, f_assert_exception},
|
||||
ret_number_bool, f_assert_exception},
|
||||
{"assert_fails", 1, 5, FEARG_1, NULL,
|
||||
ret_number, f_assert_fails},
|
||||
ret_number_bool, f_assert_fails},
|
||||
{"assert_false", 1, 2, FEARG_1, NULL,
|
||||
ret_number, f_assert_false},
|
||||
ret_number_bool, f_assert_false},
|
||||
{"assert_inrange", 3, 4, FEARG_3, NULL,
|
||||
ret_number, f_assert_inrange},
|
||||
ret_number_bool, f_assert_inrange},
|
||||
{"assert_match", 2, 3, FEARG_2, NULL,
|
||||
ret_number, f_assert_match},
|
||||
ret_number_bool, f_assert_match},
|
||||
{"assert_notequal", 2, 3, FEARG_2, NULL,
|
||||
ret_number, f_assert_notequal},
|
||||
ret_number_bool, f_assert_notequal},
|
||||
{"assert_notmatch", 2, 3, FEARG_2, NULL,
|
||||
ret_number, f_assert_notmatch},
|
||||
ret_number_bool, f_assert_notmatch},
|
||||
{"assert_report", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_assert_report},
|
||||
ret_number_bool, f_assert_report},
|
||||
{"assert_true", 1, 2, FEARG_1, NULL,
|
||||
ret_number, f_assert_true},
|
||||
ret_number_bool, f_assert_true},
|
||||
{"atan", 1, 1, FEARG_1, NULL,
|
||||
ret_float, FLOAT_FUNC(f_atan)},
|
||||
{"atan2", 2, 2, FEARG_1, NULL,
|
||||
@@ -745,19 +781,19 @@ static funcentry_T global_functions[] =
|
||||
{"bufadd", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_bufadd},
|
||||
{"bufexists", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_bufexists},
|
||||
ret_number_bool, f_bufexists},
|
||||
{"buffer_exists", 1, 1, FEARG_1, NULL, // obsolete
|
||||
ret_number, f_bufexists},
|
||||
ret_number_bool, f_bufexists},
|
||||
{"buffer_name", 0, 1, FEARG_1, NULL, // obsolete
|
||||
ret_string, f_bufname},
|
||||
{"buffer_number", 0, 1, FEARG_1, NULL, // obsolete
|
||||
ret_number, f_bufnr},
|
||||
{"buflisted", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_buflisted},
|
||||
ret_number_bool, f_buflisted},
|
||||
{"bufload", 1, 1, FEARG_1, NULL,
|
||||
ret_void, f_bufload},
|
||||
{"bufloaded", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_bufloaded},
|
||||
ret_number_bool, f_bufloaded},
|
||||
{"bufname", 0, 1, FEARG_1, NULL,
|
||||
ret_string, f_bufname},
|
||||
{"bufnr", 0, 2, FEARG_1, NULL,
|
||||
@@ -777,7 +813,7 @@ static funcentry_T global_functions[] =
|
||||
{"ceil", 1, 1, FEARG_1, NULL,
|
||||
ret_float, FLOAT_FUNC(f_ceil)},
|
||||
{"ch_canread", 1, 1, FEARG_1, NULL,
|
||||
ret_number, JOB_FUNC(f_ch_canread)},
|
||||
ret_number_bool, JOB_FUNC(f_ch_canread)},
|
||||
{"ch_close", 1, 1, FEARG_1, NULL,
|
||||
ret_void, JOB_FUNC(f_ch_close)},
|
||||
{"ch_close_in", 1, 1, FEARG_1, NULL,
|
||||
@@ -835,7 +871,7 @@ static funcentry_T global_functions[] =
|
||||
{"complete_add", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_complete_add},
|
||||
{"complete_check", 0, 0, 0, NULL,
|
||||
ret_number, f_complete_check},
|
||||
ret_number_bool, f_complete_check},
|
||||
{"complete_info", 0, 1, FEARG_1, NULL,
|
||||
ret_dict_any, f_complete_info},
|
||||
{"confirm", 1, 4, FEARG_1, NULL,
|
||||
@@ -863,19 +899,19 @@ static funcentry_T global_functions[] =
|
||||
{"deepcopy", 1, 2, FEARG_1, NULL,
|
||||
ret_first_arg, f_deepcopy},
|
||||
{"delete", 1, 2, FEARG_1, NULL,
|
||||
ret_number, f_delete},
|
||||
ret_number_bool, f_delete},
|
||||
{"deletebufline", 2, 3, FEARG_1, NULL,
|
||||
ret_number, f_deletebufline},
|
||||
ret_number_bool, f_deletebufline},
|
||||
{"did_filetype", 0, 0, 0, NULL,
|
||||
ret_number, f_did_filetype},
|
||||
ret_number_bool, f_did_filetype},
|
||||
{"diff_filler", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_diff_filler},
|
||||
{"diff_hlID", 2, 2, FEARG_1, NULL,
|
||||
ret_number, f_diff_hlID},
|
||||
{"echoraw", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_echoraw},
|
||||
ret_void, f_echoraw},
|
||||
{"empty", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_empty},
|
||||
ret_number_bool, f_empty},
|
||||
{"environ", 0, 0, 0, NULL,
|
||||
ret_dict_string, f_environ},
|
||||
{"escape", 2, 2, FEARG_1, NULL,
|
||||
@@ -883,7 +919,7 @@ static funcentry_T global_functions[] =
|
||||
{"eval", 1, 1, FEARG_1, NULL,
|
||||
ret_any, f_eval},
|
||||
{"eventhandler", 0, 0, 0, NULL,
|
||||
ret_number, f_eventhandler},
|
||||
ret_number_bool, f_eventhandler},
|
||||
{"executable", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_executable},
|
||||
{"execute", 1, 2, FEARG_1, NULL,
|
||||
@@ -891,7 +927,7 @@ static funcentry_T global_functions[] =
|
||||
{"exepath", 1, 1, FEARG_1, NULL,
|
||||
ret_string, f_exepath},
|
||||
{"exists", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_exists},
|
||||
ret_number_bool, f_exists},
|
||||
{"exp", 1, 1, FEARG_1, NULL,
|
||||
ret_float, FLOAT_FUNC(f_exp)},
|
||||
{"expand", 1, 3, FEARG_1, NULL,
|
||||
@@ -905,9 +941,9 @@ static funcentry_T global_functions[] =
|
||||
{"feedkeys", 1, 2, FEARG_1, NULL,
|
||||
ret_void, f_feedkeys},
|
||||
{"file_readable", 1, 1, FEARG_1, NULL, // obsolete
|
||||
ret_number, f_filereadable},
|
||||
ret_number_bool, f_filereadable},
|
||||
{"filereadable", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_filereadable},
|
||||
ret_number_bool, f_filereadable},
|
||||
{"filewritable", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_filewritable},
|
||||
{"filter", 2, 2, FEARG_1, NULL,
|
||||
@@ -918,6 +954,8 @@ static funcentry_T global_functions[] =
|
||||
ret_string, f_findfile},
|
||||
{"flatten", 1, 2, FEARG_1, NULL,
|
||||
ret_list_any, f_flatten},
|
||||
{"flattennew", 1, 2, FEARG_1, NULL,
|
||||
ret_list_any, f_flattennew},
|
||||
{"float2nr", 1, 1, FEARG_1, NULL,
|
||||
ret_number, FLOAT_FUNC(f_float2nr)},
|
||||
{"floor", 1, 1, FEARG_1, NULL,
|
||||
@@ -940,6 +978,8 @@ static funcentry_T global_functions[] =
|
||||
ret_string, f_foldtextresult},
|
||||
{"foreground", 0, 0, 0, NULL,
|
||||
ret_void, f_foreground},
|
||||
{"fullcommand", 1, 1, FEARG_1, arg1_string,
|
||||
ret_string, f_fullcommand},
|
||||
{"funcref", 1, 3, FEARG_1, NULL,
|
||||
ret_func_any, f_funcref},
|
||||
{"function", 1, 3, FEARG_1, NULL,
|
||||
@@ -993,7 +1033,7 @@ static funcentry_T global_functions[] =
|
||||
{"getftype", 1, 1, FEARG_1, NULL,
|
||||
ret_string, f_getftype},
|
||||
{"getimstatus", 0, 0, 0, NULL,
|
||||
ret_number, f_getimstatus},
|
||||
ret_number_bool, f_getimstatus},
|
||||
{"getjumplist", 0, 2, FEARG_1, NULL,
|
||||
ret_list_any, f_getjumplist},
|
||||
{"getline", 1, 2, FEARG_1, NULL,
|
||||
@@ -1045,21 +1085,21 @@ static funcentry_T global_functions[] =
|
||||
{"globpath", 2, 5, FEARG_2, NULL,
|
||||
ret_any, f_globpath},
|
||||
{"has", 1, 2, 0, NULL,
|
||||
ret_number, f_has},
|
||||
ret_number_bool, f_has},
|
||||
{"has_key", 2, 2, FEARG_1, NULL,
|
||||
ret_number, f_has_key},
|
||||
ret_number_bool, f_has_key},
|
||||
{"haslocaldir", 0, 2, FEARG_1, NULL,
|
||||
ret_number, f_haslocaldir},
|
||||
{"hasmapto", 1, 3, FEARG_1, NULL,
|
||||
ret_number, f_hasmapto},
|
||||
ret_number_bool, f_hasmapto},
|
||||
{"highlightID", 1, 1, FEARG_1, NULL, // obsolete
|
||||
ret_number, f_hlID},
|
||||
{"highlight_exists",1, 1, FEARG_1, NULL, // obsolete
|
||||
ret_number, f_hlexists},
|
||||
ret_number_bool, f_hlexists},
|
||||
{"histadd", 2, 2, FEARG_2, NULL,
|
||||
ret_number, f_histadd},
|
||||
ret_number_bool, f_histadd},
|
||||
{"histdel", 1, 2, FEARG_1, NULL,
|
||||
ret_number, f_histdel},
|
||||
ret_number_bool, f_histdel},
|
||||
{"histget", 1, 2, FEARG_1, NULL,
|
||||
ret_string, f_histget},
|
||||
{"histnr", 1, 1, FEARG_1, NULL,
|
||||
@@ -1067,7 +1107,7 @@ static funcentry_T global_functions[] =
|
||||
{"hlID", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_hlID},
|
||||
{"hlexists", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_hlexists},
|
||||
ret_number_bool, f_hlexists},
|
||||
{"hostname", 0, 0, 0, NULL,
|
||||
ret_string, f_hostname},
|
||||
{"iconv", 3, 3, FEARG_1, NULL,
|
||||
@@ -1083,9 +1123,9 @@ static funcentry_T global_functions[] =
|
||||
{"inputlist", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_inputlist},
|
||||
{"inputrestore", 0, 0, 0, NULL,
|
||||
ret_number, f_inputrestore},
|
||||
ret_number_bool, f_inputrestore},
|
||||
{"inputsave", 0, 0, 0, NULL,
|
||||
ret_number, f_inputsave},
|
||||
ret_number_bool, f_inputsave},
|
||||
{"inputsecret", 1, 2, FEARG_1, NULL,
|
||||
ret_string, f_inputsecret},
|
||||
{"insert", 2, 3, FEARG_1, arg3_insert,
|
||||
@@ -1095,13 +1135,13 @@ static funcentry_T global_functions[] =
|
||||
{"invert", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_invert},
|
||||
{"isdirectory", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_isdirectory},
|
||||
ret_number_bool, f_isdirectory},
|
||||
{"isinf", 1, 1, FEARG_1, NULL,
|
||||
ret_number, MATH_FUNC(f_isinf)},
|
||||
{"islocked", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_islocked},
|
||||
ret_number_bool, f_islocked},
|
||||
{"isnan", 1, 1, FEARG_1, NULL,
|
||||
ret_number, MATH_FUNC(f_isnan)},
|
||||
ret_number_bool, MATH_FUNC(f_isnan)},
|
||||
{"items", 1, 1, FEARG_1, NULL,
|
||||
ret_list_any, f_items},
|
||||
{"job_getchannel", 1, 1, FEARG_1, NULL,
|
||||
@@ -1115,7 +1155,7 @@ static funcentry_T global_functions[] =
|
||||
{"job_status", 1, 1, FEARG_1, NULL,
|
||||
ret_string, JOB_FUNC(f_job_status)},
|
||||
{"job_stop", 1, 2, FEARG_1, NULL,
|
||||
ret_number, JOB_FUNC(f_job_stop)},
|
||||
ret_number_bool, JOB_FUNC(f_job_stop)},
|
||||
{"join", 1, 2, FEARG_1, NULL,
|
||||
ret_string, f_join},
|
||||
{"js_decode", 1, 1, FEARG_1, NULL,
|
||||
@@ -1149,7 +1189,7 @@ static funcentry_T global_functions[] =
|
||||
{"listener_flush", 0, 1, FEARG_1, NULL,
|
||||
ret_void, f_listener_flush},
|
||||
{"listener_remove", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_listener_remove},
|
||||
ret_number_bool, f_listener_remove},
|
||||
{"localtime", 0, 0, 0, NULL,
|
||||
ret_number, f_localtime},
|
||||
{"log", 1, 1, FEARG_1, NULL,
|
||||
@@ -1183,7 +1223,7 @@ static funcentry_T global_functions[] =
|
||||
{"matcharg", 1, 1, FEARG_1, NULL,
|
||||
ret_list_string, f_matcharg},
|
||||
{"matchdelete", 1, 2, FEARG_1, NULL,
|
||||
ret_number, f_matchdelete},
|
||||
ret_number_bool, f_matchdelete},
|
||||
{"matchend", 2, 4, FEARG_1, NULL,
|
||||
ret_number, f_matchend},
|
||||
{"matchfuzzy", 2, 3, FEARG_1, NULL,
|
||||
@@ -1197,7 +1237,7 @@ static funcentry_T global_functions[] =
|
||||
{"matchstrpos", 2, 4, FEARG_1, NULL,
|
||||
ret_list_any, f_matchstrpos},
|
||||
{"max", 1, 1, FEARG_1, NULL,
|
||||
ret_any, f_max},
|
||||
ret_number, f_max},
|
||||
{"menu_info", 1, 2, FEARG_1, NULL,
|
||||
ret_dict_any,
|
||||
#ifdef FEAT_MENU
|
||||
@@ -1207,9 +1247,9 @@ static funcentry_T global_functions[] =
|
||||
#endif
|
||||
},
|
||||
{"min", 1, 1, FEARG_1, NULL,
|
||||
ret_any, f_min},
|
||||
ret_number, f_min},
|
||||
{"mkdir", 1, 3, FEARG_1, NULL,
|
||||
ret_number, f_mkdir},
|
||||
ret_number_bool, f_mkdir},
|
||||
{"mode", 0, 1, FEARG_1, NULL,
|
||||
ret_string, f_mode},
|
||||
{"mzeval", 1, 1, FEARG_1, NULL,
|
||||
@@ -1315,7 +1355,7 @@ static funcentry_T global_functions[] =
|
||||
{"pum_getpos", 0, 0, 0, NULL,
|
||||
ret_dict_number, f_pum_getpos},
|
||||
{"pumvisible", 0, 0, 0, NULL,
|
||||
ret_number, f_pumvisible},
|
||||
ret_number_bool, f_pumvisible},
|
||||
{"py3eval", 1, 1, FEARG_1, NULL,
|
||||
ret_any,
|
||||
#ifdef FEAT_PYTHON3
|
||||
@@ -1379,7 +1419,7 @@ static funcentry_T global_functions[] =
|
||||
{"remove", 2, 3, FEARG_1, NULL,
|
||||
ret_remove, f_remove},
|
||||
{"rename", 2, 2, FEARG_1, NULL,
|
||||
ret_number, f_rename},
|
||||
ret_number_bool, f_rename},
|
||||
{"repeat", 2, 2, FEARG_1, NULL,
|
||||
ret_first_arg, f_repeat},
|
||||
{"resolve", 1, 1, FEARG_1, NULL,
|
||||
@@ -1415,7 +1455,7 @@ static funcentry_T global_functions[] =
|
||||
{"searchcount", 0, 1, FEARG_1, NULL,
|
||||
ret_dict_any, f_searchcount},
|
||||
{"searchdecl", 1, 3, FEARG_1, NULL,
|
||||
ret_number, f_searchdecl},
|
||||
ret_number_bool, f_searchdecl},
|
||||
{"searchpair", 3, 7, 0, NULL,
|
||||
ret_number, f_searchpair},
|
||||
{"searchpairpos", 3, 7, 0, NULL,
|
||||
@@ -1423,45 +1463,45 @@ static funcentry_T global_functions[] =
|
||||
{"searchpos", 1, 5, FEARG_1, NULL,
|
||||
ret_list_number, f_searchpos},
|
||||
{"server2client", 2, 2, FEARG_1, NULL,
|
||||
ret_number, f_server2client},
|
||||
ret_number_bool, f_server2client},
|
||||
{"serverlist", 0, 0, 0, NULL,
|
||||
ret_string, f_serverlist},
|
||||
{"setbufline", 3, 3, FEARG_3, NULL,
|
||||
ret_number, f_setbufline},
|
||||
ret_number_bool, f_setbufline},
|
||||
{"setbufvar", 3, 3, FEARG_3, NULL,
|
||||
ret_void, f_setbufvar},
|
||||
{"setcellwidths", 1, 1, FEARG_1, NULL,
|
||||
ret_void, f_setcellwidths},
|
||||
{"setcharpos", 2, 2, FEARG_2, NULL,
|
||||
ret_number, f_setcharpos},
|
||||
ret_number_bool, f_setcharpos},
|
||||
{"setcharsearch", 1, 1, FEARG_1, NULL,
|
||||
ret_void, f_setcharsearch},
|
||||
{"setcmdpos", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_setcmdpos},
|
||||
{"setcursorcharpos", 1, 3, FEARG_1, NULL,
|
||||
ret_number, f_setcursorcharpos},
|
||||
ret_number_bool, f_setcmdpos},
|
||||
{"setcursorcharpos", 1, 3, FEARG_1, NULL,
|
||||
ret_number_bool, f_setcursorcharpos},
|
||||
{"setenv", 2, 2, FEARG_2, NULL,
|
||||
ret_void, f_setenv},
|
||||
{"setfperm", 2, 2, FEARG_1, NULL,
|
||||
ret_number, f_setfperm},
|
||||
ret_number_bool, f_setfperm},
|
||||
{"setline", 2, 2, FEARG_2, NULL,
|
||||
ret_number, f_setline},
|
||||
ret_number_bool, f_setline},
|
||||
{"setloclist", 2, 4, FEARG_2, NULL,
|
||||
ret_number, f_setloclist},
|
||||
ret_number_bool, f_setloclist},
|
||||
{"setmatches", 1, 2, FEARG_1, NULL,
|
||||
ret_number, f_setmatches},
|
||||
ret_number_bool, f_setmatches},
|
||||
{"setpos", 2, 2, FEARG_2, NULL,
|
||||
ret_number, f_setpos},
|
||||
ret_number_bool, f_setpos},
|
||||
{"setqflist", 1, 3, FEARG_1, NULL,
|
||||
ret_number, f_setqflist},
|
||||
ret_number_bool, f_setqflist},
|
||||
{"setreg", 2, 3, FEARG_2, NULL,
|
||||
ret_number, f_setreg},
|
||||
ret_number_bool, f_setreg},
|
||||
{"settabvar", 3, 3, FEARG_3, NULL,
|
||||
ret_void, f_settabvar},
|
||||
{"settabwinvar", 4, 4, FEARG_4, NULL,
|
||||
ret_void, f_settabwinvar},
|
||||
{"settagstack", 2, 3, FEARG_2, NULL,
|
||||
ret_number, f_settagstack},
|
||||
ret_number_bool, f_settagstack},
|
||||
{"setwinvar", 3, 3, FEARG_3, NULL,
|
||||
ret_void, f_setwinvar},
|
||||
{"sha256", 1, 1, FEARG_1, NULL,
|
||||
@@ -1489,9 +1529,9 @@ static funcentry_T global_functions[] =
|
||||
{"sign_placelist", 1, 1, FEARG_1, NULL,
|
||||
ret_list_number, SIGN_FUNC(f_sign_placelist)},
|
||||
{"sign_undefine", 0, 1, FEARG_1, NULL,
|
||||
ret_number, SIGN_FUNC(f_sign_undefine)},
|
||||
ret_number_bool, SIGN_FUNC(f_sign_undefine)},
|
||||
{"sign_unplace", 1, 2, FEARG_1, NULL,
|
||||
ret_number, SIGN_FUNC(f_sign_unplace)},
|
||||
ret_number_bool, SIGN_FUNC(f_sign_unplace)},
|
||||
{"sign_unplacelist", 1, 2, FEARG_1, NULL,
|
||||
ret_list_number, SIGN_FUNC(f_sign_unplacelist)},
|
||||
{"simplify", 1, 1, FEARG_1, NULL,
|
||||
@@ -1526,11 +1566,11 @@ static funcentry_T global_functions[] =
|
||||
ret_list_number, f_srand},
|
||||
{"state", 0, 1, FEARG_1, NULL,
|
||||
ret_string, f_state},
|
||||
{"str2float", 1, 1, FEARG_1, NULL,
|
||||
{"str2float", 1, 1, FEARG_1, arg1_string,
|
||||
ret_float, FLOAT_FUNC(f_str2float)},
|
||||
{"str2list", 1, 2, FEARG_1, NULL,
|
||||
ret_list_number, f_str2list},
|
||||
{"str2nr", 1, 3, FEARG_1, NULL,
|
||||
{"str2nr", 1, 3, FEARG_1, arg3_string_nr_bool,
|
||||
ret_number, f_str2nr},
|
||||
{"strcharpart", 2, 3, FEARG_1, NULL,
|
||||
ret_string, f_strcharpart},
|
||||
@@ -1771,7 +1811,7 @@ static funcentry_T global_functions[] =
|
||||
{"win_gettype", 0, 1, FEARG_1, NULL,
|
||||
ret_string, f_win_gettype},
|
||||
{"win_gotoid", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_win_gotoid},
|
||||
ret_number_bool, f_win_gotoid},
|
||||
{"win_id2tabwin", 1, 1, FEARG_1, NULL,
|
||||
ret_list_number, f_win_id2tabwin},
|
||||
{"win_id2win", 1, 1, FEARG_1, NULL,
|
||||
@@ -1779,7 +1819,7 @@ static funcentry_T global_functions[] =
|
||||
{"win_screenpos", 1, 1, FEARG_1, NULL,
|
||||
ret_list_number, f_win_screenpos},
|
||||
{"win_splitmove", 2, 3, FEARG_1, NULL,
|
||||
ret_number, f_win_splitmove},
|
||||
ret_number_bool, f_win_splitmove},
|
||||
{"winbufnr", 1, 1, FEARG_1, NULL,
|
||||
ret_number, f_winbufnr},
|
||||
{"wincol", 0, 0, 0, NULL,
|
||||
@@ -1805,7 +1845,7 @@ static funcentry_T global_functions[] =
|
||||
{"wordcount", 0, 0, 0, NULL,
|
||||
ret_dict_number, f_wordcount},
|
||||
{"writefile", 2, 3, FEARG_1, NULL,
|
||||
ret_number, f_writefile},
|
||||
ret_number_bool, f_writefile},
|
||||
{"xor", 2, 2, FEARG_1, NULL,
|
||||
ret_number, f_xor},
|
||||
};
|
||||
@@ -1931,7 +1971,11 @@ internal_func_name(int idx)
|
||||
* Return FAIL and gives an error message when a type is wrong.
|
||||
*/
|
||||
int
|
||||
internal_func_check_arg_types(type_T **types, int idx, int argcount)
|
||||
internal_func_check_arg_types(
|
||||
type_T **types,
|
||||
int idx,
|
||||
int argcount,
|
||||
cctx_T *cctx)
|
||||
{
|
||||
argcheck_T *argchecks = global_functions[idx].f_argcheck;
|
||||
int i;
|
||||
@@ -1942,6 +1986,7 @@ internal_func_check_arg_types(type_T **types, int idx, int argcount)
|
||||
|
||||
context.arg_count = argcount;
|
||||
context.arg_types = types;
|
||||
context.arg_cctx = cctx;
|
||||
for (i = 0; i < argcount; ++i)
|
||||
if (argchecks[i] != NULL)
|
||||
{
|
||||
@@ -2545,7 +2590,7 @@ f_charidx(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
char_u *str;
|
||||
varnumber_T idx;
|
||||
int countcc = FALSE;
|
||||
varnumber_T countcc = FALSE;
|
||||
char_u *p;
|
||||
int len;
|
||||
int (*ptr2len)(char_u *);
|
||||
@@ -2566,7 +2611,7 @@ f_charidx(typval_T *argvars, typval_T *rettv)
|
||||
return;
|
||||
|
||||
if (argvars[2].v_type != VAR_UNKNOWN)
|
||||
countcc = (int)tv_get_bool(&argvars[2]);
|
||||
countcc = tv_get_bool(&argvars[2]);
|
||||
if (countcc < 0 || countcc > 1)
|
||||
{
|
||||
semsg(_(e_using_number_as_bool_nr), countcc);
|
||||
@@ -2745,7 +2790,8 @@ set_cursorpos(typval_T *argvars, typval_T *rettv, int charcol)
|
||||
}
|
||||
else if ((argvars[0].v_type == VAR_NUMBER ||
|
||||
argvars[0].v_type == VAR_STRING)
|
||||
&& argvars[1].v_type == VAR_NUMBER)
|
||||
&& (argvars[1].v_type == VAR_NUMBER ||
|
||||
argvars[1].v_type == VAR_STRING))
|
||||
{
|
||||
line = tv_get_lnum(argvars);
|
||||
if (line < 0)
|
||||
@@ -2825,11 +2871,11 @@ f_debugbreak(typval_T *argvars, typval_T *rettv)
|
||||
static void
|
||||
f_deepcopy(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
int noref = 0;
|
||||
varnumber_T noref = 0;
|
||||
int copyID;
|
||||
|
||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
||||
noref = (int)tv_get_bool_chk(&argvars[1], NULL);
|
||||
noref = tv_get_bool_chk(&argvars[1], NULL);
|
||||
if (noref < 0 || noref > 1)
|
||||
semsg(_(e_using_number_as_bool_nr), noref);
|
||||
else
|
||||
@@ -4239,7 +4285,13 @@ f_getreg(typval_T *argvars, typval_T *rettv)
|
||||
if (argvars[0].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
strregname = tv_get_string_chk(&argvars[0]);
|
||||
error = strregname == NULL;
|
||||
if (strregname == NULL)
|
||||
error = TRUE;
|
||||
else if (in_vim9script() && STRLEN(strregname) > 1)
|
||||
{
|
||||
semsg(_(e_register_name_must_be_one_char_str), strregname);
|
||||
error = TRUE;
|
||||
}
|
||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
arg2 = (int)tv_get_bool_chk(&argvars[1], &error);
|
||||
@@ -4289,6 +4341,11 @@ f_getregtype(typval_T *argvars, typval_T *rettv)
|
||||
if (argvars[0].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
strregname = tv_get_string_chk(&argvars[0]);
|
||||
if (strregname != NULL && in_vim9script() && STRLEN(strregname) > 1)
|
||||
{
|
||||
semsg(_(e_register_name_must_be_one_char_str), strregname);
|
||||
strregname = NULL;
|
||||
}
|
||||
if (strregname == NULL) // type error; errmsg already given
|
||||
{
|
||||
rettv->v_type = VAR_STRING;
|
||||
@@ -4623,6 +4680,13 @@ f_has(typval_T *argvars, typval_T *rettv)
|
||||
},
|
||||
{"cmdline_compl", 1},
|
||||
{"cmdline_hist", 1},
|
||||
{"cmdwin",
|
||||
#ifdef FEAT_CMDWIN
|
||||
1
|
||||
#else
|
||||
0
|
||||
#endif
|
||||
},
|
||||
{"comments", 1},
|
||||
{"conceal",
|
||||
#ifdef FEAT_CONCEAL
|
||||
@@ -6718,12 +6782,16 @@ max_min(typval_T *argvars, typval_T *rettv, int domax)
|
||||
if (li != NULL)
|
||||
{
|
||||
n = tv_get_number_chk(&li->li_tv, &error);
|
||||
if (error)
|
||||
return; // type error; errmsg already given
|
||||
for (;;)
|
||||
{
|
||||
li = li->li_next;
|
||||
if (li == NULL)
|
||||
break;
|
||||
i = tv_get_number_chk(&li->li_tv, &error);
|
||||
if (error)
|
||||
return; // type error; errmsg already given
|
||||
if (domax ? i > n : i < n)
|
||||
n = i;
|
||||
}
|
||||
@@ -6748,6 +6816,8 @@ max_min(typval_T *argvars, typval_T *rettv, int domax)
|
||||
{
|
||||
--todo;
|
||||
i = tv_get_number_chk(&HI2DI(hi)->di_tv, &error);
|
||||
if (error)
|
||||
return; // type error; errmsg already given
|
||||
if (first)
|
||||
{
|
||||
n = i;
|
||||
@@ -6761,7 +6831,8 @@ max_min(typval_T *argvars, typval_T *rettv, int domax)
|
||||
}
|
||||
else
|
||||
semsg(_(e_listdictarg), domax ? "max()" : "min()");
|
||||
rettv->vval.v_number = error ? 0 : n;
|
||||
|
||||
rettv->vval.v_number = n;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -7308,6 +7379,11 @@ f_getreginfo(typval_T *argvars, typval_T *rettv)
|
||||
strregname = tv_get_string_chk(&argvars[0]);
|
||||
if (strregname == NULL)
|
||||
return;
|
||||
if (in_vim9script() && STRLEN(strregname) > 1)
|
||||
{
|
||||
semsg(_(e_register_name_must_be_one_char_str), strregname);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
strregname = get_vim_var_str(VV_REG);
|
||||
@@ -7350,7 +7426,7 @@ f_getreginfo(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
item->di_tv.v_type = VAR_SPECIAL;
|
||||
item->di_tv.vval.v_number = regname == buf[0]
|
||||
? VVAL_TRUE : VVAL_FALSE;
|
||||
? VVAL_TRUE : VVAL_FALSE;
|
||||
(void)dict_add(dict, item);
|
||||
}
|
||||
}
|
||||
@@ -8287,7 +8363,7 @@ f_setcharsearch(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
* "setcursorcharpos" function
|
||||
*/
|
||||
static void
|
||||
f_setcursorcharpos(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
f_setcursorcharpos(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
set_cursorpos(argvars, rettv, TRUE);
|
||||
}
|
||||
@@ -8412,6 +8488,11 @@ f_setreg(typval_T *argvars, typval_T *rettv)
|
||||
|
||||
if (strregname == NULL)
|
||||
return; // type error; errmsg already given
|
||||
if (in_vim9script() && STRLEN(strregname) > 1)
|
||||
{
|
||||
semsg(_(e_register_name_must_be_one_char_str), strregname);
|
||||
return;
|
||||
}
|
||||
regname = *strregname;
|
||||
if (regname == 0 || regname == '@')
|
||||
regname = '"';
|
||||
@@ -9041,7 +9122,7 @@ f_str2nr(typval_T *argvars, typval_T *rettv)
|
||||
what |= STR2NR_QUOTE;
|
||||
}
|
||||
|
||||
p = skipwhite(tv_get_string(&argvars[0]));
|
||||
p = skipwhite(tv_get_string_strict(&argvars[0]));
|
||||
isneg = (*p == '-');
|
||||
if (*p == '+' || *p == '-')
|
||||
p = skipwhite(p + 1);
|
||||
@@ -9162,12 +9243,12 @@ f_strlen(typval_T *argvars, typval_T *rettv)
|
||||
f_strchars(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
char_u *s = tv_get_string(&argvars[0]);
|
||||
int skipcc = FALSE;
|
||||
varnumber_T skipcc = FALSE;
|
||||
varnumber_T len = 0;
|
||||
int (*func_mb_ptr2char_adv)(char_u **pp);
|
||||
|
||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
||||
skipcc = (int)tv_get_bool(&argvars[1]);
|
||||
skipcc = tv_get_bool(&argvars[1]);
|
||||
if (skipcc < 0 || skipcc > 1)
|
||||
semsg(_(e_using_number_as_bool_nr), skipcc);
|
||||
else
|
||||
@@ -9655,7 +9736,8 @@ f_synconcealed(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
cchar = syn_get_sub_char();
|
||||
if (cchar == NUL && curwin->w_p_cole == 1)
|
||||
cchar = (lcs_conceal == NUL) ? ' ' : lcs_conceal;
|
||||
cchar = (curwin->w_lcs_chars.conceal == NUL) ? ' '
|
||||
: curwin->w_lcs_chars.conceal;
|
||||
if (cchar != NUL)
|
||||
{
|
||||
if (has_mbyte)
|
||||
|
||||
163
src/evalvars.c
163
src/evalvars.c
@@ -122,6 +122,8 @@ static struct vimvar
|
||||
{VV_NAME("true", VAR_BOOL), VV_RO},
|
||||
{VV_NAME("none", VAR_SPECIAL), VV_RO},
|
||||
{VV_NAME("null", VAR_SPECIAL), VV_RO},
|
||||
{VV_NAME("numbermax", VAR_NUMBER), VV_RO},
|
||||
{VV_NAME("numbermin", VAR_NUMBER), VV_RO},
|
||||
{VV_NAME("numbersize", VAR_NUMBER), VV_RO},
|
||||
{VV_NAME("vim_did_enter", VAR_NUMBER), VV_RO},
|
||||
{VV_NAME("testing", VAR_NUMBER), 0},
|
||||
@@ -171,7 +173,7 @@ static void list_buf_vars(int *first);
|
||||
static void list_win_vars(int *first);
|
||||
static void list_tab_vars(int *first);
|
||||
static char_u *list_arg_vars(exarg_T *eap, char_u *arg, int *first);
|
||||
static char_u *ex_let_one(char_u *arg, typval_T *tv, int copy, int flags, char_u *endchars, char_u *op);
|
||||
static char_u *ex_let_one(char_u *arg, typval_T *tv, int copy, int flags, char_u *endchars, char_u *op, int var_idx);
|
||||
static int do_unlet_var(lval_T *lp, char_u *name_end, exarg_T *eap, int deep, void *cookie);
|
||||
static int do_lock_var(lval_T *lp, char_u *name_end, exarg_T *eap, int deep, void *cookie);
|
||||
static void list_one_var(dictitem_T *v, char *prefix, int *first);
|
||||
@@ -228,6 +230,8 @@ evalvars_init(void)
|
||||
set_vim_var_nr(VV_TRUE, VVAL_TRUE);
|
||||
set_vim_var_nr(VV_NONE, VVAL_NONE);
|
||||
set_vim_var_nr(VV_NULL, VVAL_NULL);
|
||||
set_vim_var_nr(VV_NUMBERMAX, VARNUM_MAX);
|
||||
set_vim_var_nr(VV_NUMBERMIN, VARNUM_MIN);
|
||||
set_vim_var_nr(VV_NUMBERSIZE, sizeof(varnumber_T) * 8);
|
||||
|
||||
set_vim_var_nr(VV_TYPE_NUMBER, VAR_TYPE_NUMBER);
|
||||
@@ -834,6 +838,8 @@ ex_let(exarg_T *eap)
|
||||
i = FAIL;
|
||||
if (has_assign || concat)
|
||||
{
|
||||
int cur_lnum;
|
||||
|
||||
op[0] = '=';
|
||||
op[1] = NUL;
|
||||
if (*expr != '=')
|
||||
@@ -878,10 +884,15 @@ ex_let(exarg_T *eap)
|
||||
evalarg.eval_cookie = eap->cookie;
|
||||
}
|
||||
expr = skipwhite_and_linebreak(expr, &evalarg);
|
||||
cur_lnum = SOURCING_LNUM;
|
||||
i = eval0(expr, &rettv, eap, &evalarg);
|
||||
if (eap->skip)
|
||||
--emsg_skip;
|
||||
clear_evalarg(&evalarg, eap);
|
||||
|
||||
// Restore the line number so that any type error is given for the
|
||||
// declaration, not the expression.
|
||||
SOURCING_LNUM = cur_lnum;
|
||||
}
|
||||
if (eap->skip)
|
||||
{
|
||||
@@ -898,7 +909,7 @@ ex_let(exarg_T *eap)
|
||||
}
|
||||
|
||||
/*
|
||||
* Assign the typevalue "tv" to the variable or variables at "arg_start".
|
||||
* Assign the typeval "tv" to the variable or variables at "arg_start".
|
||||
* Handles both "var" with any type and "[var, var; var]" with a list type.
|
||||
* When "op" is not NULL it points to a string with characters that
|
||||
* must appear after the variable(s). Use "+", "-" or "." for add, subtract
|
||||
@@ -918,13 +929,14 @@ ex_let_vars(
|
||||
char_u *arg = arg_start;
|
||||
list_T *l;
|
||||
int i;
|
||||
int var_idx = 0;
|
||||
listitem_T *item;
|
||||
typval_T ltv;
|
||||
|
||||
if (*arg != '[')
|
||||
{
|
||||
// ":let var = expr" or ":for var in list"
|
||||
if (ex_let_one(arg, tv, copy, flags, op, op) == NULL)
|
||||
if (ex_let_one(arg, tv, copy, flags, op, op, var_idx) == NULL)
|
||||
return FAIL;
|
||||
return OK;
|
||||
}
|
||||
@@ -953,7 +965,9 @@ ex_let_vars(
|
||||
while (*arg != ']')
|
||||
{
|
||||
arg = skipwhite(arg + 1);
|
||||
arg = ex_let_one(arg, &item->li_tv, TRUE, flags, (char_u *)",;]", op);
|
||||
++var_idx;
|
||||
arg = ex_let_one(arg, &item->li_tv, TRUE, flags, (char_u *)",;]",
|
||||
op, var_idx);
|
||||
item = item->li_next;
|
||||
if (arg == NULL)
|
||||
return FAIL;
|
||||
@@ -976,9 +990,10 @@ ex_let_vars(
|
||||
ltv.v_lock = 0;
|
||||
ltv.vval.v_list = l;
|
||||
l->lv_refcount = 1;
|
||||
++var_idx;
|
||||
|
||||
arg = ex_let_one(skipwhite(arg + 1), <v, FALSE, flags,
|
||||
(char_u *)"]", op);
|
||||
(char_u *)"]", op, var_idx);
|
||||
clear_tv(<v);
|
||||
if (arg == NULL)
|
||||
return FAIL;
|
||||
@@ -1019,7 +1034,7 @@ skip_var_list(
|
||||
for (;;)
|
||||
{
|
||||
p = skipwhite(p + 1); // skip whites after '[', ';' or ','
|
||||
s = skip_var_one(p, FALSE);
|
||||
s = skip_var_one(p, include_type);
|
||||
if (s == p)
|
||||
{
|
||||
if (!silent)
|
||||
@@ -1061,17 +1076,21 @@ skip_var_list(
|
||||
char_u *
|
||||
skip_var_one(char_u *arg, int include_type)
|
||||
{
|
||||
char_u *end;
|
||||
char_u *end;
|
||||
int vim9 = in_vim9script();
|
||||
|
||||
if (*arg == '@' && arg[1] != NUL)
|
||||
return arg + 2;
|
||||
end = find_name_end(*arg == '$' || *arg == '&' ? arg + 1 : arg,
|
||||
NULL, NULL, FNE_INCL_BR | FNE_CHECK_START);
|
||||
if (include_type && in_vim9script())
|
||||
|
||||
// "a: type" is declaring variable "a" with a type, not "a:".
|
||||
// Same for "s: type".
|
||||
if (vim9 && end == arg + 2 && end[-1] == ':')
|
||||
--end;
|
||||
|
||||
if (include_type && vim9)
|
||||
{
|
||||
// "a: type" is declaring variable "a" with a type, not "a:".
|
||||
if (end == arg + 2 && end[-1] == ':')
|
||||
--end;
|
||||
if (*end == ':')
|
||||
end = skip_type(skipwhite(end + 1), FALSE);
|
||||
}
|
||||
@@ -1269,7 +1288,8 @@ ex_let_one(
|
||||
int copy, // copy value from "tv"
|
||||
int flags, // ASSIGN_CONST, ASSIGN_FINAL, etc.
|
||||
char_u *endchars, // valid chars after variable name or NULL
|
||||
char_u *op) // "+", "-", "." or NULL
|
||||
char_u *op, // "+", "-", "." or NULL
|
||||
int var_idx) // variable index for "let [a, b] = list"
|
||||
{
|
||||
int c1;
|
||||
char_u *name;
|
||||
@@ -1406,8 +1426,10 @@ ex_let_one(
|
||||
case '+': n = numval + n; break;
|
||||
case '-': n = numval - n; break;
|
||||
case '*': n = numval * n; break;
|
||||
case '/': n = (long)num_divide(numval, n); break;
|
||||
case '%': n = (long)num_modulus(numval, n); break;
|
||||
case '/': n = (long)num_divide(numval, n,
|
||||
&failed); break;
|
||||
case '%': n = (long)num_modulus(numval, n,
|
||||
&failed); break;
|
||||
}
|
||||
}
|
||||
else if (opt_type == gov_string
|
||||
@@ -1491,7 +1513,7 @@ ex_let_one(
|
||||
emsg(_(e_letunexp));
|
||||
else
|
||||
{
|
||||
set_var_lval(&lv, p, tv, copy, flags, op);
|
||||
set_var_lval(&lv, p, tv, copy, flags, op, var_idx);
|
||||
arg_end = p;
|
||||
}
|
||||
}
|
||||
@@ -1634,27 +1656,9 @@ do_unlet_var(
|
||||
return FAIL;
|
||||
else if (lp->ll_range)
|
||||
{
|
||||
listitem_T *li;
|
||||
listitem_T *ll_li = lp->ll_li;
|
||||
int ll_n1 = lp->ll_n1;
|
||||
|
||||
while (ll_li != NULL && (lp->ll_empty2 || lp->ll_n2 >= ll_n1))
|
||||
{
|
||||
li = ll_li->li_next;
|
||||
if (value_check_lock(ll_li->li_tv.v_lock, lp->ll_name, FALSE))
|
||||
return FAIL;
|
||||
ll_li = li;
|
||||
++ll_n1;
|
||||
}
|
||||
|
||||
// Delete a range of List items.
|
||||
while (lp->ll_li != NULL && (lp->ll_empty2 || lp->ll_n2 >= lp->ll_n1))
|
||||
{
|
||||
li = lp->ll_li->li_next;
|
||||
listitem_remove(lp->ll_list, lp->ll_li);
|
||||
lp->ll_li = li;
|
||||
++lp->ll_n1;
|
||||
}
|
||||
if (list_unlet_range(lp->ll_list, lp->ll_li, lp->ll_name, lp->ll_n1,
|
||||
!lp->ll_empty2, lp->ll_n2) == FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1669,6 +1673,43 @@ do_unlet_var(
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unlet one item or a range of items from a list.
|
||||
* Return OK or FAIL.
|
||||
*/
|
||||
int
|
||||
list_unlet_range(
|
||||
list_T *l,
|
||||
listitem_T *li_first,
|
||||
char_u *name,
|
||||
long n1_arg,
|
||||
int has_n2,
|
||||
long n2)
|
||||
{
|
||||
listitem_T *li = li_first;
|
||||
int n1 = n1_arg;
|
||||
|
||||
while (li != NULL && (!has_n2 || n2 >= n1))
|
||||
{
|
||||
if (value_check_lock(li->li_tv.v_lock, name, FALSE))
|
||||
return FAIL;
|
||||
li = li->li_next;
|
||||
++n1;
|
||||
}
|
||||
|
||||
// Delete a range of List items.
|
||||
li = li_first;
|
||||
n1 = n1_arg;
|
||||
while (li != NULL && (!has_n2 || n2 >= n1))
|
||||
{
|
||||
listitem_T *next = li->li_next;
|
||||
|
||||
listitem_remove(l, li);
|
||||
li = next;
|
||||
++n1;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
/*
|
||||
* "unlet" a variable. Return OK if it existed, FAIL if not.
|
||||
* When "forceit" is TRUE don't complain if the variable doesn't exist.
|
||||
@@ -2747,14 +2788,13 @@ get_script_local_ht(void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Look for "name[len]" in script-local variables.
|
||||
* Look for "name[len]" in script-local variables and functions.
|
||||
* Return OK when found, FAIL when not found.
|
||||
*/
|
||||
int
|
||||
lookup_scriptvar(
|
||||
lookup_scriptitem(
|
||||
char_u *name,
|
||||
size_t len,
|
||||
void *lvar UNUSED,
|
||||
cctx_T *dummy UNUSED)
|
||||
{
|
||||
hashtab_T *ht = get_script_local_ht();
|
||||
@@ -2762,6 +2802,8 @@ lookup_scriptvar(
|
||||
char_u *p;
|
||||
int res;
|
||||
hashitem_T *hi;
|
||||
int is_global = FALSE;
|
||||
char_u *fname = name;
|
||||
|
||||
if (ht == NULL)
|
||||
return FAIL;
|
||||
@@ -2784,9 +2826,24 @@ lookup_scriptvar(
|
||||
// if not script-local, then perhaps imported
|
||||
if (res == FAIL && find_imported(p, 0, NULL) != NULL)
|
||||
res = OK;
|
||||
|
||||
if (p != buffer)
|
||||
vim_free(p);
|
||||
|
||||
if (res != OK)
|
||||
{
|
||||
// Find a function, so that a following "->" works. Skip "g:" before a
|
||||
// function name.
|
||||
// Do not check for an internal function, since it might also be a
|
||||
// valid command, such as ":split" versuse "split()".
|
||||
if (name[0] == 'g' && name[1] == ':')
|
||||
{
|
||||
is_global = TRUE;
|
||||
fname = name + 2;
|
||||
}
|
||||
if (find_func(fname, is_global, NULL) != NULL)
|
||||
res = OK;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -3058,7 +3115,7 @@ set_var(
|
||||
typval_T *tv,
|
||||
int copy) // make copy of value in "tv"
|
||||
{
|
||||
set_var_const(name, NULL, tv, copy, ASSIGN_DECL);
|
||||
set_var_const(name, NULL, tv, copy, ASSIGN_DECL, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3072,7 +3129,8 @@ set_var_const(
|
||||
type_T *type,
|
||||
typval_T *tv_arg,
|
||||
int copy, // make copy of value in "tv"
|
||||
int flags) // ASSIGN_CONST, ASSIGN_FINAL, etc.
|
||||
int flags, // ASSIGN_CONST, ASSIGN_FINAL, etc.
|
||||
int var_idx) // index for ":let [a, b] = list"
|
||||
{
|
||||
typval_T *tv = tv_arg;
|
||||
typval_T bool_tv;
|
||||
@@ -3121,6 +3179,7 @@ set_var_const(
|
||||
|
||||
if (di != NULL)
|
||||
{
|
||||
// Item already exists. Allowed to replace when reloading.
|
||||
if ((di->di_flags & DI_FLAGS_RELOAD) == 0)
|
||||
{
|
||||
if (flags & (ASSIGN_CONST | ASSIGN_FINAL))
|
||||
@@ -3131,6 +3190,8 @@ set_var_const(
|
||||
|
||||
if (is_script_local && vim9script)
|
||||
{
|
||||
where_T where;
|
||||
|
||||
if ((flags & (ASSIGN_NO_DECL | ASSIGN_DECL)) == 0)
|
||||
{
|
||||
semsg(_(e_redefining_script_item_str), name);
|
||||
@@ -3138,7 +3199,9 @@ set_var_const(
|
||||
}
|
||||
|
||||
// check the type and adjust to bool if needed
|
||||
if (check_script_var_type(&di->di_tv, tv, name) == FAIL)
|
||||
where.wt_index = var_idx;
|
||||
where.wt_variable = TRUE;
|
||||
if (check_script_var_type(&di->di_tv, tv, name, where) == FAIL)
|
||||
goto failed;
|
||||
}
|
||||
|
||||
@@ -3207,6 +3270,14 @@ set_var_const(
|
||||
}
|
||||
else
|
||||
{
|
||||
// Item not found, check if a function already exists.
|
||||
if (is_script_local && (flags & (ASSIGN_NO_DECL | ASSIGN_DECL)) == 0
|
||||
&& lookup_scriptitem(name, STRLEN(name), NULL) == OK)
|
||||
{
|
||||
semsg(_(e_redefining_script_item_str), name);
|
||||
goto failed;
|
||||
}
|
||||
|
||||
// add a new variable
|
||||
if (vim9script && is_script_local && (flags & ASSIGN_NO_DECL))
|
||||
{
|
||||
@@ -3702,10 +3773,10 @@ var_redir_start(char_u *name, int append)
|
||||
tv.vval.v_string = (char_u *)"";
|
||||
if (append)
|
||||
set_var_lval(redir_lval, redir_endp, &tv, TRUE,
|
||||
ASSIGN_NO_DECL, (char_u *)".");
|
||||
ASSIGN_NO_DECL, (char_u *)".", 0);
|
||||
else
|
||||
set_var_lval(redir_lval, redir_endp, &tv, TRUE,
|
||||
ASSIGN_NO_DECL, (char_u *)"=");
|
||||
ASSIGN_NO_DECL, (char_u *)"=", 0);
|
||||
clear_lval(redir_lval);
|
||||
if (called_emsg > called_emsg_before)
|
||||
{
|
||||
@@ -3777,7 +3848,7 @@ var_redir_stop(void)
|
||||
FALSE, FALSE, 0, FNE_CHECK_START);
|
||||
if (redir_endp != NULL && redir_lval->ll_name != NULL)
|
||||
set_var_lval(redir_lval, redir_endp, &tv, FALSE, 0,
|
||||
(char_u *)".");
|
||||
(char_u *)".", 0);
|
||||
clear_lval(redir_lval);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,10 +27,10 @@ static const unsigned short cmdidxs1[26] =
|
||||
/* t */ 458,
|
||||
/* u */ 503,
|
||||
/* v */ 514,
|
||||
/* w */ 534,
|
||||
/* x */ 548,
|
||||
/* y */ 558,
|
||||
/* z */ 559
|
||||
/* w */ 535,
|
||||
/* x */ 549,
|
||||
/* y */ 559,
|
||||
/* z */ 560
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -62,11 +62,11 @@ static const unsigned char cmdidxs2[26][26] =
|
||||
/* s */ { 2, 6, 15, 0, 19, 23, 0, 25, 26, 0, 0, 29, 31, 35, 39, 41, 0, 50, 0, 51, 0, 63, 64, 0, 65, 0 },
|
||||
/* t */ { 2, 0, 19, 0, 24, 26, 0, 27, 0, 28, 0, 29, 33, 36, 38, 39, 0, 40, 42, 0, 43, 0, 0, 0, 0, 0 },
|
||||
/* u */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
/* v */ { 1, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 11, 14, 0, 0, 0, 0, 17, 0, 18, 0, 0, 0, 0, 0 },
|
||||
/* v */ { 1, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 12, 15, 0, 0, 0, 0, 18, 0, 19, 0, 0, 0, 0, 0 },
|
||||
/* w */ { 2, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 8, 0, 9, 10, 0, 0, 0, 12, 13, 0, 0, 0, 0 },
|
||||
/* x */ { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 0, 0, 0, 7, 0, 0, 8, 0, 0, 0, 0, 0 },
|
||||
/* y */ { 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 },
|
||||
/* 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 = 574;
|
||||
static const int command_count = 575;
|
||||
|
||||
@@ -2710,6 +2710,13 @@ do_ecmd(
|
||||
*/
|
||||
if (buf != curbuf)
|
||||
{
|
||||
bufref_T save_au_new_curbuf;
|
||||
#ifdef FEAT_CMDWIN
|
||||
int save_cmdwin_type = cmdwin_type;
|
||||
|
||||
// BufLeave applies to the old buffer.
|
||||
cmdwin_type = 0;
|
||||
#endif
|
||||
/*
|
||||
* Be careful: The autocommands may delete any buffer and change
|
||||
* the current buffer.
|
||||
@@ -2722,18 +2729,24 @@ do_ecmd(
|
||||
*/
|
||||
if (buf->b_fname != NULL)
|
||||
new_name = vim_strsave(buf->b_fname);
|
||||
save_au_new_curbuf = au_new_curbuf;
|
||||
set_bufref(&au_new_curbuf, buf);
|
||||
apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf);
|
||||
#ifdef FEAT_CMDWIN
|
||||
cmdwin_type = save_cmdwin_type;
|
||||
#endif
|
||||
if (!bufref_valid(&au_new_curbuf))
|
||||
{
|
||||
// new buffer has been deleted
|
||||
delbuf_msg(new_name); // frees new_name
|
||||
au_new_curbuf = save_au_new_curbuf;
|
||||
goto theend;
|
||||
}
|
||||
#ifdef FEAT_EVAL
|
||||
if (aborting()) // autocmds may abort script processing
|
||||
{
|
||||
vim_free(new_name);
|
||||
au_new_curbuf = save_au_new_curbuf;
|
||||
goto theend;
|
||||
}
|
||||
#endif
|
||||
@@ -2759,7 +2772,9 @@ do_ecmd(
|
||||
did_decrement = close_buffer(oldwin, curbuf,
|
||||
(flags & ECMD_HIDE) ? 0 : DOBUF_UNLOAD, FALSE, FALSE);
|
||||
|
||||
the_curwin->w_closing = FALSE;
|
||||
// Autocommands may have closed the window.
|
||||
if (win_valid(the_curwin))
|
||||
the_curwin->w_closing = FALSE;
|
||||
--buf->b_locked;
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
@@ -2767,6 +2782,7 @@ do_ecmd(
|
||||
if (aborting() && curwin->w_buffer != NULL)
|
||||
{
|
||||
vim_free(new_name);
|
||||
au_new_curbuf = save_au_new_curbuf;
|
||||
goto theend;
|
||||
}
|
||||
#endif
|
||||
@@ -2775,6 +2791,7 @@ do_ecmd(
|
||||
{
|
||||
// new buffer has been deleted
|
||||
delbuf_msg(new_name); // frees new_name
|
||||
au_new_curbuf = save_au_new_curbuf;
|
||||
goto theend;
|
||||
}
|
||||
if (buf == curbuf) // already in new buffer
|
||||
@@ -2820,8 +2837,7 @@ do_ecmd(
|
||||
#endif
|
||||
}
|
||||
vim_free(new_name);
|
||||
au_new_curbuf.br_buf = NULL;
|
||||
au_new_curbuf.br_buf_free_count = 0;
|
||||
au_new_curbuf = save_au_new_curbuf;
|
||||
}
|
||||
|
||||
curwin->w_pcmark.lnum = 1;
|
||||
@@ -3747,6 +3763,8 @@ ex_substitute(exarg_T *eap)
|
||||
{
|
||||
linenr_T joined_lines_count;
|
||||
|
||||
if (eap->skip)
|
||||
return;
|
||||
curwin->w_cursor.lnum = eap->line1;
|
||||
if (*cmd == 'l')
|
||||
eap->flags = EXFLAG_LIST;
|
||||
@@ -4158,6 +4176,7 @@ ex_substitute(exarg_T *eap)
|
||||
{
|
||||
char_u *orig_line = NULL;
|
||||
int len_change = 0;
|
||||
int save_p_lz = p_lz;
|
||||
#ifdef FEAT_FOLDING
|
||||
int save_p_fen = curwin->w_p_fen;
|
||||
|
||||
@@ -4168,6 +4187,9 @@ ex_substitute(exarg_T *eap)
|
||||
temp = RedrawingDisabled;
|
||||
RedrawingDisabled = 0;
|
||||
|
||||
// avoid calling update_screen() in vgetorpeek()
|
||||
p_lz = FALSE;
|
||||
|
||||
if (new_start != NULL)
|
||||
{
|
||||
// There already was a substitution, we would
|
||||
@@ -4243,6 +4265,7 @@ ex_substitute(exarg_T *eap)
|
||||
msg_didout = FALSE; // don't scroll up
|
||||
msg_col = 0;
|
||||
gotocmdline(TRUE);
|
||||
p_lz = save_p_lz;
|
||||
|
||||
// restore the line
|
||||
if (orig_line != NULL)
|
||||
|
||||
@@ -489,7 +489,7 @@ EXCMD(CMD_digraphs, "digraphs", ex_digraphs,
|
||||
EX_BANG|EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
|
||||
ADDR_NONE),
|
||||
EXCMD(CMD_disassemble, "disassemble", ex_disassemble,
|
||||
EX_EXTRA|EX_NEEDARG|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
|
||||
EX_BANG|EX_EXTRA|EX_NEEDARG|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
|
||||
ADDR_NONE),
|
||||
EXCMD(CMD_djump, "djump", ex_findpat,
|
||||
EX_BANG|EX_RANGE|EX_DFLALL|EX_WHOLEFOLD|EX_EXTRA,
|
||||
@@ -741,7 +741,7 @@ EXCMD(CMD_jumps, "jumps", ex_jumps,
|
||||
EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
|
||||
ADDR_NONE),
|
||||
EXCMD(CMD_k, "k", ex_mark,
|
||||
EX_RANGE|EX_WORD1|EX_TRLBAR|EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK,
|
||||
EX_RANGE|EX_WORD1|EX_TRLBAR|EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK|EX_NONWHITE_OK,
|
||||
ADDR_LINES),
|
||||
EXCMD(CMD_keepmarks, "keepmarks", ex_wrongmodifier,
|
||||
EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM,
|
||||
@@ -1365,7 +1365,7 @@ EXCMD(CMD_silent, "silent", ex_wrongmodifier,
|
||||
EX_NEEDARG|EX_EXTRA|EX_BANG|EX_NOTRLCOM|EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK,
|
||||
ADDR_NONE),
|
||||
EXCMD(CMD_sleep, "sleep", ex_sleep,
|
||||
EX_RANGE|EX_COUNT|EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
|
||||
EX_BANG|EX_RANGE|EX_COUNT|EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
|
||||
ADDR_OTHER),
|
||||
EXCMD(CMD_slast, "slast", ex_last,
|
||||
EX_EXTRA|EX_BANG|EX_CMDARG|EX_ARGOPT|EX_TRLBAR,
|
||||
@@ -1679,6 +1679,9 @@ EXCMD(CMD_vimgrep, "vimgrep", ex_vimgrep,
|
||||
EXCMD(CMD_vimgrepadd, "vimgrepadd", ex_vimgrep,
|
||||
EX_RANGE|EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_TRLBAR|EX_XFILE|EX_LOCK_OK,
|
||||
ADDR_OTHER),
|
||||
EXCMD(CMD_vim9cmd, "vim9cmd", ex_wrongmodifier,
|
||||
EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM|EX_CMDWIN|EX_LOCK_OK,
|
||||
ADDR_NONE),
|
||||
EXCMD(CMD_vim9script, "vim9script", ex_vim9script,
|
||||
EX_WORD1|EX_CMDWIN|EX_LOCK_OK,
|
||||
ADDR_NONE),
|
||||
@@ -1816,8 +1819,8 @@ EXCMD(CMD_rshift, ">", ex_operators,
|
||||
EXCMD(CMD_at, "@", ex_at,
|
||||
EX_RANGE|EX_WHOLEFOLD|EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK|EX_NONWHITE_OK,
|
||||
ADDR_LINES),
|
||||
EXCMD(CMD_block, "{{{{{{{{", ex_block, // not found normally
|
||||
0,
|
||||
EXCMD(CMD_block, "{", ex_block, // not found normally
|
||||
EX_TRLBAR,
|
||||
ADDR_NONE),
|
||||
EXCMD(CMD_endblock, "}", ex_endblock,
|
||||
EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user