Compare commits

...

31 Commits

Author SHA1 Message Date
Christian Brabandt
335c584940 patch 9.0.1680: sodium test fails in Github CI
Problem:    sodium test fails in Github CI
Solution:   Catch sodium_mlock() errors and do not error out

sodium_mlock() seems to fail consistently on the Github CI. Perhaps
[sodium_mlock()](https://libsodium.gitbook.io/doc/memory_management#text-locking-memory)
is called too often or with too much memory by the runners so
that this starts failing.

Let's just try to catch this and skip the test, when this starts
happening.

closes: #12751
2023-08-09 18:16:16 +02:00
Daniel Steinberg
c2bd205254 Change "the" to "then" under ':help bufload()' (#12662) 2023-08-09 18:10:59 +02:00
Filip Gospodinov
64dea84bb0 Manpager: apply g flag conditionally to s command (#12679)
Problem: The `s` command with `g` flag only substitutes
         one occurrence when `gdefault` is set.
Solution: Use `g` flag conditionally.
2023-08-09 18:00:36 +02:00
Christian Brabandt
bd76c89e31 update matchit (#12611) 2023-08-09 17:39:53 +02:00
zeertzjq
0401933a5b Fix alignment in filetype.txt (#12618)
There are three spaces because the "<" is concealed.
2023-08-09 17:39:05 +02:00
Dominique Pellé
077ade4f67 feat: recognize geojson extension as json filetype (#12636) 2023-08-09 17:36:40 +02:00
Max Gautier
b69b9d5e17 Add filetype detection for eyaml files (#12659)
https://github.com/voxpupuli/hiera-eyaml/ uses and produces the eyaml
format, which is simply yaml with some encrypted values.

It's convenient to edit the file without decrypting when not touching
encrypted values (or when you don't have access to the decryption key),
which is why vim should treat those files as yaml files.
2023-08-09 17:18:36 +02:00
ObserverOfTime
958e15bb1c Highlight editorconfig properties with dashes (#12691)
Problem: editorconfig properties with dashes are not highlighted
Solution: update the property pattern to include dashes
2023-08-09 17:05:39 +02:00
Turiiya
2eb413f89b detect filetype for *.vsh and *.vv files (#12692)
Co-authored-by: Turiiya <34311583+tobealive@users.noreply.github.com>
2023-08-09 17:04:59 +02:00
ObserverOfTime
44ff25d524 PyPA manifest files are not recognized (#12707)
Problem:    PyPA manifest files are not recognized.
Solution:   Add a pattern to match PyPA manifest files.
2023-08-09 16:52:33 +02:00
Anton Parkhomenko
7159ac7fec Unison support (#12715) 2023-08-09 16:50:52 +02:00
Chris Vincent
8967f6c4b9 feat(heex): borrow matchit support from html (#12717)
* feat(heex): borrow matchit support from html

Makes % support behave the same in heex as in html. For example, quickly moving the cursor between opening and closing tags.

* Remove unnecessary line; define b:undo_ftplugin first

* Remove b:html_set_match_words
2023-08-09 16:49:44 +02:00
Gergő Sályi
a13eb2b147 Add WebGPU Shading Language (WGSL) filetype (#12723)
The current W3C Working Draft for the WebGPU Shading Language (WGSL) specifies
'text/wgsl' media type for WGSL modules with the '.wgsl' file extension:
https://www.w3.org/TR/WGSL/#text-wgsl-media-type

It has also been registered at the Internet Assigned Numbers Authority (IANA):
https://www.iana.org/assignments/media-types/text/wgsl

Neovim's nvim-lspconfig already associates wgsl language servers
with 'filetype wgsl':
https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#wgsl_analyzer

However currenly setting 'filetype wgsl' for *.wgsl files by defalut in Neovim
is blocked by adding this filetype to the vim project first:
https://github.com/neovim/neovim/pull/23331

This commit adds this missing wgsl filetype.
2023-08-09 16:49:01 +02:00
Linda_pp
8f566fdb1e update .wast files syntax highlighting (#12741) 2023-08-09 16:45:52 +02:00
Christian Brabandt
84bc00e9b5 patch 9.0.1679: Cleanup Tests from leftover files
Problem:    Tests may leave leftover files around
Solution:   Clean up tests and remove files

There were a few failures in 'linux (huge, gcc, testgui, true, true)'
e.g. here: https://github.com/vim/vim/actions/runs/5497376153/jobs/10018060156

,----
| Error detected while processing command line..script /home/runner/work/vim/vim/src/testdir/runtest.vim[585]..function RunTheTest[54]..Test_lvimgrep_crash[16]..TestTimeout[12]..VimLeavePre Autocommands for "*"..function EarlyExit[7]..FinishTesting:
| line   70:
| E445: Other window contains changes
| E937: Attempt to delete a buffer that is in use: Xtest_stable_xxd.txt
| E937: Attempt to delete a buffer that is in use: Xtest_stable_xxd.txt
| E937: Attempt to delete a buffer that is in use: Xtest_stable_xxd.txtmalloc(): unsorted double linked list corrupted
`----

Which is puzzling, because the Xtest_stable_xxd file should have been
long gone after test_crypt.vim is run (and definitely no longer be
staying around in test_quickfix.vim).

So try to clean up properly after a test script is run, just in case any
X<file> is still around. During testing, a found a few leftover files,
which I also fixed in the relevant test-file.

Unfortunately, the test workflow 'linux (huge, gcc, testgui, true,
true)' now seems to fail with 'E1230: Encryption: sodium_mlock()' in
test_crypt.vim. Hopefully this is only temporary.
2023-08-08 20:39:55 +02:00
Christian Brabandt
9fcde94176 Merge pull request #12740 from k-takata/import-9.0.1678
Bring Bram's last patch (9.0.1678) to GitHub
2023-08-07 17:00:41 +02:00
ObserverOfTime
ad34abee25 patch 9.0.1678: blade files are not recognized
Problem:    Blade files are not recognized.
Solution:   Add a pattern for Blade files. (closes #12650)

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-07 03:24:20 +09:00
THARAK HEGDE
4c0089d696 patch 9.0.1677: typo in syntax test input file
Problem:    Typo in syntax test input file.
Solution:   Fix the typo and the expected dump files. (THARAK HEGDE,
            closes #12635)
2023-07-09 02:38:28 +01:00
Bram Moolenaar
16abd997c9 patch 9.0.1676: warning for buffer in use when exiting early
Problem:    Warning for buffer in use when exiting early.
Solution:   Change file names to be able to see what buffer is in use when
            exiting.
2023-07-08 00:54:06 +01:00
Bram Moolenaar
7c2beb48ef patch 9.0.1675: test may run into timeout when using valgrind
Problem:    Test may run into timeout when using valgrind.
Solution:   Use a longer timeout when using valgrind.
2023-07-08 00:25:56 +01:00
Bram Moolenaar
416bd916b4 patch 9.0.1674: help for builtin functions is not sorted properly
Problem:    Help for builtin functions is not sorted properly.
Solution:   Put err_teapot() help in the right position.
2023-07-07 23:19:18 +01:00
Bram Moolenaar
80adaa8ae8 patch 9.0.1673: cannot produce a status 418 or 503 message
Problem:    Cannot produce a status 418 or 503 message.
Solution:   Add err_teapot().
2023-07-07 18:57:40 +01:00
zeertzjq
d392a74c5a patch 9.0.1672: tabline highlight wrong after truncated double width label
Problem:    Tabline highlight wrong after truncated double width label.
Solution:   Fill up half a double width character later. (closes #12614)
2023-07-01 20:24:40 +01:00
skywind3000
e7d9ca2b3b patch 9.0.1671: Termdebug: error with more than 99 breakpoints
Problem:    Termdebug: error with more than 99 breakpoints.
Solution:   Use a different sign for breakpoint 100 and over. (closes #12589,
            closes #12588)
2023-06-28 23:27:28 +01:00
Bram Moolenaar
bf5f189e44 patch 9.0.1670: resetting local option to global value is inconsistent
Problem:    Resetting local option to global value is inconsistent.
Solution:   Handle "<" specifically for 'scrolloff' and 'sidescrolloff'.
            (closes #12594)
2023-06-27 21:51:07 +01:00
Christian Brabandt
19e6c4fd2d patch 9.0.1669: Crash syncing swapfile in new buffer when using sodium crypt
Problem:    Crash syncing swapfile in new buffer when using sodium crypt.
            (James McCoy)
Solution:   Add checks for sodium encryption. (Christian Brabandt,
            closes #12591, closes #12585)
2023-06-27 18:57:10 +01:00
ObserverOfTime
0256d76a33 patch 9.0.1668: PEM files are not recognized
Problem:    PEM files are not recognized.
Solution:   Add patterns to match PEM files. (closes #12582)
2023-06-26 22:05:37 +01:00
zeertzjq
e429893741 patch 9.0.1667: regression test doesn't fail when fix is reverted
Problem:    Regression test doesn't fail when fix is reverted.
Solution:   Add "n" to 'cpoptions' instead of using :winsize. (closes #12587,
            issue #12528)
2023-06-26 19:02:43 +01:00
Christian Brabandt
a2a90d5e20 patch 9.0.1666: compiler may warn for uninitialized variable
Problem:    Compiler may warn for uninitialized variable.
Solution:   Initialize this_props_len. (Christian Brabandt, closes #12599)
2023-06-26 18:48:09 +01:00
Christian Brabandt
590aae3557 patch 9.0.1665: empty CmdlineEnter autocommand causes errors in Ex mode
Problem:    Empty CmdlineEnter autocommand causes errors in Ex mode.
Solution:   Save and restore ex_pressedreturn. (Christian Brabandt,
            closes # 12581, closes #12578)
2023-06-25 22:34:22 +01:00
fullwaywang
8154e642aa patch 9.0.1664: divide by zero when scrolling with 'smoothscroll' set
Problem:    Divide by zero when scrolling with 'smoothscroll' set.
Solution:   Avoid using a negative width. (closes #12540, closes #12528)
2023-06-24 21:58:09 +01:00
41 changed files with 671 additions and 145 deletions

View File

@@ -1,4 +1,4 @@
*builtin.txt* For Vim version 9.0. Last change: 2023 Jun 08
*builtin.txt* For Vim version 9.0. Last change: 2023 Aug 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -156,6 +156,7 @@ digraph_setlist({digraphlist}) Boolean register multiple |digraph|s
echoraw({expr}) none output {expr} as-is
empty({expr}) Number |TRUE| if {expr} is empty
environ() Dict return environment variables
err_teapot() Number produce error 418
escape({string}, {chars}) String escape {chars} in {string} with '\'
eval({string}) any evaluate {string} into its value
eventhandler() Number |TRUE| if inside an event handler
@@ -1248,7 +1249,7 @@ bufload({buf}) *bufload()*
refers to an existing file then the file is read. Otherwise
the buffer will be empty. If the buffer was already loaded
then there is no change. If the buffer is not related to a
file the no file is read (e.g., when 'buftype' is "nofile").
file then no file is read (e.g., when 'buftype' is "nofile").
If there is an existing swap file for the file of the buffer,
there will be no dialog, the buffer will be loaded anyway.
The {buf} argument is used like with |bufexists()|.
@@ -2201,6 +2202,15 @@ environ() *environ()*
use this: >
:echo index(keys(environ()), 'HOME', 0, 1) != -1
err_teapot([{expr}]) *err_teapot()*
Produce an error with number 418, needed for implementation of
RFC 2325.
If {expr} is present and it is TRUE error 503 is given,
indicating that coffee is temporarily not available.
If {expr} is present it must be a String.
escape({string}, {chars}) *escape()*
Escape the characters in {chars} that occur in {string} with a
backslash. Example: >

View File

@@ -394,7 +394,7 @@ ways to change this:
You must create a new filetype plugin in a directory early in
'runtimepath'. For Unix, for example you could use this file: >
vim ~/.vim/ftplugin/fortran.vim
< You can set those settings and mappings that you would like to add. Note
< You can set those settings and mappings that you would like to add. Note
that the global plugin will be loaded after this, it may overrule the
settings that you do here. If this is the case, you need to use one of the
following two methods.
@@ -403,7 +403,7 @@ ways to change this:
You must put the copy in a directory early in 'runtimepath'. For Unix, for
example, you could do this: >
cp $VIMRUNTIME/ftplugin/fortran.vim ~/.vim/ftplugin/fortran.vim
< Then you can edit the copied file to your liking. Since the b:did_ftplugin
< Then you can edit the copied file to your liking. Since the b:did_ftplugin
variable will be set, the global plugin will not be loaded.
A disadvantage of this method is that when the distributed plugin gets
improved, you will have to copy and modify it again.
@@ -412,7 +412,7 @@ ways to change this:
You must create a new filetype plugin in a directory from the end of
'runtimepath'. For Unix, for example, you could use this file: >
vim ~/.vim/after/ftplugin/fortran.vim
< In this file you can change just those settings that you want to change.
< In this file you can change just those settings that you want to change.
==============================================================================
3. Docs for the default filetype plugins. *ftplugin-docs*

View File

@@ -1,4 +1,4 @@
*terminal.txt* For Vim version 9.0. Last change: 2023 Jun 09
*terminal.txt* For Vim version 9.0. Last change: 2023 Jun 28
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1541,6 +1541,20 @@ If there is no g:termdebug_config you can use: >
let g:termdebug_popup = 0
Change default signs ~
*termdebug_signs*
Termdebug uses the last two characters of the breakpoint ID in the
signcolumn to represent breakpoints. For example, breakpoint ID 133
will be displayed as `33`.
If you want to customize the breakpoint signs: >
let g:termdebug_config['sign'] = '>>'
If there is no g:terminal_config yet you can use: >
let g:termdebug_config = {'sign': '>>'}
After this, breakpoints will be displayed as `>>` in the signcolumn.
Window toolbar ~
*termdebug_winbar*
By default the Termdebug plugin creates a window toolbar if the mouse is

View File

@@ -1232,6 +1232,7 @@ Inter-process communication: *channel-functions*
json_decode() decode a JSON string to Vim types
js_encode() encode an expression to a JSON string
js_decode() decode a JSON string to Vim types
err_teapot() give error 418 or 503
Jobs: *job-functions*
job_start() start a job

View File

@@ -254,6 +254,9 @@ au BufNewFile,BufRead named*.conf,rndc*.conf,rndc*.key setf named
au BufNewFile,BufRead named.root setf bindzone
au BufNewFile,BufRead *.db call dist#ft#BindzoneCheck('')
" Blade
au BufNewFile,BufRead *.blade.php setf blade
" Blank
au BufNewFile,BufRead *.bl setf blank
@@ -1057,6 +1060,9 @@ au BufNewFile,BufRead *.json5 setf json5
" JSON Patch (RFC 6902)
au BufNewFile,BufRead *.json-patch setf json
" Geojson is also json
au BufNewFile,BufRead *.geojson setf json
" Jupyter Notebook is also json
au BufNewFile,BufRead *.ipynb setf json
@@ -1511,6 +1517,9 @@ au BufNewFile,BufRead *.pdf setf pdf
" PCMK - HAE - crm configure edit
au BufNewFile,BufRead *.pcmk setf pcmk
" PEM (Privacy-Enhanced Mail)
au BufNewFile,BufRead *.pem,*.cer,*.crt,*.csr setf pem
" Perl
if has("fname_case")
au BufNewFile,BufRead *.pl,*.PL call dist#ft#FTpl()
@@ -1673,6 +1682,9 @@ au BufNewFile,BufRead *.pk setf poke
" Protocols
au BufNewFile,BufRead */etc/protocols setf protocols
" PyPA manifest files
au BufNewFile,BufRead MANIFEST.in setf pymanifest
" Pyret
au BufNewFile,BufRead *.arr setf pyret
@@ -2311,6 +2323,9 @@ au BufNewFile,BufRead */.config/upstart/*.override setf upstart
" URL shortcut
au BufNewFile,BufRead *.url setf urlshortcut
" V
au BufNewFile,BufRead *.vsh,*.vv setf v
" Vala
au BufNewFile,BufRead *.vala setf vala
@@ -2393,6 +2408,9 @@ au BufNewFile,BufRead .wgetrc,wgetrc setf wget
" Wget2 config
au BufNewFile,BufRead .wget2rc,wget2rc setf wget2
" WebGPU Shading Language (WGSL)
au BufNewFile,BufRead *.wgsl setf wgsl
" Website MetaLanguage
au BufNewFile,BufRead *.wml setf wml
@@ -2481,6 +2499,9 @@ au BufNewFile,BufRead *.fsproj,*.fsproj.user setf xml
" VBPROJ files are Visual Studio.NET's XML-based Visual Basic project config files
au BufNewFile,BufRead *.vbproj,*.vbproj.user setf xml
" Unison Language
au BufNewFile,BufRead *.u,*.uu setf unison
" Qt Linguist translation source and Qt User Interface Files are XML
" However, for .ts TypeScript is more common.
au BufNewFile,BufRead *.ui setf xml
@@ -2526,7 +2547,7 @@ au BufNewFile,BufRead *.yy,*.yxx,*.y++ setf yacc
au BufNewFile,BufRead *.y call dist#ft#FTy()
" Yaml
au BufNewFile,BufRead *.yaml,*.yml setf yaml
au BufNewFile,BufRead *.yaml,*.yml,*.eyaml setf yaml
" Raml
au BufNewFile,BufRead *.raml setf raml

View File

@@ -14,3 +14,14 @@ setlocal comments=:<%!--
setlocal commentstring=<%!--\ %s\ --%>
let b:undo_ftplugin = 'set sw< sts< et< com< cms<'
" HTML: thanks to Johannes Zellner and Benji Fisher.
if exists("loaded_matchit") && !exists("b:match_words")
let b:match_ignorecase = 1
let b:match_words = '<!--:-->,' ..
\ '<:>,' ..
\ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' ..
\ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' ..
\ '<\@<=\([^/!][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words"
endif

View File

@@ -0,0 +1,14 @@
" Vim filetype plugin file
" Language: unison
" Maintainer: Anton Parkhomenko <anton@chuwy.me>
" Latest Revision: 2023-08-07
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let b:undo_ftplugin = "setl cms< isk<"
setlocal commentstring=--\ %s
setlocal iskeyword+=!,'

View File

@@ -1,6 +1,6 @@
" matchit.vim: (global plugin) Extended "%" matching
" autload script of matchit plugin, see ../plugin/matchit.vim
" Last Change: Jun 10, 2021
" Last Change: Jan 24, 2022
" Neovim does not support scriptversion
if has("vimscript-4")
@@ -42,6 +42,10 @@ function s:RestoreOptions()
let restore_options = " ve=" .. &ve .. restore_options
set ve=
endif
if &smartcase
let restore_options = " smartcase " .. restore_options
set nosmartcase
endif
return restore_options
endfunction
@@ -134,9 +138,6 @@ function matchit#Match_wrapper(word, forward, mode) range
let curcol = match(matchline, regexp)
" If there is no match, give up.
if curcol == -1
" Make sure macros abort properly
"exe "norm! \<esc>"
call feedkeys("\e", 'tni')
return s:CleanUp(restore_options, a:mode, startpos)
endif
let endcol = matchend(matchline, regexp)
@@ -756,15 +757,15 @@ endfun
fun! s:ParseSkip(str)
let skip = a:str
if skip[1] == ":"
if skip[0] == "s"
if skip[0] ==# "s"
let skip = "synIDattr(synID(line('.'),col('.'),1),'name') =~? '" ..
\ strpart(skip,2) .. "'"
elseif skip[0] == "S"
elseif skip[0] ==# "S"
let skip = "synIDattr(synID(line('.'),col('.'),1),'name') !~? '" ..
\ strpart(skip,2) .. "'"
elseif skip[0] == "r"
elseif skip[0] ==# "r"
let skip = "strpart(getline('.'),0,col('.'))=~'" .. strpart(skip,2) .. "'"
elseif skip[0] == "R"
elseif skip[0] ==# "R"
let skip = "strpart(getline('.'),0,col('.'))!~'" .. strpart(skip,2) .. "'"
endif
endif

View File

@@ -1,10 +1,10 @@
*matchit.txt* Extended "%" matching
*matchit.txt* Extended "%" matching
For instructions on installing this file, type
`:help matchit-install`
inside Vim.
For Vim version 8.2. Last change: 2021 Dec 24
For Vim version 9.0. Last change: 2023 June 28
VIM REFERENCE MANUAL by Benji Fisher et al
@@ -148,10 +148,6 @@ To use the matchit plugin add this line to your |vimrc|: >
The script should start working the next time you start Vim.
To use the matching plugin after startup, you can use this command (note the
omitted '!'): >
packadd matchit
To use the matchit plugin after Vim has started, execute this command: >
packadd matchit
@@ -176,6 +172,22 @@ fail to skip matching groups in comments and strings. If the |filetype|
mechanism is turned off, the |b:match_words| variable will probably not be
defined automatically.
2.1 Temporarily disable the matchit plugin *matchit-disable* *:MatchDisable*
To temporarily reset the plugins, that are setup you can run the following
command: >
:MatchDisable
This will delete all the defined key mappings to the Vim default.
Now the "%" command will work like before loading the plugin |%|
2.2 Re-enable the matchit plugin *:MatchEnable*
To re-enable the plugin, after it was disabled, use the following command: >
:MatchEnable
This will resetup the key mappings.
==============================================================================
3. Configuration *matchit-configure*
@@ -244,6 +256,9 @@ Examples:
comment character) you can >
:let b:match_skip = 'r:\(^\|[^\\]\)\(\\\\\)*%'
<
See the $VIMRUNTIME/ftplugin/vim.vim for an example that uses both
syntax and a regular expression.
==============================================================================
4. Supporting a New Language *matchit-newlang*
*b:match_words*

View File

@@ -1,7 +1,7 @@
" matchit.vim: (global plugin) Extended "%" matching
" Maintainer: Christian Brabandt
" Version: 1.18
" Last Change: 2020 Dec 23
" Version: 1.19
" Last Change: 2023, June 28th
" Repository: https://github.com/chrisbra/matchit
" Previous URL:http://www.vim.org/script.php?script_id=39
" Previous Maintainer: Benji Fisher PhD <benji@member.AMS.org>
@@ -46,44 +46,65 @@ let g:loaded_matchit = 1
let s:save_cpo = &cpo
set cpo&vim
nnoremap <silent> <Plug>(MatchitNormalForward) :<C-U>call matchit#Match_wrapper('',1,'n')<CR>
nnoremap <silent> <Plug>(MatchitNormalBackward) :<C-U>call matchit#Match_wrapper('',0,'n')<CR>
xnoremap <silent> <Plug>(MatchitVisualForward) :<C-U>call matchit#Match_wrapper('',1,'v')<CR>
\:if col("''") != col("$") \| exe ":normal! m'" \| endif<cr>gv``
xnoremap <silent> <Plug>(MatchitVisualBackward) :<C-U>call matchit#Match_wrapper('',0,'v')<CR>m'gv``
onoremap <silent> <Plug>(MatchitOperationForward) :<C-U>call matchit#Match_wrapper('',1,'o')<CR>
onoremap <silent> <Plug>(MatchitOperationBackward) :<C-U>call matchit#Match_wrapper('',0,'o')<CR>
" Analogues of [{ and ]} using matching patterns:
nnoremap <silent> <Plug>(MatchitNormalMultiBackward) :<C-U>call matchit#MultiMatch("bW", "n")<CR>
nnoremap <silent> <Plug>(MatchitNormalMultiForward) :<C-U>call matchit#MultiMatch("W", "n")<CR>
xnoremap <silent> <Plug>(MatchitVisualMultiBackward) :<C-U>call matchit#MultiMatch("bW", "n")<CR>m'gv``
xnoremap <silent> <Plug>(MatchitVisualMultiForward) :<C-U>call matchit#MultiMatch("W", "n")<CR>m'gv``
onoremap <silent> <Plug>(MatchitOperationMultiBackward) :<C-U>call matchit#MultiMatch("bW", "o")<CR>
onoremap <silent> <Plug>(MatchitOperationMultiForward) :<C-U>call matchit#MultiMatch("W", "o")<CR>
" text object:
xmap <silent> <Plug>(MatchitVisualTextObject) <Plug>(MatchitVisualMultiBackward)o<Plug>(MatchitVisualMultiForward)
if !exists("g:no_plugin_maps")
nmap <silent> % <Plug>(MatchitNormalForward)
nmap <silent> g% <Plug>(MatchitNormalBackward)
xmap <silent> % <Plug>(MatchitVisualForward)
xmap <silent> g% <Plug>(MatchitVisualBackward)
omap <silent> % <Plug>(MatchitOperationForward)
omap <silent> g% <Plug>(MatchitOperationBackward)
fun MatchEnable()
nnoremap <silent> <Plug>(MatchitNormalForward) :<C-U>call matchit#Match_wrapper('',1,'n')<CR>
nnoremap <silent> <Plug>(MatchitNormalBackward) :<C-U>call matchit#Match_wrapper('',0,'n')<CR>
xnoremap <silent> <Plug>(MatchitVisualForward) :<C-U>call matchit#Match_wrapper('',1,'v')<CR>
\:if col("''") != col("$") \| exe ":normal! m'" \| endif<cr>gv``
xnoremap <silent> <Plug>(MatchitVisualBackward) :<C-U>call matchit#Match_wrapper('',0,'v')<CR>m'gv``
onoremap <silent> <Plug>(MatchitOperationForward) :<C-U>call matchit#Match_wrapper('',1,'o')<CR>
onoremap <silent> <Plug>(MatchitOperationBackward) :<C-U>call matchit#Match_wrapper('',0,'o')<CR>
" Analogues of [{ and ]} using matching patterns:
nmap <silent> [% <Plug>(MatchitNormalMultiBackward)
nmap <silent> ]% <Plug>(MatchitNormalMultiForward)
xmap <silent> [% <Plug>(MatchitVisualMultiBackward)
xmap <silent> ]% <Plug>(MatchitVisualMultiForward)
omap <silent> [% <Plug>(MatchitOperationMultiBackward)
omap <silent> ]% <Plug>(MatchitOperationMultiForward)
nnoremap <silent> <Plug>(MatchitNormalMultiBackward) :<C-U>call matchit#MultiMatch("bW", "n")<CR>
nnoremap <silent> <Plug>(MatchitNormalMultiForward) :<C-U>call matchit#MultiMatch("W", "n")<CR>
xnoremap <silent> <Plug>(MatchitVisualMultiBackward) :<C-U>call matchit#MultiMatch("bW", "n")<CR>m'gv``
xnoremap <silent> <Plug>(MatchitVisualMultiForward) :<C-U>call matchit#MultiMatch("W", "n")<CR>m'gv``
onoremap <silent> <Plug>(MatchitOperationMultiBackward) :<C-U>call matchit#MultiMatch("bW", "o")<CR>
onoremap <silent> <Plug>(MatchitOperationMultiForward) :<C-U>call matchit#MultiMatch("W", "o")<CR>
" Text object
xmap a% <Plug>(MatchitVisualTextObject)
endif
" text object:
xmap <silent> <Plug>(MatchitVisualTextObject) <Plug>(MatchitVisualMultiBackward)o<Plug>(MatchitVisualMultiForward)
if !exists("g:no_plugin_maps")
nmap <silent> % <Plug>(MatchitNormalForward)
nmap <silent> g% <Plug>(MatchitNormalBackward)
xmap <silent> % <Plug>(MatchitVisualForward)
xmap <silent> g% <Plug>(MatchitVisualBackward)
omap <silent> % <Plug>(MatchitOperationForward)
omap <silent> g% <Plug>(MatchitOperationBackward)
" Analogues of [{ and ]} using matching patterns:
nmap <silent> [% <Plug>(MatchitNormalMultiBackward)
nmap <silent> ]% <Plug>(MatchitNormalMultiForward)
xmap <silent> [% <Plug>(MatchitVisualMultiBackward)
xmap <silent> ]% <Plug>(MatchitVisualMultiForward)
omap <silent> [% <Plug>(MatchitOperationMultiBackward)
omap <silent> ]% <Plug>(MatchitOperationMultiForward)
" Text object
xmap a% <Plug>(MatchitVisualTextObject)
endif
endfun
fun MatchDisable()
" remove all the setup keymappings
nunmap %
nunmap g%
xunmap %
xunmap g%
ounmap %
ounmap g%
nunmap [%
nunmap ]%
xunmap [%
xunmap ]%
ounmap [%
ounmap ]%
xunmap a%
endfun
" Call this function to turn on debugging information. Every time the main
" script is run, buffer variables will be saved. These can be used directly
@@ -91,6 +112,14 @@ endif
if !exists(":MatchDebug")
command! -nargs=0 MatchDebug call matchit#Match_debug()
endif
if !exists(":MatchDisable")
command! -nargs=0 MatchDisable :call MatchDisable()
endif
if !exists(":MatchEnable")
command! -nargs=0 MatchEnable :call MatchEnable()
endif
call MatchEnable()
let &cpo = s:save_cpo
unlet s:save_cpo

View File

@@ -1401,9 +1401,19 @@ func s:CreateBreakpoint(id, subid, enabled)
else
let hiName = "debugBreakpoint"
endif
let label = ''
if exists('g:termdebug_config')
let label = get(g:termdebug_config, 'sign', '')
endif
if label == ''
let label = substitute(nr, '\..*', '', '')
if strlen(label) > 2
let label = strpart(label, strlen(label) - 2)
endif
endif
call sign_define('debugBreakpoint' .. nr,
\ #{text: substitute(nr, '\..*', '', ''),
\ texthl: hiName})
\ #{text: strpart(label, 0, 2),
\ texthl: hiName})
endif
endfunc

View File

@@ -30,10 +30,10 @@ function s:ManPager()
setlocal modifiable
" Emulate 'col -b'
silent! keepj keepp %s/\v(.)\b\ze\1?//ge
exe 'silent! keepj keepp %s/\v(.)\b\ze\1?//e' .. (&gdefault ? '' : 'g')
" Remove ansi sequences
silent! keepj keepp %s/\v\e\[%(%(\d;)?\d{1,2})?[mK]//ge
exe 'silent! keepj keepp %s/\v\e\[%(%(\d;)?\d{1,2})?[mK]//e' .. (&gdefault ? '' : 'g')
" Remove empty lines above the header
call cursor(1, 1)

View File

@@ -1,7 +1,7 @@
" Vim syntax file
" Language: EditorConfig
" Maintainer: Gregory Anders <greg@gpanders.com>
" Last Change: 2023-01-03
" Last Change: 2023-07-20
if exists('b:current_syntax')
finish
@@ -10,7 +10,7 @@ endif
runtime! syntax/dosini.vim
unlet! b:current_syntax
syntax match editorconfigUnknownProperty "^\s*\zs\w\+\ze\s*="
syntax match editorconfigUnknownProperty "^\s*\zs[a-zA-Z0-9_-]\+\ze\s*="
syntax keyword editorconfigProperty root charset end_of_line indent_style
syntax keyword editorconfigProperty indent_size tab_width max_line_length

View File

@@ -7,7 +7,7 @@
>#+0#0000e05&| +0#0000000&@73
|#+0#0000e05&| |H|e|r|e| |i|s| |t|h|e| |h|e|a|r|t| |o|f| |t|h|i|s| |s|c|r|i|p|t|:| +0#0000000&@39
|#+0#0000e05&| +0#0000000&@73
|e+0#af5f00255&|c|h|o| +0#e000002&|"+0#af5f00255&|P+0#e000002&|r|o|c|e|s@1|i|n|g| |t|h|e| |f|o|l@1|o|w|i|n|g| |c|o|m@1|a|n|d| |l|i|n|e| |a|r|g|u|e|m|e|n|t|s|:| |$+0#e000e06&|{|*|:+0#af5f00255&|-|n+0#0000000&|o|n|e|}+0#e000e06&|"+0#af5f00255&| +0#0000000&@7
|e+0#af5f00255&|c|h|o| +0#e000002&|"+0#af5f00255&|P+0#e000002&|r|o|c|e|s@1|i|n|g| |t|h|e| |f|o|l@1|o|w|i|n|g| |c|o|m@1|a|n|d| |l|i|n|e| |a|r|g|u|m|e|n|t|s|:| |$+0#e000e06&|{|*|:+0#af5f00255&|-|n+0#0000000&|o|n|e|}+0#e000e06&|"+0#af5f00255&| +0#0000000&@8
|e+0#af5f00255&|c|h|o| +0#e000002&|"+0#af5f00255&|S+0#e000002&|c|r|i|p|t|:| @3|f|o|r| |l|o@1|p| |o|u|t|s|i|d|e| |a| |f|u|n|c|t|i|o|n|:|\+0#e000e06&|t|\|c|"+0#af5f00255&| +0#0000000&@24
|f+0#af5f00255&|o|r| +0#0000000&|V|a|r| @67
|d+0#af5f00255&|o| +0#0000000&@72

View File

@@ -1,5 +1,5 @@
|#+0#0000e05#ffffff0| +0#0000000&@73
|e+0#af5f00255&|c|h|o| +0#e000002&|"+0#af5f00255&|P+0#e000002&|r|o|c|e|s@1|i|n|g| |t|h|e| |f|o|l@1|o|w|i|n|g| |c|o|m@1|a|n|d| |l|i|n|e| |a|r|g|u|e|m|e|n|t|s|:| |$+0#e000e06&|{|*|:+0#af5f00255&|-|n+0#0000000&|o|n|e|}+0#e000e06&|"+0#af5f00255&| +0#0000000&@7
|e+0#af5f00255&|c|h|o| +0#e000002&|"+0#af5f00255&|P+0#e000002&|r|o|c|e|s@1|i|n|g| |t|h|e| |f|o|l@1|o|w|i|n|g| |c|o|m@1|a|n|d| |l|i|n|e| |a|r|g|u|m|e|n|t|s|:| |$+0#e000e06&|{|*|:+0#af5f00255&|-|n+0#0000000&|o|n|e|}+0#e000e06&|"+0#af5f00255&| +0#0000000&@8
|e+0#af5f00255&|c|h|o| +0#e000002&|"+0#af5f00255&|S+0#e000002&|c|r|i|p|t|:| @3|f|o|r| |l|o@1|p| |o|u|t|s|i|d|e| |a| |f|u|n|c|t|i|o|n|:|\+0#e000e06&|t|\|c|"+0#af5f00255&| +0#0000000&@24
|f+0#af5f00255&|o|r| +0#0000000&|V|a|r| @67
|d+0#af5f00255&|o| +0#0000000&@72

View File

@@ -73,7 +73,7 @@ done ; echo
#
# Here is the heart of this script:
#
echo "Processing the following command line arguements: ${*:-none}"
echo "Processing the following command line arguments: ${*:-none}"
echo "Script: for loop outside a function:\t\c"
for Var
do

103
runtime/syntax/unison.vim Normal file
View File

@@ -0,0 +1,103 @@
" Vim syntax file
"
" Language: unison
" Maintainer: Anton Parkhomenko <anton@chuwy.me>
" Last Change: Aug 7, 2023
" Original Author: John Williams, Paul Chiusano and Rúnar Bjarnason
if exists("b:current_syntax")
finish
endif
syntax include @markdown $VIMRUNTIME/syntax/markdown.vim
syn cluster markdownLikeDocs contains=markdownBold,markdownItalic,markdownLinkText,markdownListMarker,markdownOrderedListMarker,markdownH1,markdownH2,markdownH3,markdownH4,markdownH5,markdownH6
syn match unisonOperator "[-!#$%&\*\+/<=>\?@\\^|~]"
syn match unisonDelimiter "[\[\](){},.]"
" Strings and constants
syn match unisonSpecialChar contained "\\\([0-9]\+\|o[0-7]\+\|x[0-9a-fA-F]\+\|[\"\\'&\\abfnrtv]\|^[A-Z^_\[\\\]]\)"
syn match unisonSpecialChar contained "\\\(NUL\|SOH\|STX\|ETX\|EOT\|ENQ\|ACK\|BEL\|BS\|HT\|LF\|VT\|FF\|CR\|SO\|SI\|DLE\|DC1\|DC2\|DC3\|DC4\|NAK\|SYN\|ETB\|CAN\|EM\|SUB\|ESC\|FS\|GS\|RS\|US\|SP\|DEL\)"
syn match unisonSpecialCharError contained "\\&\|'''\+"
syn region unisonString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=unisonSpecialChar
syn match unisonCharacter "[^a-zA-Z0-9_']'\([^\\]\|\\[^']\+\|\\'\)'"lc=1 contains=unisonSpecialChar,unisonSpecialCharError
syn match unisonCharacter "^'\([^\\]\|\\[^']\+\|\\'\)'" contains=unisonSpecialChar,unisonSpecialCharError
syn match unisonNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>"
syn match unisonFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
" Keyword definitions. These must be patterns instead of keywords
" because otherwise they would match as keywords at the start of a
" "literate" comment (see lu.vim).
syn match unisonModule "\<namespace\>"
syn match unisonImport "\<use\>"
syn match unisonTypedef "\<\(unique\|structural\|∀\|forall\)\>"
syn match unisonStatement "\<\(ability\|do\|type\|where\|match\|cases\|;\|let\|with\|handle\)\>"
syn match unisonConditional "\<\(if\|else\|then\)\>"
syn match unisonBoolean "\<\(true\|false\)\>"
syn match unisonType "\<\C[A-Z][0-9A-Za-z_'!]*\>"
syn match unisonName "\<\C[a-z_][0-9A-Za-z_'!]*\>"
" Comments
syn match unisonLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$"
syn region unisonBlockComment start="{-" end="-}" contains=unisonBlockComment
syn region unisonBelowFold start="^---" skip="." end="." contains=unisonBelowFold
" Docs
syn region unisonDocBlock matchgroup=unisonDoc start="{{" end="}}" contains=unisonDocTypecheck,unisonDocQuasiquote,unisonDocDirective,unisonDocCode,unisonDocCodeInline,unisonDocCodeRaw,unisonDocMono,@markdownLikeDocs
syn region unisonDocQuasiquote contained matchgroup=unisonDocQuote start="{{" end= "}}" contains=TOP
syn region unisonDocCode contained matchgroup=unisonDocCode start="^\s*```\s*$" end="^\s*```\s*$" contains=TOP
syn region unisonDocTypecheck contained matchgroup=unisonDocCode start="^\s*@typecheck\s*```\s*$" end="^\s*```\s*$" contains=TOP
syn region unisonDocCodeRaw contained matchgroup=unisonDocCode start="^\s*```\s*raw\s*$" end="^\s*```\s*$" contains=NoSyntax
syn region unisonDocCodeInline contained matchgroup=unisonDocCode start="`\@<!``" end="`\@<!``" contains=TOP
syn match unisonDocMono "''[^']*''"
syn region unisonDocDirective contained matchgroup=unisonDocDirective start="\(@\([a-zA-Z0-9_']*\)\)\?{{\@!" end="}" contains=TOP
syn match unisonDebug "\<\(todo\|bug\|Debug.trace\|Debug.evalToText\)\>"
" things like
" > my_func 1 3
" test> Function.tap.tests.t1 = check let
" use Nat == +
" ( 99, 100 ) === (withInitialValue 0 do
" : : :
syn match unisonWatch "^[A-Za-z]*>"
hi def link unisonWatch Debug
hi def link unisonDocMono Delimiter
hi def link unisonDocDirective Import
hi def link unisonDocQuote Delimiter
hi def link unisonDocCode Delimiter
hi def link unisonDoc String
hi def link unisonBelowFold Comment
hi def link unisonBlockComment Comment
hi def link unisonBoolean Boolean
hi def link unisonCharacter Character
hi def link unisonComment Comment
hi def link unisonConditional Conditional
hi def link unisonConditional Conditional
hi def link unisonDebug Debug
hi def link unisonDelimiter Delimiter
hi def link unisonDocBlock String
hi def link unisonDocDirective Import
hi def link unisonDocIncluded Import
hi def link unisonFloat Float
hi def link unisonImport Include
hi def link unisonLineComment Comment
hi def link unisonLink Type
hi def link unisonName Identifier
hi def link unisonNumber Number
hi def link unisonOperator Operator
hi def link unisonSpecialChar SpecialChar
hi def link unisonSpecialCharError Error
hi def link unisonStatement Statement
hi def link unisonString String
hi def link unisonType Type
hi def link unisonTypedef Typedef
let b:current_syntax = "unison"
" Options for vi: ts=8 sw=2 sts=2 nowrap noexpandtab ft=vim

View File

@@ -1,7 +1,7 @@
" Vim syntax file
" Language: WebAssembly
" Maintainer: rhysd <lin90162@yahoo.co.jp>
" Last Change: Jul 29, 2018
" Last Change: Aug 7, 2023
" For bugs, patches and license go to https://github.com/rhysd/vim-wasm
if exists("b:current_syntax")
@@ -11,33 +11,42 @@ endif
let s:cpo_save = &cpo
set cpo&vim
syn cluster wastCluster contains=wastModule,wastInstWithType,wastInstGeneral,wastParamInst,wastControlInst,wastString,wastNamedVar,wastUnnamedVar,wastFloat,wastNumber,wastComment,wastList,wastType
syn cluster wastNotTop contains=wastModule,wastInstWithType,wastInstGetSet,wastInstGeneral,wastParamInst,wastControlInst,wastSimdInst,wastString,wastNamedVar,wastUnnamedVar,wastFloat,wastNumber,wastComment,wastList,wastType
" Instructions
" https://webassembly.github.io/spec/core/text/instructions.html
" Note: memarg (align=,offset=) can be added to memory instructions
syn match wastInstWithType "\%((\s*\)\@<=\<\%(i32\|i64\|f32\|f64\|memory\)\.[[:alnum:]_]\+\%(/\%(i32\|i64\|f32\|f64\)\)\=\>\%(\s\+\%(align\|offset\)=\)\=" contained display
syn match wastInstGeneral "\%((\s*\)\@<=\<[[:alnum:]_]\+\>" contained display
syn match wastInstGetSet "\%((\s*\)\@<=\<\%(local\|global\)\.\%(get\|set\)\>" contained display
" https://webassembly.github.io/spec/core/text/instructions.html#control-instructions
syn match wastControlInst "\%((\s*\)\@<=\<\%(block\|end\|loop\|if\|else\|unreachable\|nop\|br\|br_if\|br_table\|return\|call\|call_indirect\)\>" contained display
syn match wastControlInst "\%((\s*\)\@<=\<\%(block\|end\|loop\|if\|then\|else\|unreachable\|nop\|br\|br_if\|br_table\|return\|call\|call_indirect\)\>" contained display
" https://webassembly.github.io/spec/core/text/instructions.html#parametric-instructions
syn match wastParamInst "\%((\s*\)\@<=\<\%(drop\|select\)\>" contained display
" SIMD instructions
" https://webassembly.github.io/simd/core/text/instructions.html#simd-instructions
syn match wastSimdInst "\<\%(v128\|i8x16\|i16x8\|i32x4\|i64x2\|f32x4\|f64x2)\)\.[[:alnum:]_]\+\%(\s\+\%(i8x16\|i16x8\|i32x4\|i64x2\|f32x4\|f64x2\)\)\=\>" contained display
" Identifiers
" https://webassembly.github.io/spec/core/text/values.html#text-id
syn match wastNamedVar "$\+[[:alnum:]!#$%&'./:=><?@\\^_`~+-]*" contained display
syn match wastNamedVar "$\+[[:alnum:]!#$%&'./:=><?@\\^_`~+-]*" contained contains=wastEscapeUtf8
syn match wastUnnamedVar "$\+\d\+[[:alnum:]!#$%&'./:=><?@\\^_`~+-]\@!" contained display
" Presuming the source text is itself encoded correctly, strings that do not
" contain any uses of hexadecimal byte escapes are always valid names.
" https://webassembly.github.io/spec/core/text/values.html#names
syn match wastEscapedUtf8 "\\\x\{1,6}" contained containedin=wastNamedVar display
" String literals
" https://webassembly.github.io/spec/core/text/values.html#strings
syn region wastString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained contains=wastStringSpecial
syn match wastStringSpecial "\\\x\x\|\\[tnr'\\\"]\|\\u\x\+" contained containedin=wastString
syn match wastStringSpecial "\\\x\x\|\\[tnr'\\\"]\|\\u\x\+" contained containedin=wastString display
" Float literals
" https://webassembly.github.io/spec/core/text/values.html#floating-point
syn match wastFloat "\<-\=\d\%(_\=\d\)*\%(\.\d\%(_\=\d\)*\)\=\%([eE][-+]\=\d\%(_\=\d\)*\)\=" display contained
syn match wastFloat "\<-\=0x\x\%(_\=\d\)*\%(\.\x\%(_\=\x\)*\)\=\%([pP][-+]\=\d\%(_\=\d\)*\)\=" display contained
syn match wastFloat "\<-\=0x\x\%(_\=\x\)*\%(\.\x\%(_\=\x\)*\)\=\%([pP][-+]\=\d\%(_\=\d\)*\)\=" display contained
syn keyword wastFloat inf nan contained
syn match wastFloat "nan:0x\x\%(_\=\x\)*" display contained
" Integer literals
" https://webassembly.github.io/spec/core/text/values.html#integers
@@ -46,14 +55,15 @@ syn match wastNumber "\<-\=0x\x\%(_\=\x\)*\>" display contained
" Comments
" https://webassembly.github.io/spec/core/text/lexical.html#comments
syn region wastComment start=";;" end="$" display
syn region wastComment start=";;" end="$"
syn region wastComment start="(;;\@!" end=";)"
syn region wastList matchgroup=wastListDelimiter start="(;\@!" matchgroup=wastListDelimiter end=";\@<!)" contains=@wastCluster
syn region wastList matchgroup=wastListDelimiter start="(;\@!" matchgroup=wastListDelimiter end=";\@<!)" contains=@wastNotTop
" Types
" https://webassembly.github.io/spec/core/text/types.html
syn keyword wastType i64 i32 f64 f32 param result anyfunc mut contained
" Note: `mut` was changed to `const`/`var` at Wasm 2.0
syn keyword wastType i64 i32 f64 f32 param result funcref func externref extern mut v128 const var contained
syn match wastType "\%((\_s*\)\@<=func\%(\_s*[()]\)\@=" display contained
" Modules
@@ -61,13 +71,15 @@ syn match wastType "\%((\_s*\)\@<=func\%(\_s*[()]\)\@=" display conta
syn keyword wastModule module type export import table memory global data elem contained
syn match wastModule "\%((\_s*\)\@<=func\%(\_s\+\$\)\@=" display contained
syn sync lines=100
syn sync maxlines=100
hi def link wastModule PreProc
hi def link wastListDelimiter Delimiter
hi def link wastInstWithType Operator
hi def link wastInstGetSet Operator
hi def link wastInstGeneral Operator
hi def link wastControlInst Statement
hi def link wastSimdInst Operator
hi def link wastParamInst Conditional
hi def link wastString String
hi def link wastStringSpecial Special
@@ -77,6 +89,7 @@ hi def link wastFloat Float
hi def link wastNumber Number
hi def link wastComment Comment
hi def link wastType Type
hi def link wastEscapedUtf8 Special
let b:current_syntax = "wast"

View File

@@ -2018,7 +2018,6 @@ apply_autocmds_group(
int did_save_redobuff = FALSE;
save_redo_T save_redo;
int save_KeyTyped = KeyTyped;
int save_did_emsg;
ESTACK_CHECK_DECLARATION;
/*
@@ -2310,12 +2309,14 @@ apply_autocmds_group(
else
check_lnums_nested(TRUE);
save_did_emsg = did_emsg;
int save_did_emsg = did_emsg;
int save_ex_pressedreturn = get_pressedreturn();
do_cmdline(NULL, getnextac, (void *)&patcmd,
DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT);
did_emsg += save_did_emsg;
set_pressedreturn(save_ex_pressedreturn);
if (nesting == 1)
// restore cursor and topline, unless they were changed

View File

@@ -502,7 +502,7 @@ can_unload_buffer(buf_T *buf)
* It can be:
* 0 buffer becomes hidden
* DOBUF_UNLOAD buffer is unloaded
* DOBUF_DELETE buffer is unloaded and removed from buffer list
* DOBUF_DEL buffer is unloaded and removed from buffer list
* DOBUF_WIPE buffer is unloaded and really deleted
* DOBUF_WIPE_REUSE idem, and add to buf_reuse list
* When doing all but the first one on the current buffer, the caller should
@@ -5108,14 +5108,6 @@ build_stl_str_hl(
STRMOVE(s + 1, p);
*s = '<';
// Fill up for half a double-wide character.
while (++width < maxwidth)
{
s = s + STRLEN(s);
MB_CHAR2BYTES(fillchar, s);
*s = NUL;
}
--n; // count the '<'
for (; l < itemcnt; l++)
{
@@ -5124,6 +5116,14 @@ build_stl_str_hl(
else
stl_items[l].stl_start = s;
}
// Fill up for half a double-wide character.
while (++width < maxwidth)
{
s = s + STRLEN(s);
MB_CHAR2BYTES(fillchar, s);
*s = NUL;
}
}
width = maxwidth;
}

View File

@@ -1267,6 +1267,13 @@ crypt_sodium_buffer_decode(
}
# if defined(FEAT_SODIUM) || defined(PROTO)
void
crypt_sodium_lock_key(char_u *key)
{
if (sodium_init() >= 0)
sodium_mlock(key, STRLEN(key));
}
int
crypt_sodium_munlock(void *const addr, const size_t len)
{

View File

@@ -1037,6 +1037,8 @@ EXTERN char e_missing_argument_str[]
INIT(= N_("E417: Missing argument: %s"));
EXTERN char e_illegal_value_str[]
INIT(= N_("E418: Illegal value: %s"));
EXTERN char e_im_a_teapot[]
INIT(= N_("E418: I'm a teapot"));
EXTERN char e_fg_color_unknown[]
INIT(= N_("E419: FG color unknown"));
EXTERN char e_bg_color_unknown[]
@@ -1270,6 +1272,8 @@ EXTERN char e_is_not_file_or_writable_device[]
INIT(= N_("is not a file or writable device"));
EXTERN char e_str_is_not_file_or_writable_device[]
INIT(= N_("E503: \"%s\" is not a file or writable device"));
EXTERN char e_coffee_currently_not_available[]
INIT(= N_("E503: Coffee is currently not available"));
// E504
EXTERN char e_is_read_only_cannot_override_W_in_cpoptions[]
INIT(= N_("is read-only (cannot override: \"W\" in 'cpoptions')"));

View File

@@ -45,6 +45,7 @@ static void f_did_filetype(typval_T *argvars, typval_T *rettv);
static void f_echoraw(typval_T *argvars, typval_T *rettv);
static void f_empty(typval_T *argvars, typval_T *rettv);
static void f_environ(typval_T *argvars, typval_T *rettv);
static void f_err_teapot(typval_T *argvars, typval_T *rettv);
static void f_escape(typval_T *argvars, typval_T *rettv);
static void f_eval(typval_T *argvars, typval_T *rettv);
static void f_eventhandler(typval_T *argvars, typval_T *rettv);
@@ -1881,6 +1882,8 @@ static funcentry_T global_functions[] =
ret_number_bool, f_empty},
{"environ", 0, 0, 0, NULL,
ret_dict_string, f_environ},
{"err_teapot", 0, 1, 0, NULL,
ret_number_bool, f_err_teapot},
{"escape", 2, 2, FEARG_1, arg2_string,
ret_string, f_escape},
{"eval", 1, 1, FEARG_1, arg1_string,
@@ -3922,6 +3925,33 @@ f_environ(typval_T *argvars UNUSED, typval_T *rettv)
#endif
}
/*
* "err_teapot()" function
*/
static void
f_err_teapot(typval_T *argvars, typval_T *rettv UNUSED)
{
if (argvars[0].v_type != VAR_UNKNOWN)
{
if (argvars[0].v_type == VAR_STRING)
{
char_u *s = tv_get_string_strict(&argvars[0]);
if (s == NULL || *skipwhite(s) == NUL)
return;
}
int err = FALSE;
int do_503 = eval_expr_to_bool(&argvars[0], &err);
if (!err && do_503)
{
emsg(_(e_coffee_currently_not_available));
return;
}
}
emsg(_(e_im_a_teapot));
}
/*
* "escape({string}, {chars})" function
*/
@@ -6456,6 +6486,14 @@ f_has(typval_T *argvars, typval_T *rettv)
1
#else
0
#endif
},
{":tearoff",
// same #ifdef as used for ex_tearoff().
#if defined(FEAT_GUI_MSWIN) && defined(FEAT_MENU) && defined(FEAT_TEAROFF)
1
#else
0
#endif
},
{NULL, 0}

View File

@@ -9840,7 +9840,6 @@ is_loclist_cmd(int cmdidx)
}
#endif
#if defined(FEAT_TIMERS) || defined(PROTO)
int
get_pressedreturn(void)
{
@@ -9852,4 +9851,3 @@ set_pressedreturn(int val)
{
ex_pressedreturn = val;
}
#endif

View File

@@ -424,6 +424,24 @@ error:
}
#if defined(FEAT_CRYPT) || defined(PROTO)
/*
* Swapfile encryption is not supported by XChaCha20. If this crypt method is
* used then disable the swapfile, to avoid plain text being written to disk,
* and return TRUE.
* Otherwise return FALSE.
*/
static int
crypt_may_close_swapfile(buf_T *buf, char_u *key, int method)
{
if (crypt_method_is_sodium(method) && *key != NUL)
{
mf_close_file(buf, TRUE);
buf->b_p_swf = FALSE;
return TRUE;
}
return FALSE;
}
/*
* Prepare encryption for "buf" for the current key and method.
*/
@@ -440,11 +458,10 @@ ml_set_mfp_crypt(buf_T *buf)
// Generate a seed and store it in the memfile.
sha2_seed(buf->b_ml.ml_mfp->mf_seed, MF_SEED_LEN, NULL, 0);
}
#ifdef FEAT_SODIUM
# ifdef FEAT_SODIUM
else if (crypt_method_is_sodium(method_nr))
crypt_sodium_randombytes_buf(buf->b_ml.ml_mfp->mf_seed,
MF_SEED_LEN);
#endif
crypt_sodium_randombytes_buf(buf->b_ml.ml_mfp->mf_seed, MF_SEED_LEN);
# endif
}
/*
@@ -501,16 +518,10 @@ ml_set_crypt_key(
return; // no memfile yet, nothing to do
old_method = crypt_method_nr_from_name(old_cm);
// Swapfile encryption is not supported by XChaCha20, therefore disable the
// swapfile to avoid plain text being written to disk.
if (crypt_method_is_sodium(crypt_get_method_nr(buf))
&& *buf->b_p_key != NUL)
{
// close the swapfile
mf_close_file(buf, TRUE);
buf->b_p_swf = FALSE;
#ifdef FEAT_CRYPT
if (crypt_may_close_swapfile(buf, buf->b_p_key, crypt_get_method_nr(buf)))
return;
}
#endif
// First make sure the swapfile is in a consistent state, using the old
// key and method.
@@ -2494,6 +2505,12 @@ ml_sync_all(int check_file, int check_char)
|| buf->b_ml.ml_mfp->mf_fd < 0)
continue; // no file
#ifdef FEAT_CRYPT
if (crypt_may_close_swapfile(buf, buf->b_p_key,
crypt_get_method_nr(buf)))
continue;
#endif
ml_flush_line(buf); // flush buffered line
// flush locked block
(void)ml_find_line(buf, (linenr_T)0, ML_FLUSH);
@@ -2551,6 +2568,10 @@ ml_preserve(buf_T *buf, int message)
emsg(_(e_cannot_preserve_there_is_no_swap_file));
return;
}
#ifdef FEAT_CRYPT
if (crypt_may_close_swapfile(buf, buf->b_p_key, crypt_get_method_nr(buf)))
return;
#endif
// We only want to stop when interrupted here, not when interrupted
// before.
@@ -3626,7 +3647,7 @@ adjust_text_props_for_delete(
int idx;
int line_start;
long line_size;
int this_props_len;
int this_props_len = 0;
char_u *text;
size_t textlen;
int found;
@@ -5571,6 +5592,9 @@ ml_crypt_prepare(memfile_T *mfp, off_T offset, int reading)
if (*key == NUL)
return NULL;
if (crypt_may_close_swapfile(buf, key, method_nr))
return NULL;
if (method_nr == CRYPT_M_ZIP)
{
// For PKzip: Append the offset to the key, so that we use a different

View File

@@ -2591,17 +2591,20 @@ scroll_cursor_bot(int min_scroll, int set_topbot)
(curwin, curwin->w_topline, FALSE);
int skip_lines = 0;
int width1 = curwin->w_width - curwin_col_off();
int width2 = width1 + curwin_col_off2();
// similar formula is used in curs_columns()
if (curwin->w_skipcol > width1)
skip_lines += (curwin->w_skipcol - width1) / width2 + 1;
else if (curwin->w_skipcol > 0)
skip_lines = 1;
top_plines -= skip_lines;
if (top_plines > curwin->w_height)
if (width1 > 0)
{
scrolled += (top_plines - curwin->w_height);
int width2 = width1 + curwin_col_off2();
// similar formula is used in curs_columns()
if (curwin->w_skipcol > width1)
skip_lines += (curwin->w_skipcol - width1) / width2 + 1;
else if (curwin->w_skipcol > 0)
skip_lines = 1;
top_plines -= skip_lines;
if (top_plines > curwin->w_height)
{
scrolled += (top_plines - curwin->w_height);
}
}
}
}

View File

@@ -2135,10 +2135,14 @@ do_set_option_numeric(
((flags & P_VI_DEF) || cp_val) ? VI_DEFAULT : VIM_DEFAULT];
else if (nextchar == '<')
{
// For 'undolevels' NO_LOCAL_UNDOLEVEL means to
// use the global value.
if ((long *)varp == &curbuf->b_p_ul && opt_flags == OPT_LOCAL)
// for 'undolevels' NO_LOCAL_UNDOLEVEL means using the global value
value = NO_LOCAL_UNDOLEVEL;
else if (opt_flags == OPT_LOCAL
&& ((long *)varp == &curwin->w_p_siso
|| (long *)varp == &curwin->w_p_so))
// for 'scrolloff'/'sidescrolloff' -1 means using the global value
value = -1;
else
value = *(long *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL);
}

View File

@@ -1174,6 +1174,10 @@ did_set_cryptkey(optset_T *args)
*curbuf->b_p_cm == NUL ? p_cm : curbuf->b_p_cm);
changed_internal();
}
# ifdef FEAT_SODIUM
if (crypt_method_is_sodium(crypt_get_method_nr(curbuf)))
crypt_sodium_lock_key(args->os_newval.string);
# endif
return NULL;
}

View File

@@ -26,6 +26,7 @@ void crypt_check_swapfile_curbuf(void);
void crypt_check_current_method(void);
char_u *crypt_get_key(int store, int twice);
void crypt_append_msg(buf_T *buf);
void crypt_sodium_lock_key(char_u *key);
int crypt_sodium_munlock(void *const addr, const size_t len);
void crypt_sodium_randombytes_buf(void *const buf, const size_t size);
int crypt_sodium_init(void);

View File

@@ -0,0 +1,19 @@
| +0#af5f00255#ffffff0||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
>@+0#4040ff13&||+1#0000000&| +0&&@72
|<+3&&| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @59
| +0&&@74

View File

@@ -92,6 +92,9 @@ set shellslash
" Common with all tests on all systems.
source setup.vim
" Needed for RunningWithValgrind().
source shared.vim
" For consistency run all tests with 'nocompatible' set.
" This also enables use of line continuation.
set nocp viminfo+=nviminfo
@@ -219,12 +222,18 @@ unlet name
func TestTimeout(id)
split test.log
call append(line('$'), '')
call append(line('$'), 'Test timed out: ' .. g:testfunc)
let text = 'Test timed out: ' .. g:testfunc
if g:timeout_start > 0
let text ..= strftime(' after %s seconds', localtime() - g:timeout_start)
endif
call append(line('$'), text)
write
call add(v:errors, 'Test timed out: ' . g:testfunc)
call add(v:errors, text)
cquit! 42
endfunc
let g:timeout_start = 0
func RunTheTest(test)
let prefix = ''
@@ -237,7 +246,9 @@ func RunTheTest(test)
if has('timers')
" No test should take longer than 30 seconds. If it takes longer we
" assume we are stuck and need to break out.
let test_timeout_timer = timer_start(30000, 'TestTimeout')
let test_timeout_timer =
\ timer_start(RunningWithValgrind() ? 50000 : 30000, 'TestTimeout')
let g:timeout_start = localtime()
endif
" Avoid stopping at the "hit enter" prompt
@@ -307,6 +318,7 @@ func RunTheTest(test)
if has('timers')
call timer_stop(test_timeout_timer)
let g:timeout_start = 0
endif
" Clear any autocommands and put back the catch-all for SwapExists.
@@ -371,7 +383,7 @@ func RunTheTest(test)
" close any split windows
while winnr('$') > 1
bwipe!
noswapfile bwipe!
endwhile
" May be editing some buffer, wipe it out. Then we may end up in another
@@ -399,6 +411,24 @@ func RunTheTest(test)
endif
endfunc
function Delete_Xtest_Files()
for file in glob('X*', v:false, v:true)
if file ==? 'XfakeHOME'
" Clean up files created by setup.vim
call delete('XfakeHOME', 'rf')
continue
endif
" call add(v:errors, file .. " exists when it shouldn't, trying to delete it!")
call delete(file)
if !empty(glob(file, v:false, v:true))
" call add(v:errors, file .. " still exists after trying to delete it!")
if has('unix')
call system('rm -rf ' .. file)
endif
endif
endfor
endfunc
func AfterTheTest(func_name)
if len(v:errors) > 0
if match(s:may_fail_list, '^' .. a:func_name) >= 0
@@ -427,13 +457,11 @@ endfunc
" This function can be called by a test if it wants to abort testing.
func FinishTesting()
call AfterTheTest('')
call Delete_Xtest_Files()
" Don't write viminfo on exit.
set viminfo=
" Clean up files created by setup.vim
call delete('XfakeHOME', 'rf')
if s:fail == 0 && s:fail_expected == 0
" Success, create the .res file so that make knows it's done.
exe 'split ' . fnamemodify(g:testname, ':r') . '.res'

View File

@@ -22,11 +22,11 @@ endif
func Common_head_only(text)
" This was crashing Vim
split Xtest.txt
split Xtest_head.txt
call setline(1, a:text)
wq
call feedkeys(":split Xtest.txt\<CR>foobar\<CR>", "tx")
call delete('Xtest.txt')
call feedkeys(":split Xtest_head.txt\<CR>foobar\<CR>", "tx")
call delete('Xtest_head.txt')
call assert_match('VimCrypt', getline(1))
bwipe!
endfunc
@@ -49,7 +49,7 @@ func Crypt_uncrypt(method)
" If the blowfish test fails 'cryptmethod' will be 'zip' now.
call assert_equal(a:method, &cryptmethod)
split Xtest.txt
split Xtest_uncrypt.txt
let text =<< trim END
01234567890123456789012345678901234567,
line 2 foo bar blah,
@@ -60,11 +60,11 @@ func Crypt_uncrypt(method)
call assert_equal('*****', &key)
w!
bwipe!
call feedkeys(":split Xtest.txt\<CR>foobar\<CR>", 'xt')
call feedkeys(":split Xtest_uncrypt.txt\<CR>foobar\<CR>", 'xt')
call assert_equal(text, getline(1, 3))
set key= cryptmethod&
bwipe!
call delete('Xtest.txt')
call delete('Xtest_uncrypt.txt')
endfunc
func Test_crypt_zip()
@@ -105,7 +105,7 @@ func Test_crypt_sodium_v2_startup()
exe buf .. 'bwipe!'
call assert_true(filereadable('Xfoo'))
let buf = RunVimInTerminal('--cmd "set ch=3 cm=xchacha20v2 key=foo" Xfoo', #{rows: 10})
let buf = RunVimInTerminal('--cmd "set ch=3 cm=xchacha20v2 key=foo" Xfoo', #{wait_for_ruler: 0, rows: 10})
call g:TermWait(buf, g:RunningWithValgrind() ? 1000 : 50)
call StopVimInTerminal(buf)
@@ -113,17 +113,17 @@ func Test_crypt_sodium_v2_startup()
endfunc
func Uncrypt_stable(method, crypted_text, key, uncrypted_text)
split Xtest.txt
split Xtest_stable.txt
set bin noeol key= fenc=latin1
exe "set cryptmethod=" . a:method
call setline(1, a:crypted_text)
w!
bwipe!
set nobin
call feedkeys(":split Xtest.txt\<CR>" . a:key . "\<CR>", 'xt')
call feedkeys(":split Xtest_stable.txt\<CR>" . a:key . "\<CR>", 'xt')
call assert_equal(a:uncrypted_text, getline(1, len(a:uncrypted_text)))
bwipe!
call delete('Xtest.txt')
call delete('Xtest_stable.txt')
set key=
endfunc
@@ -132,13 +132,13 @@ func Uncrypt_stable_xxd(method, hex, key, uncrypted_text, verbose)
throw 'Skipped: xxd program missing'
endif
" use xxd to write the binary content
call system(s:xxd_cmd .. ' -r >Xtest.txt', a:hex)
call system(s:xxd_cmd .. ' -r >Xtest_stable_xxd.txt', a:hex)
let cmd = (a:verbose ? ':verbose' : '') ..
\ ":split Xtest.txt\<CR>" . a:key . "\<CR>"
\ ":split Xtest_stable_xxd.txt\<CR>" . a:key . "\<CR>"
call feedkeys(cmd, 'xt')
call assert_equal(a:uncrypted_text, getline(1, len(a:uncrypted_text)))
bwipe!
call delete('Xtest.txt')
call delete('Xtest_stable_xxd.txt')
set key=
endfunc
@@ -189,7 +189,11 @@ func Test_uncrypt_xchacha20v2_custom()
00000060: a4cf 33d2 7507 ec38 ba62 a327 9068 d8ad ..3.u..8.b.'.h..
00000070: 2607 3fa6 f95d 7ea8 9799 f997 4820 0c &.?..]~.....H .
END
call Uncrypt_stable_xxd('xchacha20v2', hex, "foobar", ["", "foo", "bar", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"], 1)
try
call Uncrypt_stable_xxd('xchacha20v2', hex, "foobar", ["", "foo", "bar", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"], 1)
catch /^Vim\%((\a\+)\)\=:E1230:/ " sodium_mlock() not possible, may happen at Github CI
throw 'Skipped: sodium_mlock() not possible'
endtry
call assert_match('xchacha20v2: using custom \w\+ "\d\+" for Key derivation.', execute(':messages'))
endfunc
@@ -209,7 +213,11 @@ func Test_uncrypt_xchacha20v2()
00000090: 2416 205a 8c4c 5fde 4dac 2611 8a48 24f0 $. Z.L_.M.&..H$.
000000a0: ba00 92c1 60 ....`
END
call Uncrypt_stable_xxd('xchacha20v2', hex, "foo1234", ["abcdefghijklmnopqrstuvwxyzäöü", 'ZZZ_äüöÄÜÖ_!@#$%^&*()_+=-`~"'], 0)
try
call Uncrypt_stable_xxd('xchacha20v2', hex, "foo1234", ["abcdefghijklmnopqrstuvwxyzäöü", 'ZZZ_äüöÄÜÖ_!@#$%^&*()_+=-`~"'], 0)
catch /^Vim\%((\a\+)\)\=:E1230:/ " sodium_mlock() not possible, may happen at Github CI
throw 'Skipped: sodium_mlock() not possible'
endtry
endfunc
func Test_uncrypt_xchacha20_invalid()
@@ -220,6 +228,8 @@ func Test_uncrypt_xchacha20_invalid()
try
call feedkeys(":split samples/crypt_sodium_invalid.txt\<CR>sodium\<CR>", 'xt')
call assert_false(1, 'should not happen')
catch /^Vim\%((\a\+)\)\=:E1230:/ " sodium_mlock() not possible, may happen at Github CI
throw 'Skipped: sodium_mlock() not possible'
catch
call assert_exception('pre-mature')
endtry
@@ -272,7 +282,11 @@ func Test_uncrypt_xchacha20v2_2()
" swapfile disabled
call assert_equal(0, &swapfile)
call assert_match("Note: Encryption of swapfile not supported, disabling swap file", execute(':messages'))
w!
try
w!
catch /^Vim\%((\a\+)\)\=:E1230:/ " sodium_mlock() not possible, may happen at Github CI
throw 'Skipped: sodium_mlock() not possible'
endtry
" encrypted using xchacha20
call assert_match("\[xchachav2\]", execute(':messages'))
bw!
@@ -354,7 +368,7 @@ endfunc
func Test_crypt_key_mismatch()
set cryptmethod=blowfish
split Xtest.txt
split Xtest_mismatch.txt
call setline(1, 'nothing')
call feedkeys(":X\<CR>foobar\<CR>nothing\<CR>", 'xt')
call assert_match("Keys don't match!", execute(':2messages'))
@@ -392,4 +406,24 @@ func Test_crypt_set_key_changes_buffer()
call delete('Xtest1.txt')
endfunc
func Test_crypt_set_key_segfault()
CheckFeature sodium
defer delete('Xtest2.txt')
new Xtest2.txt
call setline(1, 'nothing')
set cryptmethod=xchacha20
set key=foobar
w
new Xtest3
put ='other content'
setl modified
sil! preserve
bwipe!
set cryptmethod&
set key=
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -239,6 +239,12 @@ func Test_ex_mode_errors()
au! CmdLineEnter
delfunc ExEnterFunc
au CmdlineEnter * :
call feedkeys("gQecho 1\r", 'xt')
au! CmdlineEnter
quit
endfunc

View File

@@ -122,6 +122,7 @@ def s:GetFilenameChecks(): dict<list<string>>
bicep: ['file.bicep'],
bindzone: ['named.root', '/bind/db.file', '/named/db.file', 'any/bind/db.file', 'any/named/db.file'],
bitbake: ['file.bb', 'file.bbappend', 'file.bbclass', 'build/conf/local.conf', 'meta/conf/layer.conf', 'build/conf/bbappend.conf', 'meta-layer/conf/distro/foo.conf'],
blade: ['file.blade.php'],
blank: ['file.bl'],
blueprint: ['file.blp'],
bsdl: ['file.bsd', 'file.bsdl'],
@@ -339,7 +340,7 @@ def s:GetFilenameChecks(): dict<list<string>>
jq: ['file.jq'],
jovial: ['file.jov', 'file.j73', 'file.jovial'],
jproperties: ['file.properties', 'file.properties_xx', 'file.properties_xx_xx', 'some.properties_xx_xx_file', 'org.eclipse.xyz.prefs'],
json: ['file.json', 'file.jsonp', 'file.json-patch', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', '.prettierrc', '.firebaserc', '.stylelintrc', 'file.slnf'],
json: ['file.json', 'file.jsonp', 'file.json-patch', 'file.geojson', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', '.prettierrc', '.firebaserc', '.stylelintrc', 'file.slnf'],
json5: ['file.json5'],
jsonc: ['file.jsonc', '.babelrc', '.eslintrc', '.jsfmtrc', '.jshintrc', '.hintrc', '.swrc', 'jsconfig.json', 'tsconfig.json', 'tsconfig.test.json', 'tsconfig-test.json'],
jsonl: ['file.jsonl'],
@@ -506,6 +507,7 @@ def s:GetFilenameChecks(): dict<list<string>>
pccts: ['file.g'],
pcmk: ['file.pcmk'],
pdf: ['file.pdf'],
pem: ['file.pem', 'file.cer', 'file.crt', 'file.csr'],
perl: ['file.plx', 'file.al', 'file.psgi', 'gitolite.rc', '.gitolite.rc', 'example.gitolite.rc', '.latexmkrc', 'latexmkrc'],
pf: ['pf.conf'],
pfmain: ['main.cf', 'main.cf.proto'],
@@ -542,6 +544,7 @@ def s:GetFilenameChecks(): dict<list<string>>
psl: ['file.psl'],
pug: ['file.pug'],
puppet: ['file.pp'],
pymanifest: ['MANIFEST.in'],
pyret: ['file.arr'],
pyrex: ['file.pyx', 'file.pxd'],
python: ['file.py', 'file.pyw', '.pythonstartup', '.pythonrc', 'file.ptl', 'file.pyi', 'SConstruct'],
@@ -740,6 +743,7 @@ def s:GetFilenameChecks(): dict<list<string>>
udevperm: ['/etc/udev/permissions.d/file.permissions', 'any/etc/udev/permissions.d/file.permissions'],
udevrules: ['/etc/udev/rules.d/file.rules', '/usr/lib/udev/rules.d/file.rules', '/lib/udev/rules.d/file.rules'],
uil: ['file.uit', 'file.uil'],
unison: ['file.u', 'file.uu'],
updatedb: ['/etc/updatedb.conf', 'any/etc/updatedb.conf'],
upstart: ['/usr/share/upstart/file.conf', '/usr/share/upstart/file.override', '/etc/init/file.conf', '/etc/init/file.override', '/.init/file.conf', '/.init/file.override', '/.config/upstart/file.conf', '/.config/upstart/file.override', 'any/.config/upstart/file.conf', 'any/.config/upstart/file.override', 'any/.init/file.conf', 'any/.init/file.override', 'any/etc/init/file.conf', 'any/etc/init/file.override', 'any/usr/share/upstart/file.conf', 'any/usr/share/upstart/file.override'],
upstreamdat: ['upstream.dat', 'UPSTREAM.DAT', 'upstream.file.dat', 'UPSTREAM.FILE.DAT', 'file.upstream.dat', 'FILE.UPSTREAM.DAT'],
@@ -749,6 +753,7 @@ def s:GetFilenameChecks(): dict<list<string>>
usd: ['file.usda', 'file.usd'],
usserverlog: ['usserver.log', 'USSERVER.LOG', 'usserver.file.log', 'USSERVER.FILE.LOG', 'file.usserver.log', 'FILE.USSERVER.LOG'],
usw2kagtlog: ['usw2kagt.log', 'USW2KAGT.LOG', 'usw2kagt.file.log', 'USW2KAGT.FILE.LOG', 'file.usw2kagt.log', 'FILE.USW2KAGT.LOG'],
v: ['file.vsh', 'file.vv'],
vala: ['file.vala'],
vb: ['file.sba', 'file.vb', 'file.vbs', 'file.dsm', 'file.ctl'],
vdf: ['file.vdf'],
@@ -773,6 +778,7 @@ def s:GetFilenameChecks(): dict<list<string>>
webmacro: ['file.wm'],
wget: ['.wgetrc', 'wgetrc'],
wget2: ['.wget2rc', 'wget2rc'],
wgsl: ['file.wgsl'],
winbatch: ['file.wbt'],
wit: ['file.wit'],
wml: ['file.wml'],
@@ -793,7 +799,7 @@ def s:GetFilenameChecks(): dict<list<string>>
xsd: ['file.xsd'],
xslt: ['file.xsl', 'file.xslt'],
yacc: ['file.yy', 'file.yxx', 'file.y++'],
yaml: ['file.yaml', 'file.yml', '.clangd', '.clang-format', '.clang-tidy'],
yaml: ['file.yaml', 'file.yml', 'file.eyaml', '.clangd', '.clang-format', '.clang-tidy'],
yang: ['file.yang'],
yuck: ['file.yuck'],
z8a: ['file.z8a'],

View File

@@ -30,10 +30,13 @@ func Test_has()
call assert_equal(1, or(has('ttyin'), 1))
call assert_equal(0, and(has('ttyout'), 0))
call assert_equal(1, has('multi_byte_encoding'))
call assert_equal(0, has(':tearoff'))
endif
call assert_equal(1, has('vcon', 1))
call assert_equal(1, has('mouse_gpm_enabled', 1))
call assert_equal(has('gui_win32') && has('menu'), has(':tearoff'))
call assert_equal(0, has('nonexistent'))
call assert_equal(0, has('nonexistent', 1))
@@ -86,6 +89,17 @@ func Test_empty()
call assert_fails("call empty(test_unknown())", ['E340:', 'E685:'])
endfunc
func Test_err_teapot()
call assert_fails('call err_teapot()', "E418: I'm a teapot")
call assert_fails('call err_teapot(0)', "E418: I'm a teapot")
call assert_fails('call err_teapot(v:false)', "E418: I'm a teapot")
call assert_fails('call err_teapot("1")', "E503: Coffee is currently not available")
call assert_fails('call err_teapot(v:true)', "E503: Coffee is currently not available")
let expr = 1
call assert_fails('call err_teapot(expr)', "E503: Coffee is currently not available")
endfunc
func Test_test_void()
call assert_fails('echo 1 == test_void()', 'E1031:')
call assert_fails('echo 1.0 == test_void()', 'E1031:')

View File

@@ -973,6 +973,7 @@ func Test_mksession_foldopt()
close
%bwipe
set sessionoptions&
call delete('Xtest_mks.out')
endfunc
" Test for mksession with "help" but not "options" in 'sessionoptions'
@@ -1105,6 +1106,7 @@ func Test_mksession_shortmess_with_A()
set shortmess&
set sessionoptions&
call delete('Xtestsession')
call delete('Xtestfile')
endfunc
" Test for mksession with 'compatible' option

View File

@@ -954,12 +954,16 @@ func Test_local_scrolloff()
wincmd w
call assert_equal(5, &so)
wincmd w
call assert_equal(3, &so)
setlocal so<
call assert_equal(5, &so)
setglob so=8
call assert_equal(8, &so)
call assert_equal(-1, &l:so)
setlocal so=0
call assert_equal(0, &so)
setlocal so=-1
call assert_equal(5, &so)
call assert_equal(8, &so)
call assert_equal(7, &siso)
setlocal siso=3
@@ -967,12 +971,16 @@ func Test_local_scrolloff()
wincmd w
call assert_equal(7, &siso)
wincmd w
call assert_equal(3, &siso)
setlocal siso<
call assert_equal(7, &siso)
setglob siso=4
call assert_equal(4, &siso)
call assert_equal(-1, &l:siso)
setlocal siso=0
call assert_equal(0, &siso)
setlocal siso=-1
call assert_equal(7, &siso)
call assert_equal(4, &siso)
close
set so&

View File

@@ -833,4 +833,26 @@ func Test_smoothscroll_multi_skipcol()
call StopVimInTerminal(buf)
endfunc
" this was dividing by zero bug in scroll_cursor_bot
func Test_smoothscroll_zero_width_scroll_cursor_bot()
CheckScreendump
let lines =<< trim END
silent normal yy
silent normal 19p
set cpoptions+=n
vsplit
vertical resize 0
set foldcolumn=1
set number
set smoothscroll
silent normal 20G
END
call writefile(lines, 'XSmoothScrollZeroBot', 'D')
let buf = RunVimInTerminal('-u NONE -S XSmoothScrollZeroBot', #{rows: 19})
call VerifyScreenDump(buf, 'Test_smoothscroll_zero_bot', {})
call StopVimInTerminal(buf)
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -133,7 +133,7 @@ func Test_tabline_empty_group()
tabnew
redraw!
tabclose
bw!
set tabline=
endfunc
@@ -202,4 +202,28 @@ func Test_tabline_showcmd()
call StopVimInTerminal(buf)
endfunc
func TruncTabLine()
return '%1T口口%2Ta' .. repeat('b', &columns - 4) .. '%999X%#TabLine#c'
endfunc
" Test 'tabline' with truncated double-width label at the start.
func Test_tabline_truncated_double_width()
tabnew
redraw
call assert_match('X$', Screenline(1))
let attr_TabLineFill = screenattr(1, &columns - 1)
let attr_TabLine = screenattr(1, &columns)
call assert_notequal(attr_TabLine, attr_TabLineFill)
set tabline=%!TruncTabLine()
redraw
call assert_equal('<a' .. repeat('b', &columns - 4) .. 'c', Screenline(1))
call assert_equal(attr_TabLineFill, screenattr(1, &columns - 2))
call assert_equal(attr_TabLine, screenattr(1, &columns - 1))
call assert_equal(attr_TabLine, screenattr(1, &columns))
bw!
set tabline=
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -309,6 +309,7 @@ func Test_terminal_rename_buffer()
call assert_equal('bar', bufname())
call assert_match('bar.*finished', execute('ls'))
exe 'bwipe! ' .. buf
call delete('Xtext')
endfunc
func s:Nasty_exit_cb(job, st)
@@ -1045,6 +1046,8 @@ func Test_terminal_redir_file()
call WaitForAssert({-> assert_equal('dead', job_status(g:job))})
bwipe
endif
call delete('Xtext')
endfunc
func TerminalTmap(remap)

View File

@@ -695,6 +695,40 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1680,
/**/
1679,
/**/
1678,
/**/
1677,
/**/
1676,
/**/
1675,
/**/
1674,
/**/
1673,
/**/
1672,
/**/
1671,
/**/
1670,
/**/
1669,
/**/
1668,
/**/
1667,
/**/
1666,
/**/
1665,
/**/
1664,
/**/
1663,
/**/