Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into tabsidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
rbtnn committed Sep 29, 2024
2 parents 496f648 + 5dd4ec0 commit 2e57533
Show file tree
Hide file tree
Showing 24 changed files with 143 additions and 59 deletions.
4 changes: 2 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ freebsd_task:
screendump_artifacts:
name: "Cirrus-CI-freebsd-failed-tests"
path: |
"$CIRRUS_WORKING_DIR/runtime/syntax/testdir/failed/*"
"$CIRRUS_WORKING_DIR/src/testdir/failed/*"
"runtime/syntax/testdir/failed/*"
"src/testdir/failed/*"
type: application/octet-stream
23 changes: 10 additions & 13 deletions runtime/doc/ft_ada.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*ft_ada.txt* For Vim version 9.1. Last change: 2022 Mar 13
*ft_ada.txt* For Vim version 9.1. Last change: 2024 Sep 29


ADA FILE TYPE PLUG-INS REFERENCE MANUAL~
Expand Down Expand Up @@ -48,14 +48,12 @@ ctermfg=White often shows well).
There are several options you can select in this Ada mode. See |ft-ada-options|
for a complete list.

To enable them, assign a value to the option. For example, to turn one on:
>
> let g:ada_standard_types = 1
>
To disable them use ":unlet". Example:
>
> unlet g:ada_standard_types
To enable them, assign a value to the option. For example, to turn one on: >
let g:ada_standard_types = 1
<
To disable them use ":unlet". Example: >
unlet g:ada_standard_types
<
You can just use ":" and type these into the command line to set these
temporarily before loading an Ada file. You can make these option settings
permanent by adding the "let" command(s), without a colon, to your "~/.vimrc"
Expand Down Expand Up @@ -158,10 +156,9 @@ several versions available which differ in the licence terms used.

The GNAT compiler plug-in will perform a compile on pressing <F7> and then
immediately shows the result. You can set the project file to be used by
setting:
>
> call g:gnat.Set_Project_File ('my_project.gpr')
setting: >
call g:gnat.Set_Project_File ('my_project.gpr')
<
Setting a project file will also create a Vim session (|views-sessions|) so -
like with the GPS - opened files, window positions etc. will be remembered
separately for all projects.
Expand Down
4 changes: 2 additions & 2 deletions runtime/doc/pi_getscript.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*pi_getscript.txt* For Vim version 9.1. Last change: 2024 Sep 26
*pi_getscript.txt* For Vim version 9.1. Last change: 2024 Sep 27
>
GETSCRIPT REFERENCE MANUAL by Charles E. Campbell
<
Expand Down Expand Up @@ -424,7 +424,7 @@ The AutoInstall process will:

v37 Sep 23, 2024 : * Support for the new vimball's .vmb extension (old .vba
extension conflicted with visual basic).
* Support for |glvs-autoinstal| in ftplugins and packages.
* Support for |glvs-autoinstall| in ftplugins and packages.
* Allow platform driven customization of decompressing
commands.
v36 Apr 22, 2013 : * (glts) suggested use of plugin/**/*.vim instead of
Expand Down
4 changes: 2 additions & 2 deletions runtime/doc/pi_netrw.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3868,7 +3868,7 @@ netrw:
netrw-safe guioptions
Nov 15, 2021 * removed netrw_localrm and netrw_localrmdir
references
Aug 18, 2022 * (Miguel Barro) improving compatability with
Aug 18, 2022 * (Miguel Barro) improving compatibility with
powershell
v171: Oct 09, 2020 * included code in s:NetrwOptionsSafe()
to allow |'bh'| to be set to delete when
Expand Down Expand Up @@ -4099,7 +4099,7 @@ netrw:
The "<nowait>" modifier has been included
with most of netrw's mappings to avoid that
delay.
Jun 26, 2015 * |netrw-gn| mapping implemted
Jun 26, 2015 * |netrw-gn| mapping implemented
* :Ntree NotADir resulted in having
the tree listing expand in the error messages
window. Fixed.
Expand Down
2 changes: 1 addition & 1 deletion runtime/doc/quickfix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ make, say :make html or :make pdf.
Additional arguments can be passed to groff by setting them in
`b:groff_compiler_args` or `g:groff_compiler_args`. The `language` argument
passed to groff is set using 'spelllang'; it can be overridden by setting
`b:groff_compiler_lang`. The default enconding is `UTF-8` and can be changed
`b:groff_compiler_lang`. The default encoding is `UTF-8` and can be changed
by setting `b:groff_compiler_encoding` or `g:groff_compiler_encoding`.

PANDOC *quickfix-pandoc* *compiler-pandoc*
Expand Down
5 changes: 1 addition & 4 deletions runtime/doc/todo.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 9.1. Last change: 2024 Jul 11
*todo.txt* For Vim version 9.1. Last change: 2024 Sep 29


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -38,9 +38,6 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs*
-------------------- Known bugs and current work -----------------------

FILETYPE_FILE is defined to the same value in multiple places.
Only use the one in feature.h. Others too.

Mapping with modifier is not recognized after a partial mapping. Probably
because the typeahead was simplified when looking for a matching mapping.
Need to somehow undo the simplification. #12002
Expand Down
26 changes: 13 additions & 13 deletions runtime/doc/undo.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*undo.txt* For Vim version 9.1. Last change: 2022 Jun 02
*undo.txt* For Vim version 9.1. Last change: 2024 Sep 29


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -164,13 +164,13 @@ This is explained in the user manual: |usr_32.txt|.
g- Go to older text state. With a count repeat that many
times.
*:ea* *:earlier*
:earlier {count} Go to older text state {count} times.
:earlier {N}s Go to older text state about {N} seconds before.
:earlier {N}m Go to older text state about {N} minutes before.
:earlier {N}h Go to older text state about {N} hours before.
:earlier {N}d Go to older text state about {N} days before.
:ea[rlier] {count} Go to older text state {count} times.
:ea[rlier] {N}s Go to older text state about {N} seconds before.
:ea[rlier] {N}m Go to older text state about {N} minutes before.
:ea[rlier] {N}h Go to older text state about {N} hours before.
:ea[rlier] {N}d Go to older text state about {N} days before.

:earlier {N}f Go to older text state {N} file writes before.
:ea[rlier] {N}f Go to older text state {N} file writes before.
When changes were made since the last write
":earlier 1f" will revert the text to the state when
it was written. Otherwise it will go to the write
Expand All @@ -183,13 +183,13 @@ g- Go to older text state. With a count repeat that many
g+ Go to newer text state. With a count repeat that many
times.
*:lat* *:later*
:later {count} Go to newer text state {count} times.
:later {N}s Go to newer text state about {N} seconds later.
:later {N}m Go to newer text state about {N} minutes later.
:later {N}h Go to newer text state about {N} hours later.
:later {N}d Go to newer text state about {N} days later.
:lat[er] {count} Go to newer text state {count} times.
:lat[er] {N}s Go to newer text state about {N} seconds later.
:lat[er] {N}m Go to newer text state about {N} minutes later.
:lat[er] {N}h Go to newer text state about {N} hours later.
:lat[er] {N}d Go to newer text state about {N} days later.

:later {N}f Go to newer text state {N} file writes later.
:lat[er] {N}f Go to newer text state {N} file writes later.
When at the state of the last file write, ":later 1f"
will go to the newest text state.

Expand Down
2 changes: 1 addition & 1 deletion runtime/doc/version9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41620,7 +41620,7 @@ Functions: ~

Autocommands: ~

|CursorMovedC| after the cursor was moved in the comamnd-line
|CursorMovedC| after the cursor was moved in the command-line
|KeyInputPre| before processing any key event in any mode
|SessionWritePost| after writing the session file |:mksession|
|TermResponseAll| after the terminal response to |t_RV| and others is
Expand Down
6 changes: 6 additions & 0 deletions runtime/filetype.vim
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ endif
" Busted (Lua unit testing framework - configuration files)
au BufNewFile,BufRead .busted setf lua

" Bun history
au BufNewFile,BufRead .bun_repl_history setf javascript

" Bundle config
au BufNewFile,BufRead */.bundle/config setf yaml

Expand Down Expand Up @@ -652,6 +655,9 @@ au BufNewFile,BufRead */etc/apt/sources.list setf debsources
au BufNewFile,BufRead */etc/apt/sources.list.d/*.list setf debsources
au BufNewFile,BufRead */etc/apt/sources.list.d/*.sources setf deb822sources

" Deno history
au BufNewFile,BufRead deno_history.txt setf javascript

" Deny hosts
au BufNewFile,BufRead denyhosts.conf setf denyhosts

Expand Down
16 changes: 15 additions & 1 deletion runtime/pack/dist/opt/comment/autoload/comment.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
vim9script

# Maintainer: Maxim Kim <[email protected]>
# Last Update: 2024-04-26
# Last Update: 2024-09-24
#
# Toggle comments
# Usage:
Expand All @@ -10,6 +10,7 @@ vim9script
# nnoremap <silent> <expr> gc comment.Toggle()
# xnoremap <silent> <expr> gc comment.Toggle()
# nnoremap <silent> <expr> gcc comment.Toggle() .. '_'
# nnoremap <silent> <expr> gC comment.Toggle() .. '$'
export def Toggle(...args: list<string>): string
if len(args) == 0
&opfunc = matchstr(expand('<stack>'), '[^. ]*\ze[')
Expand All @@ -19,6 +20,19 @@ export def Toggle(...args: list<string>): string
var cms = substitute(substitute(&cms, '\S\zs%s\s*', ' %s', ''), '%s\ze\S', '%s ', '')
var [lnum1, lnum2] = [line("'["), line("']")]
var cms_l = split(escape(cms, '*.'), '\s*%s\s*')

var first_col = indent(lnum1)
var start_col = getpos("'[")[2]
if len(cms_l) == 1 && lnum1 == lnum2 && first_col < start_col
var line_start = getline(lnum1)[0 : max(0, start_col - 2)]
var line_end = getline(lnum1)[start_col - 1 : -1]
line_end = line_end =~# $'^\s*{cms_l[0]}' ?
\ substitute(line_end, $'^\s*\zs{cms_l[0]}', '', '') :
\ printf(substitute(cms, '%s\@!', '%%', 'g'), line_end)
setline(lnum1, line_start .. line_end)
return ''
endif

if len(cms_l) == 0 | return '' | endif
if len(cms_l) == 1 | call add(cms_l, '') | endif
var comment = 0
Expand Down
23 changes: 16 additions & 7 deletions runtime/pack/dist/opt/comment/doc/comment.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*comment.txt* For Vim version 9.1. Last change: 2024 Jun 04
*comment.txt* For Vim version 9.1. Last change: 2024 Sep 29


VIM REFERENCE MANUAL
Expand All @@ -12,17 +12,26 @@ See |comment-install| on how to activate this package.
The comment.vim package, allows to toggle comments for a single line, a range
of lines or a selected text object. It defines the following mappings:

*gcc*
gcc to comment/uncomment current line
*o_gc*
gc{motion} to toggle comments for the selected motion
*gcip*
gcip to comment/uncomment current paragraph
*gcG*
gcG to comment/uncomment from current line till the end of a buffer
*v_gc*
{Visual}gc to comment/uncomment the highlighted lines.

Since gc operates on a motion, it can be used with any motion, for example _
to comment the current line, or ip to comment the current paragraph.
A default mapping `gcc` to `gc_` is defined:
*gcc*
gcc to comment/uncomment current line

To comment the rest of the line by `gC` whenever the filetype plugin
supports it (that is, whenever the comment marker precedes the code) and fall
back to `gcc` otherwise, add the following mapping to your vimrc: >
nnoremap <silent> <expr> gC comment.Toggle() .. '$'
<
Note: using `gC` may not always result in valid comment markers depending on
the language used.

This plugin uses the buffer-local 'commentstring' option value to add or remove
comment markers to the selected lines. Whether it will comment or un-comment
depends on the first line of the range of lines to act upon. When it matches
Expand Down
2 changes: 0 additions & 2 deletions runtime/pack/dist/opt/comment/doc/tags
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
b:comment_first_col comment.txt /*b:comment_first_col*
comment.txt comment.txt /*comment.txt*
g:comment_first_col comment.txt /*g:comment_first_col*
gcG comment.txt /*gcG*
gcc comment.txt /*gcc*
gcip comment.txt /*gcip*
o_gc comment.txt /*o_gc*
v_gc comment.txt /*v_gc*
4 changes: 2 additions & 2 deletions runtime/syntax/indent.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
" Language: indent(1) configuration file
" Maintainer: Doug Kearns <[email protected]>
" Previous Maintainer: Nikolai Weibull <[email protected]>
" Last Change: 2021 Nov 17
" Last Change: 2024 Sep 29
" indent_is_bsd: If exists, will change somewhat to match BSD implementation
"
" TODO: is the deny-all (a la lilo.vim nice or no?)...
Expand Down Expand Up @@ -34,7 +34,7 @@ endif
syn match indentOptions '-\%(bli\|c\%([bl]i\|[dip]\)\=\|di\=\|ip\=\|lc\=\|pp\=i\|sbi\|ts\|-\%(brace-indent\|comment-indentation\|case-brace-indentation\|declaration-comment-column\|continuation-indentation\|case-indentation\|else-endif-column\|line-comments-indentation\|declaration-indentation\|indent-level\|parameter-indentation\|line-length\|comment-line-length\|paren-indentation\|preprocessor-indentation\|struct-brace-indentation\|tab-size\)\)'
\ nextgroup=indentNumber skipwhite skipempty

syn match indentNumber display contained '\d\+\>'
syn match indentNumber display contained '-\=\d\+\>'

syn match indentOptions '-T'
\ nextgroup=indentIdent skipwhite skipempty
Expand Down
9 changes: 7 additions & 2 deletions src/ex_docmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3584,7 +3584,9 @@ skip_option_env_lead(char_u *start)
/*
* Return TRUE and set "*idx" if "p" points to a one letter command.
* If not in Vim9 script:
* - The 'k' command can directly be followed by any character.
* - The 'k' command can directly be followed by any character
* but :keepa[lt] is another command, as are :keepj[umps],
* :kee[pmarks] and :keepp[atterns].
* - The 's' command can be followed directly by 'c', 'g', 'i', 'I' or 'r'
* but :sre[wind] is another command, as are :scr[iptnames],
* :scs[cope], :sim[alt], :sig[ns] and :sil[ent].
Expand All @@ -3594,7 +3596,8 @@ one_letter_cmd(char_u *p, cmdidx_T *idx)
{
if (in_vim9script())
return FALSE;
if (*p == 'k')
if (p[0] == 'k'
&& (p[1] != 'e' || (p[1] == 'e' && p[2] != 'e')))
{
*idx = CMD_k;
return TRUE;
Expand Down Expand Up @@ -3880,6 +3883,8 @@ find_ex_command(
if (one_letter_cmd(p, &eap->cmdidx))
{
++p;
if (full != NULL)
*full = TRUE;
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ set_init_default_backupskip(void)
item = alloc(itemsize);
if (item != NULL)
{
// add a preceeding comma as a separator after the first item
// add a preceding comma as a separator after the first item
size_t itemseplen = (ga.ga_len == 0) ? 0 : 1;
size_t itemlen;

Expand Down
2 changes: 1 addition & 1 deletion src/testdir/commondumps.vim
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ enddef

# Search for the "failed" directory in the passed _subtreedirname_ directories
# (usually "\<src\>" or "\<syntax\>") and, if found, select its passed _count_
# occurence, add all its "*.dump" files to the argument list and list them;
# occurrence, add all its "*.dump" files to the argument list and list them;
# also define a BufRead autocommand that would invoke "Render()" for every
# "*.dump" file.
def g:Init(subtreedirname: string, count: number)
Expand Down
6 changes: 5 additions & 1 deletion src/testdir/test_cmdline.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,10 @@ func Test_cmdline_complete_various()
call feedkeys(":ka\<C-A>\<C-B>\"\<CR>", 'xt')
call assert_equal("\"ka\<C-A>", @:)

" completion for :keepmarks command
call feedkeys(":kee edi\<C-A>\<C-B>\"\<CR>", 'xt')
call assert_equal("\"kee edit", @:)

" completion for short version of the :s command
call feedkeys(":sI \<C-A>\<C-B>\"\<CR>", 'xt')
call assert_equal("\"sI \<C-A>", @:)
Expand Down Expand Up @@ -3901,7 +3905,7 @@ func Test_ex_command_completion()
let list = filter(getcompletion('', 'command'), 'exists(":" . v:val) == 0')
" :++ and :-- are only valid in Vim9 Script context, so they can be ignored
call assert_equal(['++', '--'], sort(list))
call assert_equal(1, exists(':k'))
call assert_equal(2, exists(':k'))
call assert_equal(0, exists(':ke'))
call assert_equal(1, exists(':kee'))
call assert_equal(1, exists(':keep'))
Expand Down
38 changes: 38 additions & 0 deletions src/testdir/test_cmdmods.vim
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,44 @@ def Test_cmdmods_array()
bwipe!
enddef

def Test_keep_cmdmods_names()
# :k only available in legacy script
legacy call assert_equal('k', fullcommand(':k'))
legacy call assert_equal('k', fullcommand(':ke'))
# single character commands not supported in Vim9
assert_equal('', fullcommand(':k'))
assert_equal('keepmarks', fullcommand(':ke'))
assert_equal('keepmarks', fullcommand(':kee'))
assert_equal('keepmarks', fullcommand(':keep'))
assert_equal('keepmarks', fullcommand(':keepm'))
assert_equal('keepmarks', fullcommand(':keepma'))
assert_equal('keepmarks', fullcommand(':keepmar'))
assert_equal('keepmarks', fullcommand(':keepmark'))
assert_equal('keepmarks', fullcommand(':keepmarks'))
assert_equal('keepalt', fullcommand(':keepa'))
assert_equal('keepalt', fullcommand(':keepal'))
assert_equal('keepalt', fullcommand(':keepalt'))
assert_equal('keepjumps', fullcommand(':keepj'))
assert_equal('keepjumps', fullcommand(':keepju'))
assert_equal('keepjumps', fullcommand(':keepjum'))
assert_equal('keepjumps', fullcommand(':keepjump'))
assert_equal('keepjumps', fullcommand(':keepjumps'))
assert_equal('keeppatterns', fullcommand(':keepp'))
assert_equal('keeppatterns', fullcommand(':keeppa'))
assert_equal('keeppatterns', fullcommand(':keeppat'))
assert_equal('keeppatterns', fullcommand(':keeppatt'))
assert_equal('keeppatterns', fullcommand(':keeppatte'))
assert_equal('keeppatterns', fullcommand(':keeppatter'))
assert_equal('keeppatterns', fullcommand(':keeppattern'))
assert_equal('keeppatterns', fullcommand(':keeppatterns'))
enddef

def Test_cmdmod_completion()
assert_equal('edit', getcompletion('keepalt ed', 'cmdline')[0])
assert_equal('edit', getcompletion('keepjumps ed', 'cmdline')[0])
assert_equal('edit', getcompletion('keepmarks ed', 'cmdline')[0])
assert_equal('edit', getcompletion('keeppatterns ed', 'cmdline')[0])
enddef

" vim: shiftwidth=2 sts=2 expandtab

Loading

0 comments on commit 2e57533

Please sign in to comment.