]> git.ipfire.org Git - thirdparty/vim.git/log
thirdparty/vim.git
3 months agoruntime(doc): tagfunc should refer to 'complete' option
Christian Brabandt [Sat, 26 Apr 2025 18:06:41 +0000 (20:06 +0200)] 
runtime(doc): tagfunc should refer to 'complete' option

fixes: #17205

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1346: missing out-of-memory check in textformat.c v9.1.1346
John Marriott [Fri, 25 Apr 2025 17:14:38 +0000 (19:14 +0200)] 
patch 9.1.1346: missing out-of-memory check in textformat.c

Problem:  missing out-of-memory check in textformat.c
Solution: add out-of-memory check, add small optimizations to
          internal_format() and same_leader() (John Marriott)

closes: #17200

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1345: tests: Test_xxd_color2() test failure dump diff is misleading v9.1.1345
Drew Vogel [Fri, 25 Apr 2025 17:06:53 +0000 (19:06 +0200)] 
patch 9.1.1345: tests: Test_xxd_color2() test failure dump diff is misleading

Problem:  tests: Test_xxd_color2() test failure dump diff is misleading
Solution: Ensure the reference dump and the test dump are both processed the
          same (Drew Vogel).

Background:

Commit b6dc76b6fd23e571d309064b795847ee9ffc7689 sought to make the xxd
screendump tests compatible with non-standard `XXD` overrides. It provides a
vim script that matches a very general `xxd` command pattern but then also
removed the matching line from the reference dump. This second step was
unnecessary because `VerifyScreenDump()` runs the associated vim script against
both the reference dump and the test dump.

Problem Details:

As part of some unrelated work, the GUI tests were failing with a window size 1
column too narrow. The screendumps in `Test_xxd_color2` were failing as a
result. When I loaded the diff using `term_dumpdiff()` the associated vim
scripts are not run. As a result, the test dump contained the `xxd` invocation
on line 1 while reference dump did not. This throws the diff off, obscuring the
true issue of the GUI window being too narrow.

Verification:

In addition to the test suite, locally I've tried to recreate the issue being
fixed in b6dc76b6fd23e571d309064b795847ee9ffc7689. Setting a very non-standard
`XXD` path, this test still passes:

```
XXD=/home/dvogel/opt/vim/bin/xxd TEST_FILTER=Test_xxd_color2 TERM=xterm-color make test_xxd
rm -f test_xxd.res test.log messages starttime
if test -n "${ASAN_OPTIONS}"; then \
   XXD=../xxd/xxd; export XXD; ASAN_OPTIONS="${ASAN_OPTIONS}_test_xxd" \
UBSAN_OPTIONS="${UBSAN_OPTIONS}_test_xxd" VIMRUNTIME=../../runtime  ../vim -f \
-u unix.vim --gui-dialog-file guidialog -U NONE --noplugin --not-a-term -S \
runtest.vim test_xxd.vim ; \
fi

From test_xxd.vim:
Executed Test_xxd_color2()               in   0.066049 seconds
Filtered 17 tests with $TEST_FILTER and $TEST_SKIP_PAT
Executed 1 test                          in   0.096862 seconds
```

closes: #17202

Signed-off-by: Drew Vogel <dvogel@github>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(debversions): Add questing (25.10) as Ubuntu release name
James McCoy [Fri, 25 Apr 2025 17:04:20 +0000 (19:04 +0200)] 
runtime(debversions): Add questing (25.10) as Ubuntu release name

closes: #17201

Signed-off-by: James McCoy <jamessan@debian.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1344: double free in f_complete_match() (after v9.1.1341) v9.1.1344
Christian Brabandt [Fri, 25 Apr 2025 17:01:06 +0000 (19:01 +0200)] 
patch 9.1.1344: double free in f_complete_match() (after v9.1.1341)

Problem:  double free in f_complete_match() (after v9.1.1341)
Solution: remove additional free of trig pointer, correctly free
          regmatch.regprog and before_cursor in the error case

closes: #17203

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1343: filetype: IPython files are not recognized v9.1.1343
Christian Brabandt [Thu, 24 Apr 2025 20:34:46 +0000 (22:34 +0200)] 
patch 9.1.1343: filetype: IPython files are not recognized

Problem:  filetype: IPython files are not recognized
          (user202729)
Solution: detect *.ipy files as python filetype

fixes: #17163

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(groff,nroff): improve ftplugin
Eisuke Kawashima [Thu, 24 Apr 2025 20:26:02 +0000 (22:26 +0200)] 
runtime(groff,nroff): improve ftplugin

- set options in ftplugin but not in syntax
- implement ftplugin/groff.vim (wrapper of ftplugin/nroff.vim)

closes: #17174

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1342: Shebang filetype detection can be improved v9.1.1342
Eisuke Kawashima [Thu, 24 Apr 2025 20:03:21 +0000 (22:03 +0200)] 
patch 9.1.1342: Shebang filetype detection can be improved

Problem:  Shebang filetype detection can be improved
Solution: Improve detection logic (Eisuke Kawashima)

Vim does not correctly detect filetype from
  - `#!/usr/bin/env --split-string=awk -f`
  - `#!/usr/bin/env -S -i awk -f`
  - `#!/usr/bin/env -S VAR= awk -f`
So update the current detection logic to detect those cases.

closes: #17199

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1341: cannot define completion triggers v9.1.1341
glepnir [Thu, 24 Apr 2025 19:48:35 +0000 (21:48 +0200)] 
patch 9.1.1341: cannot define completion triggers

Problem:  Cannot define completion triggers and act upon it
Solution: add the new option 'isexpand' and add the complete_match()
          function to return the completion matches according to the
          'isexpand' setting (glepnir)

Currently, completion trigger position is determined solely by the
'iskeyword' pattern (\k\+$), which causes issues when users need
different completion behaviors - such as triggering after '/' for
comments or '.' for methods. Modifying 'iskeyword' to include these
characters has undesirable side effects on other Vim functionality that
relies on keyword definitions.

Introduce a new buffer-local option 'isexpand' that allows specifying
different completion triggers and add the complete_match() function that
finds the appropriate start column for completion based on these
triggers, scanning backwards from cursor position.

This separation of concerns allows customized completion behavior
without affecting iskeyword-dependent features. The option's
buffer-local nature enables per-filetype completion triggers.

closes: #16716

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(gleam): update filetype plugin, include new compiler and syntax script
Kirill Morozov [Thu, 24 Apr 2025 19:28:56 +0000 (21:28 +0200)] 
runtime(gleam): update filetype plugin, include new compiler and syntax script

closes: #17172

Signed-off-by: Kirill Morozov <mail2kirill@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1340: cannot complete :filetype arguments v9.1.1340
Christian Brabandt [Wed, 23 Apr 2025 19:04:24 +0000 (21:04 +0200)] 
patch 9.1.1340: cannot complete :filetype arguments

Problem:  cannot complete :filetype arguments (Phạm Bình An)
Solution: add :filetype ex command completion, add "filetypecmd"
          completion type for getcompletion()

fixes: #17165
closes: #17167

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1339: missing out-of-memory checks for enc_to_utf16()/utf16_to_enc() v9.1.1339
John Marriott [Wed, 23 Apr 2025 18:56:08 +0000 (20:56 +0200)] 
patch 9.1.1339: missing out-of-memory checks for enc_to_utf16()/utf16_to_enc()

Problem:  missing out-of-memory checks for enc_to_utf16() and
          utf16_to_enc()
Solution: Add out-of-memory checks and fix a few other minor issues
          (John Marriott)

This change does:
-  add missing out-of-memory checks for enc_to_utf16() and
   utf16_to_enc()
-  add a small optimisation in mch_errmsg_c() and mch_msg_c() (in
   message.c) to only call STRLEN() if needed.
-  fix a memory leak in winpty_term_and_job_init() (in terminal.c).

closes: #17191

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1338: Calling expand() interferes with cmdcomplete_info() v9.1.1338
zeertzjq [Wed, 23 Apr 2025 18:50:23 +0000 (20:50 +0200)] 
patch 9.1.1338: Calling expand() interferes with cmdcomplete_info()

Problem:  Calling expand() interferes with cmdcomplete_info()
          (after 9.1.1329).
Solution: Only clear cmdline_orig when starting/ending cmdline mode
          (zeertzjq).

closes: #17192

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1337: Undo corrupted with 'completeopt' "preinsert" when switching buffer v9.1.1337
zeertzjq [Wed, 23 Apr 2025 18:46:35 +0000 (20:46 +0200)] 
patch 9.1.1337: Undo corrupted with 'completeopt' "preinsert" when switching buffer

Problem:  Undo corrupted with 'completeopt' "preinsert" when switching
          buffer or window.
Solution: Do not delete preinsert text when switching buffer or window.
          (zeertzjq)

related: neovim/neovim#33581
closes: #17193

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(yaml): fix wrong order of undo_ftplugin suboptions
Vincent Law [Tue, 22 Apr 2025 18:35:11 +0000 (20:35 +0200)] 
runtime(yaml): fix wrong order of undo_ftplugin suboptions

This commit fixes the following error message:
```
Compiler not supported: make inc< sw< sts<
```

1. orginal value: `setl com< cms< et< fo<| compiler make inc< sw< sts<`
2. correct value: `setl com< cms< et< fo< inc< sw< sts< | compiler make`

While at it, let's also document the g:yaml_recommended_style variable.

closes: #17179

Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Vincent Law <vlaw@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(make): do not automatically indent after a special target
Eisuke Kawashima [Tue, 22 Apr 2025 18:20:46 +0000 (20:20 +0200)] 
runtime(make): do not automatically indent after a special target

prevent indentation if the previous line starts with e.g. `.PHONY:`

closes: #17183

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1336: comment plugin does not support case-insensitive 'commentstring' v9.1.1336
Maxim Kim [Tue, 22 Apr 2025 18:11:05 +0000 (20:11 +0200)] 
patch 9.1.1336: comment plugin does not support case-insensitive 'commentstring'

Problem:  comment plugin does not support case-insensitive
          'commentstring' (char101)
Solution: Use pattern '\c' to make the regex case-insensitive
          (Maxim Kim)

fixes: #17184
closes: #17186

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1335: Coverity complains about Null pointer dereferences v9.1.1335
Christian Brabandt [Tue, 22 Apr 2025 18:06:53 +0000 (20:06 +0200)] 
patch 9.1.1335: Coverity complains about Null pointer dereferences

Problem:  Coverity complains about Null pointer dereferences
Solution: before accessing ccline->cmdbuff check that ccline is not NULL

Fixes: Coverity issue 1646601
closes: #17189

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1334: Coverity complains about unchecked return value v9.1.1334
Christian Brabandt [Tue, 22 Apr 2025 18:04:28 +0000 (20:04 +0200)] 
patch 9.1.1334: Coverity complains about unchecked return value

Problem:  Coverity complains about unchecked return value
Solution: cast return value to (void)

Fixes: Coverity issue 1646574
related: #17189

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1333: Coverity: complains about unutilized variable v9.1.1333
Christian Brabandt [Tue, 22 Apr 2025 18:01:04 +0000 (20:01 +0200)] 
patch 9.1.1333: Coverity: complains about unutilized variable

Problem:  Coverity: complains about unutilized variable
Solution: initialize typval properly
          (author)

Fixes: Coverity issue: 1646573
       tmp.v_lock is left unitialized
related: #17189

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1332: Vim9: segfault when using super within a lambda v9.1.1332
Yegappan Lakshmanan [Tue, 22 Apr 2025 17:55:38 +0000 (19:55 +0200)] 
patch 9.1.1332: Vim9: segfault when using super within a lambda

Problem:  Vim9: segfault when using super within a lambda
          (lifepillar)
Solution: inherit the class from the current function
          (Yegappan Lakshmanan)

fixes: #17166
closes: #17185

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1331: Leaking memory with cmdcomplete() v9.1.1331
Girish Palya [Tue, 22 Apr 2025 17:52:16 +0000 (19:52 +0200)] 
patch 9.1.1331: Leaking memory with cmdcomplete()

Problem:  Leaking memory with cmdcomplete()
          (zeertzjq, after v9.1.1329)
Solution: free the memory (Girish Palya)

closes: #17190

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(vim): Update base-syntax, improve :autocmd highlighting
Doug Kearns [Tue, 22 Apr 2025 17:48:13 +0000 (19:48 +0200)] 
runtime(vim): Update base-syntax, improve :autocmd highlighting

- Match full :autocmd, :doautocmd and :doautoall commands.
- Add filename pattern (wildcard) highlighting.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(doc): update documentation
Hirohito Higashi [Mon, 21 Apr 2025 17:39:15 +0000 (19:39 +0200)] 
runtime(doc): update documentation

closes: #17180

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(doc): clarify return type for findfile()/finddir()
Christian Brabandt [Mon, 21 Apr 2025 09:31:58 +0000 (11:31 +0200)] 
runtime(doc): clarify return type for findfile()/finddir()

closes: #17171

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1330: may receive E315 in terminal v9.1.1330
Hirohito Higashi [Mon, 21 Apr 2025 09:23:12 +0000 (11:23 +0200)] 
patch 9.1.1330: may receive E315 in terminal

Problem:  may receive E315 in terminal
Solution: call check_cursor() (Hirohito Higashi)

fixes: #16024
fixes: #16211
fixes: #17099
closes: #17170

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoCI: add sway compositor to CI tests, to prepare for better Wayland testing
Foxe Chen [Mon, 21 Apr 2025 09:20:44 +0000 (11:20 +0200)] 
CI: add sway compositor to CI tests, to prepare for better Wayland testing

closes: #17162

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1329: cannot get information about command line completion v9.1.1329
Girish Palya [Mon, 21 Apr 2025 09:12:41 +0000 (11:12 +0200)] 
patch 9.1.1329: cannot get information about command line completion

Problem:  cannot get information about command line completion
Solution: add CmdlineLeavePre autocommand and cmdcomplete_info() Vim
          script function (Girish Palya)

This commit introduces two features to improve introspection and control
over command-line completion in Vim:

- Add CmdlineLeavePre autocmd event:

  A new event triggered just before leaving the command line and before
  CmdlineLeave. It allows capturing completion-related state that is
  otherwise cleared by the time CmdlineLeave fires.

- Add cmdcomplete_info() Vim script function:

  Returns a Dictionary with details about the current command-line
  completion state.

These are similar in spirit to InsertLeavePre and complete_info(),
but focused on command-line mode.

**Use case:**

In [[PR #16759](https://github.com/vim/vim/pull/16759)], two examples
demonstrate command-line completion: one for live grep, and another for
fuzzy file finding. However, both examples share two key limitations:

1. **Broken history recall (`<Up>`)**
   When selecting a completion item via `<Tab>` or `<C-n>`, the original
pattern used for searching (e.g., a regex or fuzzy string) is
overwritten in the command-line history. This makes it impossible to
recall the original query later.
   This is especially problematic for interactive grep workflows, where
it’s useful to recall a previous search and simply select a different
match from the menu.

2. **Lack of default selection on `<CR>`**
   Often, it’s helpful to allow `<CR>` (Enter) to accept the first match
in the completion list, even when no item is explicitly selected. This
behavior is particularly useful in fuzzy file finding.

----
Below are the updated examples incorporating these improvements:

**Live grep, fuzzy find file, fuzzy find buffer:**

```vim
command! -nargs=+ -complete=customlist,GrepComplete Grep VisitFile()
def GrepComplete(arglead: string, cmdline: string, cursorpos: number):
list<any>
    return arglead->len() > 1 ? systemlist($'grep -REIHns "{arglead}"' ..
       ' --exclude-dir=.git --exclude=".*" --exclude="tags" --exclude="*.swp"') : []
enddef
def VisitFile()
    if (selected_match != null_string)
        var qfitem = getqflist({lines: [selected_match]}).items[0]
        if qfitem->has_key('bufnr') && qfitem.lnum > 0
            var pos = qfitem.vcol > 0 ? 'setcharpos' : 'setpos'
            exec $':b +call\ {pos}(".",\ [0,\ {qfitem.lnum},\ {qfitem.col},\ 0]) {qfitem.bufnr}'
            setbufvar(qfitem.bufnr, '&buflisted', 1)
        endif
    endif
enddef
nnoremap <leader>g :Grep<space>
nnoremap <leader>G :Grep <c-r>=expand("<cword>")<cr>
command! -nargs=* -complete=customlist,FuzzyFind Find
execute(selected_match != '' ? $'edit {selected_match}' : '')
var allfiles: list<string>
autocmd CmdlineEnter : allfiles = null_list
def FuzzyFind(arglead: string, _: string, _: number): list<string>
    if allfiles == null_list
        allfiles = systemlist($'find {get(g:, "fzfind_root", ".")} \! \(
-path "*/.git" -prune -o -name "*.swp" \) -type f -follow')
    endif
    return arglead == '' ? allfiles : allfiles->matchfuzzy(arglead)
enddef
nnoremap <leader><space> :<c-r>=execute('let
fzfind_root="."')\|''<cr>Find<space><c-@>
nnoremap <leader>fv :<c-r>=execute('let
fzfind_root="$HOME/.vim"')\|''<cr>Find<space><c-@>
nnoremap <leader>fV :<c-r>=execute('let
fzfind_root="$VIMRUNTIME"')\|''<cr>Find<space><c-@>
command! -nargs=* -complete=customlist,FuzzyBuffer Buffer execute('b '
.. selected_match->matchstr('\d\+'))
def FuzzyBuffer(arglead: string, _: string, _: number): list<string>
    var bufs = execute('buffers', 'silent!')->split("\n")
    var altbuf = bufs->indexof((_, v) => v =~ '^\s*\d\+\s\+#')
    if altbuf != -1
        [bufs[0], bufs[altbuf]] = [bufs[altbuf], bufs[0]]
    endif
    return arglead == '' ? bufs : bufs->matchfuzzy(arglead)
enddef
nnoremap <leader><bs> :Buffer <c-@>
var selected_match = null_string
autocmd CmdlineLeavePre : SelectItem()
def SelectItem()
    selected_match = ''
    if getcmdline() =~ '^\s*\%(Grep\|Find\|Buffer\)\s'
        var info = cmdcomplete_info()
        if info != {} && info.pum_visible && !info.matches->empty()
            selected_match = info.selected != -1 ? info.matches[info.selected] : info.matches[0]
            setcmdline(info.cmdline_orig). # Preserve search pattern in history
        endif
    endif
enddef
```

**Auto-completion snippet:**

```vim
set wim=noselect:lastused,full wop=pum wcm=<C-@> wmnu
autocmd CmdlineChanged : CmdComplete()
def CmdComplete()
    var [cmdline, curpos] = [getcmdline(), getcmdpos()]
    if getchar(1, {number: true}) == 0  # Typehead is empty (no more pasted input)
            && !pumvisible() && curpos == cmdline->len() + 1
            && cmdline =~ '\%(\w\|[*/:.-]\)$' && cmdline !~ '^\d\+$'  # Reduce noise
        feedkeys("\<C-@>", "ti")
        SkipCmdlineChanged()  # Suppress redundant completion attempts
        # Remove <C-@> that get inserted when no items are available
        timer_start(0, (_) => getcmdline()->substitute('\%x00', '', 'g')->setcmdline())
    endif
enddef
cnoremap <expr> <up> SkipCmdlineChanged("\<up>")
cnoremap <expr> <down> SkipCmdlineChanged("\<down>")
autocmd CmdlineEnter : set bo+=error
autocmd CmdlineLeave : set bo-=error
def SkipCmdlineChanged(key = ''): string
    set ei+=CmdlineChanged
    timer_start(0, (_) => execute('set ei-=CmdlineChanged'))
    return key != '' ? ((pumvisible() ? "\<c-e>" : '') .. key) : ''
enddef
```

These customizable snippets can serve as *lightweight* and *native*
alternatives to picker plugins like **FZF** or **Telescope** for common,
everyday workflows. Also, live grep snippet can replace **cscope**
without the overhead of building its database.

closes: #17115

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1328: too many strlen() calls in indent.c v9.1.1328
John Marriott [Mon, 21 Apr 2025 09:01:53 +0000 (11:01 +0200)] 
patch 9.1.1328: too many strlen() calls in indent.c

Problem:  too many strlen() calls in indent.c
Solution: refactor indent.c slightly and remove strlen() calls
          (John Marriott)

closes: #17156

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1327: filetype: nroff detection can be improved v9.1.1327
Eisuke Kawashima [Mon, 21 Apr 2025 08:51:05 +0000 (10:51 +0200)] 
patch 9.1.1327: filetype: nroff detection can be improved

Problem:  filetype: nroff detection can be improved
Solution: improve nroff detection (Eisuke Kawashima)

- explicitly check roff comments and macros typically found in manpages
- do not try to detect alphabetically-sectioned files, except for n, as
  nroff
    - l: > 'l' happens to be a section for historical reasons
         <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=391977>
    - n: e.g. /usr/share/man/mann/Tcl.n.gz
    - o: unsure (perhaps fedora-specific)
    - p: unsure (perhaps fedora-specific)

closes: #17160

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(doc): cross-link :| meaning :p and explain E749
D. Ben Knoble [Mon, 21 Apr 2025 08:19:51 +0000 (10:19 +0200)] 
runtime(doc): cross-link :| meaning :p and explain E749

E749 is given when :print (with any range) is issued on an empty buffer,
like the one you get with :new or :enew. Furthermore, due to Vi
compatibility :| is a synonym.

As a result, mappings intended to include a <bar> separator (esp. in the
case of boolean or "||") between commands can generate E749 on startup
when placed in a vimrc if the bars are not properly encoded or escaped.
[1]. Document this failure mode and synonym near the generated error,
and cross link with :help :bar. Note that one must read or scroll quite
a bit to find the mention of :| behaving like :print!

[1]: https://vi.stackexchange.com/q/46625/10604

closes: #17173

Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(doc): style: clarify to prefer 2 spaces after a sentence
Christian Brabandt [Mon, 21 Apr 2025 08:15:02 +0000 (10:15 +0200)] 
runtime(doc): style: clarify to prefer 2 spaces after a sentence

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(pov): deprecate `#render` and `#statistics` in syntax script
Eisuke Kawashima [Mon, 21 Apr 2025 07:45:39 +0000 (09:45 +0200)] 
runtime(pov): deprecate `#render` and `#statistics` in syntax script

- 3.1g: active
  https://www.povray.org/ftp/pub/povray/Old-Versions/Official-3.1g/Docs/povuser.pdf#page=172
- 3.5 or later: deprecated
  https://www.povray.org/ftp/pub/povray/Old-Versions/Official-3.5/Linux/povlinux.tgz
  ─ povray-3.50c/html/povdoc_172.html
  - https://www.povray.org/documentation/3.7.0/r3_3.html#r3_3_2_7_1

closes: #17177

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1326: invalid cursor position after 'tagfunc' v9.1.1326
Christian Brabandt [Sun, 20 Apr 2025 16:21:35 +0000 (18:21 +0200)] 
patch 9.1.1326: invalid cursor position after 'tagfunc'

Problem:  invalid cursor position after 'tagfunc'
          (gandalf4a)
Solution: call check_cursor() after executing the 'tagfunc'

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(keymaps): update Brazilian keymaps
LuMarquesIlva [Sun, 20 Apr 2025 15:10:20 +0000 (17:10 +0200)] 
runtime(keymaps): update Brazilian keymaps

closes: #17161

Signed-off-by: LuMarquesIlva <luismarques0504@proton.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1325: tests: not checking error numbers properly v9.1.1325
zeertzjq [Sun, 20 Apr 2025 08:21:18 +0000 (10:21 +0200)] 
patch 9.1.1325: tests: not checking error numbers properly

Problem:  tests: not checking error numbers properly.
Solution: Add a trailing comma to avoid matching a different error
          number with the same prefix (zeertzjq)

closes: #17159

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(doc): clarify 'includeexpr' is not used for <cfile>
Christian Brabandt [Sat, 19 Apr 2025 09:54:08 +0000 (11:54 +0200)] 
runtime(doc): clarify 'includeexpr' is not used for <cfile>

fixes: #17139

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(filetype): improve *.h filetype detection
Amelia Clarke [Sat, 19 Apr 2025 09:48:10 +0000 (11:48 +0200)] 
runtime(filetype): improve *.h filetype detection

This commit changes *.h files to default to C (instead of C++), and
deprecates the existing `g:c_syntax_for_h` and `g:ch_syntax_for_h`
variables in favor of a unified `g:filetype_h`, like is used for other
ambiguous file extensions.

closes: #17135

Signed-off-by: Amelia Clarke <selene@perilune.dev>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(indent-tests): Raise timeouts for "search*()"es
Aliaksei Budavei [Sun, 13 Apr 2025 19:24:46 +0000 (22:24 +0300)] 
runtime(indent-tests): Raise timeouts for "search*()"es

Related to #15974 and #16870.

closes: #17116

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(indent-tests): Annotate timed "search*()"es for tracing
Aliaksei Budavei [Sun, 13 Apr 2025 18:00:42 +0000 (21:00 +0300)] 
runtime(indent-tests): Annotate timed "search*()"es for tracing

related: #17116

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(indent-tests): Instrument timed "search*()" calls
Aliaksei Budavei [Sat, 19 Apr 2025 09:35:02 +0000 (11:35 +0200)] 
runtime(indent-tests): Instrument timed "search*()" calls

The offered "tracer.vim" script can be used to measure and
record elapsed time for explicitly annotated "search*()"es,
set off with "VIM_INDENT_TEST_TRACE_(START|END)" comment
markers, in indent plugins.

related: #17116

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1324: undefined behaviour if X11 connection dies v9.1.1324
Foxe Chen [Sat, 19 Apr 2025 09:25:18 +0000 (11:25 +0200)] 
patch 9.1.1324: undefined behaviour if X11 connection dies

Problem:  undefined behaviour if X11 connection dies
Solution: call setjmp() before the main_loop() and restore x11 state
          if the X11 connection dies (Foxe Chen)

fixes: #698
closes: #17142

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1323: b:undo_ftplugin not executed when re-using buffer v9.1.1323
Christian Brabandt [Sat, 19 Apr 2025 09:14:11 +0000 (11:14 +0200)] 
patch 9.1.1323: b:undo_ftplugin not executed when re-using buffer

Problem:  b:undo_ftplugin not executed when re-using buffer
          (archy3)
Solution: explicitly execute b:undo_ftplugin in buflist_new() when
          re-using the current buffer

fixes: #17113
closes: #17133

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoCI: coverity.yml: remove python2-dev pkg and retire --enable-pythoninterp
Philip H. [Sat, 19 Apr 2025 09:09:30 +0000 (11:09 +0200)] 
CI: coverity.yml: remove python2-dev pkg and retire --enable-pythoninterp

follow-up: ded2b41326a5ad3238422ed2244d79dfa18cc667

closes: #17157

Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(nix): set iskeyword and b:match_words in ftplugin
Arnie97 [Fri, 18 Apr 2025 17:34:14 +0000 (19:34 +0200)] 
runtime(nix): set iskeyword and b:match_words in ftplugin

closes: #17154

Signed-off-by: Arnie97 <arnie97@gmail.com>
Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(doc): clarify "nearest" value for 'completeopt'
Girish Palya [Fri, 18 Apr 2025 16:52:28 +0000 (18:52 +0200)] 
runtime(doc): clarify "nearest" value for 'completeopt'

closes: #17146

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoCI: GCC 13 install fails, so disable that particular ppa
Philip H. [Fri, 18 Apr 2025 16:48:53 +0000 (18:48 +0200)] 
CI: GCC 13 install fails, so disable that particular ppa

closes: #17149

Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(doc): Tweak documentation style a bit
Hirohito Higashi [Fri, 18 Apr 2025 16:45:31 +0000 (18:45 +0200)] 
runtime(doc): Tweak documentation style a bit

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoCI: update coverity runner to Ubuntu 24.04
Philip H. [Fri, 18 Apr 2025 16:42:24 +0000 (18:42 +0200)] 
CI: update coverity runner to Ubuntu 24.04

closes: #17150

Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1322: small delete register cannot paste multi-line correctly v9.1.1322
phanium [Fri, 18 Apr 2025 16:32:52 +0000 (18:32 +0200)] 
patch 9.1.1322: small delete register cannot paste multi-line correctly

Problem:  small delete register cannot paste multi-line correctly
          (after v8.2.2189)
Solution: caused by 032a2d050b82b146d70d6ff714838ee62c07d8ad, so make
          this logic handle charwise only (phanium)

closes: #17151

Signed-off-by: phanium <91544758+phanen@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1321: filetype: MS ixx and mpp files are not recognized v9.1.1321
Hampus Avekvist [Fri, 18 Apr 2025 16:18:06 +0000 (18:18 +0200)] 
patch 9.1.1321: filetype: MS ixx and mpp files are not recognized

Problem:  filetype: MS ixx and mpp files are not recognized
Solution: detect *.mpp and *.ixx files as c++ filetype
          (Hampus Avekvist)

closes: #17155

Signed-off-by: Hampus Avekvist <hampus.avekvist@hey.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1320: filetype: alsoft config files are not recognized v9.1.1320
David Mandelberg [Fri, 18 Apr 2025 09:41:44 +0000 (11:41 +0200)] 
patch 9.1.1320: filetype: alsoft config files are not recognized

Problem:  filetype: alsoft config files are not recognized
Solution: detect alsoft config files as dosini filetype
          (David Mandelberg)

References:
* code with paths to config: ReadALConfig() in
  https://github.com/kcat/openal-soft/blob/master/alc/alconfig.cpp
* example config:
  https://github.com/kcat/openal-soft/blob/master/alsoftrc.sample

closes: #17140

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1319: Various typos in the code, issue with test_inst_complete.vim v9.1.1319
zeertzjq [Fri, 18 Apr 2025 08:57:33 +0000 (10:57 +0200)] 
patch 9.1.1319: Various typos in the code, issue with test_inst_complete.vim

Problem:  Various typos in the code, redundant and strange use of
          :execute in test_ins_complete.vim (after 9.1.1315).
Solution: Fix typos in the code and in the documentation, use the
          executed command directly (zeertzjq).

closes: #17143

Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1318: tests: test_format fails v9.1.1318
zeertzjq [Fri, 18 Apr 2025 08:45:45 +0000 (10:45 +0200)] 
patch 9.1.1318: tests: test_format fails

Problem:  tests: test_format fails (after 9.1.1314).
Solution: Increase the string size.  Add missing test_format.res in
          NEW_TESTS_RES (zeertzjq).

closes: #17144

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(jjdescription): Don't require a space to start comments
ash [Thu, 17 Apr 2025 18:44:58 +0000 (20:44 +0200)] 
runtime(jjdescription): Don't require a space to start comments

Since jj v0.24.0 (December 2024), `JJ:` comments are recognised even
when not followed by a space.

closes: #17130

Signed-off-by: ash <ash@sorrel.sh>
Signed-off-by: Gregory Anders <greg@gpanders.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1317: noisy error when restoring folds from session fails v9.1.1317
Igor Lacerda [Thu, 17 Apr 2025 18:41:31 +0000 (20:41 +0200)] 
patch 9.1.1317: noisy error when restoring folds from session fails

Problem:  noisy error when restoring folds from session fails
Solution: ignore errors silently when sourcing session file.
          (Igor Lacerda)

fixes: #15813
closes: #17127

Signed-off-by: Igor Lacerda <igorlfs@ufmg.br>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1316: missing memory allocation failure in os_mswin.c v9.1.1316
John Marriott [Thu, 17 Apr 2025 18:35:42 +0000 (20:35 +0200)] 
patch 9.1.1316: missing memory allocation failure in os_mswin.c

Problem:  missing memory allocation failure in os_mswin.c
Solution: check for memory allocation failure and return early.
          (John Marriott)

closes: #17134

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1315: completion: issue with fuzzy completion and 'completefuzzycollect' v9.1.1315
glepnir [Thu, 17 Apr 2025 18:17:53 +0000 (20:17 +0200)] 
patch 9.1.1315: completion: issue with fuzzy completion and 'completefuzzycollect'

Problem:  chain complete does not work when 'cot' includes fuzzy
          and 'completefuzzycollect' collects wrong next word.
          (Konfekt)
Solution: compl_startpos is not set correctly, remove next word check
          in search_for_fuzzy_match (glepnir).

fixes #17131
fixes #16942
closes: #17136

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1314: max allowed string width too small v9.1.1314
Hirohito Higashi [Thu, 17 Apr 2025 18:13:05 +0000 (20:13 +0200)] 
patch 9.1.1314: max allowed string width too small

Problem:  max allowed string width too small
Solution: increased MAX_ALLOWED_STRING_WIDTH from 6400 to 1MiB
          (Hirohito Higashi)

closes: #17138

Co-authored-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1313: compile warning about uninitialized value v9.1.1313
Christian Brabandt [Wed, 16 Apr 2025 19:12:30 +0000 (21:12 +0200)] 
patch 9.1.1313: compile warning about uninitialized value

Problem:  compile warning about uninitialized value
          (Tony Mechelynck, after v9.1.1311)
Solution: initialize variable on declaration

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1312: tests: Test_backupskip() fails when HOME is defined v9.1.1312
Christian Brabandt [Wed, 16 Apr 2025 18:25:47 +0000 (20:25 +0200)] 
patch 9.1.1312: tests: Test_backupskip() fails when HOME is defined

Problem:  tests: Test_backupskip() fails when HOME is defined
Solution: unset $HOME temporarily

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1311: completion: not possible to limit number of matches v9.1.1311
Girish Palya [Wed, 16 Apr 2025 18:18:33 +0000 (20:18 +0200)] 
patch 9.1.1311: completion: not possible to limit number of matches

Problem:  completion: not possible to limit number of matches
Solution: allow to limit the matches for 'complete' sources by using the
          "{flag}^{limit}" notation (Girish Palya)

This change extends the 'complete'  option to support limiting the
number of matches returned from individual completion sources.

**Rationale:** In large files, certain sources (such as the current
buffer) can generate an overwhelming number of matches, which may cause
more relevant results from other sources (e.g., LSP or tags) to be
pushed out of view. By specifying per-source match limits, the
completion menu remains balanced and diverse, improving visibility and
relevance of suggestions.

A caret (`^`) followed by a number can be appended to a source flag to
specify the maximum number of matches for that source. For example:
```
  :set complete=.^9,w,u,t^5
```
In this configuration:
- The current buffer (`.`) will return up to 9 matches.
- The tag completion (`t`) will return up to 5 matches.
- Other sources (`w`, `u`) are not limited.

This feature is fully backward-compatible and does not affect behavior
when the `^count` suffix is not used.

The caret (`^`) was chosen as the delimiter because it is least likely
to appear in file names.

closes: #17087

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1310: completion: redundant check for preinsert effect v9.1.1310
glepnir [Wed, 16 Apr 2025 17:41:19 +0000 (19:41 +0200)] 
patch 9.1.1310: completion: redundant check for preinsert effect

Problem:  Duplicate check for preinsert effect, particularly for Ctrl_w
          and Ctrl_U.
Solution: Remove the specific check for Ctrl_w and Ctrl_U to eliminate
          redundancy (glepnir).

closes: #17129

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(gleam): Update ftplugin, use recommended_style config variable
Doug Kearns [Wed, 16 Apr 2025 16:29:15 +0000 (18:29 +0200)] 
runtime(gleam): Update ftplugin, use recommended_style config variable

Wrap the setting of basic whitespace formatting options in a conditional
block, following the de facto standard.

Setting 'et', 'sts' and 'sw' can be disabled by setting
"gleam_recommended_style" to false.

Follow up to PR #17086.

closes: #17128

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1309: tests: no test for 'pummaxwidth' with non-truncated "kind" v9.1.1309
zeertzjq [Wed, 16 Apr 2025 16:23:23 +0000 (18:23 +0200)] 
patch 9.1.1309: tests: no test for 'pummaxwidth' with non-truncated "kind"

Problem:  tests: no test for 'pummaxwidth' with non-truncated "kind".
Solution: Add a test with "kind" and larger 'pummaxwidth' (zeertzjq).

closes: #17126

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime: set 'cpoptions' for line-continuation in various runtime files
Eisuke Kawashima [Wed, 16 Apr 2025 16:20:59 +0000 (18:20 +0200)] 
runtime: set 'cpoptions' for line-continuation in various runtime files

closes: #17121

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(tar): remove dependency on netrw#WinPath, include mapping doc
Christian Brabandt [Wed, 16 Apr 2025 15:13:28 +0000 (17:13 +0200)] 
runtime(tar): remove dependency on netrw#WinPath, include mapping doc

related: #17124

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(netrw): remove deprecated functions
Luca Saccarola [Tue, 15 Apr 2025 18:28:09 +0000 (20:28 +0200)] 
runtime(netrw): remove deprecated functions

closes: #17124

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1308: completion: cannot order matches by distance to cursor v9.1.1308
Girish Palya [Tue, 15 Apr 2025 18:16:00 +0000 (20:16 +0200)] 
patch 9.1.1308: completion: cannot order matches by distance to cursor

Problem:  During insert-mode completion, the most relevant match is often
          the one closest to the cursor—frequently just above the current line.
          However, both `<C-N>` and `<C-P>` tend to rank candidates from the
          current buffer that appear above the cursor near the bottom of the
          completion menu, rather than near the top. This ordering can feel
          unintuitive, especially when `noselect` is active, as it doesn't
          prioritize the most contextually relevant suggestions.

Solution: This change introduces a new sub-option value "nearest" for the
          'completeopt' setting. When enabled, matches from the current buffer
          are prioritized based on their proximity to the cursor position,
          improving the relevance of suggestions during completion
          (Girish Palya).

Key Details:
- Option: "nearest" added to 'completeopt'
- Applies to: Matches from the current buffer only
- Effect: Sorts completion candidates by their distance from the cursor
- Interaction with other options:
  - Has no effect if the `fuzzy` option is also present

This feature is helpful especially when working within large buffers where
multiple similar matches may exist at different locations.

You can test this feature with auto-completion using the snippet below. Try it
in a large file like `vim/src/insexpand.c`, where you'll encounter many
potential matches. You'll notice that the popup menu now typically surfaces the
most relevant matches—those closest to the cursor—at the top. Sorting by
spatial proximity (i.e., contextual relevance) often produces more useful
matches than sorting purely by lexical distance ("fuzzy").

Another way to sort matches is by recency, using an LRU (Least Recently Used)
cache—essentially ranking candidates based on how recently they were used.
However, this is often overkill in practice, as spatial proximity (as provided
by the "nearest" option) is usually sufficient to surface the most relevant
matches.

```vim
set cot=menuone,popup,noselect,nearest inf

def SkipTextChangedIEvent(): string
    # Suppress next event caused by <c-e> (or <c-n> when no matches found)
    set eventignore+=TextChangedI
    timer_start(1, (_) => {
        set eventignore-=TextChangedI
    })
    return ''
enddef

autocmd TextChangedI * InsComplete()

def InsComplete()
    if getcharstr(1) == '' && getline('.')->strpart(0, col('.') - 1) =~ '\k$'
        SkipTextChangedIEvent()
        feedkeys("\<c-n>", "n")
    endif
enddef

inoremap <silent> <c-e> <c-r>=<SID>SkipTextChangedIEvent()<cr><c-e>

inoremap <silent><expr> <tab>   pumvisible() ? "\<c-n>" : "\<tab>"
inoremap <silent><expr> <s-tab> pumvisible() ? "\<c-p>" : "\<s-tab>"
```

closes: #17076

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1307: make syntax does not reliably detect different flavors v9.1.1307
Eisuke Kawashima [Tue, 15 Apr 2025 17:20:06 +0000 (19:20 +0200)] 
patch 9.1.1307: make syntax does not reliably detect different flavors

Problem:  GNU extensions, such as `ifeq` and `wildcard` function, are
          highlighted in BSDmakefile
Solution: detect BSD, GNU, or Microsoft implementation according to
  filename, user-defined global variables, or file contents

closes: #17089

Co-authored-by: Roland Hieber <rohieb@users.noreply.github.com>
Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1306: completion menu rendering can be improved v9.1.1306
glepnir [Tue, 15 Apr 2025 17:06:58 +0000 (19:06 +0200)] 
patch 9.1.1306: completion menu rendering can be improved

Problem:  Parts of the popup menu were rendered twice when the popup was
          at maximum width because the truncation flag was being set too
          liberally.
Solution: Make the truncation condition more precise by only setting it
          when there's exactly one character of space remaining
          (glepnir).

closes: #17108

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1305: completion menu active after switching windows/tabs v9.1.1305
glepnir [Tue, 15 Apr 2025 17:02:00 +0000 (19:02 +0200)] 
patch 9.1.1305: completion menu active after switching windows/tabs

Problem:  When switching to another window or tab page while the
          completion menu is active, the menu stays visible, although it
          belongs to the previous window/tab page context (Evgeni
          Chasnovski).
Solution: Track the window and tab page where completion started. Detect
          changes in the main editing loop and cancel completion mode if
          the current window or tab page differs from where completion
          started.

fixes: #17090
closes: #17101

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1304: filetype: some man files are not recognized v9.1.1304
Eisuke Kawashima [Tue, 15 Apr 2025 16:30:05 +0000 (18:30 +0200)] 
patch 9.1.1304: filetype: some man files are not recognized

Problem:  filetype: some man files are not recognized
          (e.g. 1p (POSIX commands))
Solution: update the filetype detection pattern and detect more man
          files as nroff (Eisuke Kawashima)

- sections are revised referring to
    - debian-12:/etc/manpath.config
    - fedora-41:/etc/man_db.conf
- detection logic is improved
- detection test is implemented

closes: #17117

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(netrw): upstream snapshot of v180
Luca Saccarola [Tue, 15 Apr 2025 16:26:32 +0000 (18:26 +0200)] 
runtime(netrw): upstream snapshot of v180

relevant commits:
- fix(gvim): don't set previous jump
- don't overwrite copy, copydir, mkdir and move command options
- fix: correctly name deprecate function
- refactor: remove s:NetrwBufRemover
- refactor: s:NetrwDelete -> netrw#fs#Remove
- defaults!: remove g:netrw_use_errorwindow

fixes: #17114
closes: #17123

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1303: missing out-of-memory check in linematch.c v9.1.1303
John Marriott [Tue, 15 Apr 2025 16:15:24 +0000 (18:15 +0200)] 
patch 9.1.1303: missing out-of-memory check in linematch.c

Problem:  missing out-of-memory check in linematch.c
Solution: return early in case of memory allocation failure, move the
          pow() calculation ouside of the for() loop
          (John Marriott)

closes: #17118

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1302: Coverity warns about using uninitialized value v9.1.1302
Christian Brabandt [Tue, 15 Apr 2025 16:10:26 +0000 (18:10 +0200)] 
patch 9.1.1302: Coverity warns about using uninitialized value

Problem:  Coverity warns about using uninitialized value
          (Coverity, Tony Mechelynck, after v9.1.1301)
Solution: initialize callback pointer to NULL

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1301: completion: cannot configure completion functions with 'complete' v9.1.1301
Girish Palya [Mon, 14 Apr 2025 20:13:15 +0000 (22:13 +0200)] 
patch 9.1.1301: completion: cannot configure completion functions with 'complete'

Problem:  completion: cannot configure completion functions with
          'complete'
Solution: add support for setting completion functions using the f and o
          flag for 'complete' (Girish Palya)

This change adds two new values to the `'complete'` (`'cpt'`) option:
- `f` – invokes the function specified by the `'completefunc'` option
- `f{func}` – invokes a specific function `{func}` (can be a string or `Funcref`)

These new flags extend keyword completion behavior (e.g., via `<C-N>` /
`<C-P>`) by allowing function-based sources to participate in standard keyword
completion.

**Key behaviors:**

- Multiple `f{func}` values can be specified, and all will be called in order.
- Functions should follow the interface defined in `:help complete-functions`.
- When using `f{func}`, escaping is required for spaces (with `\`) and commas
  (with `\\`) in `Funcref` names.
- If a function sets `'refresh'` to `'always'`, it will be re-invoked on every
  change to the input text. Otherwise, Vim will attempt to reuse and filter
  existing matches as the input changes, which matches the default behavior of
  other completion sources.
- Matches are inserted at the keyword boundary for consistency with other completion methods.
- If finding matches is time-consuming, `complete_check()` can be used to
  maintain responsiveness.
- Completion matches are gathered in the sequence defined by the `'cpt'`
  option, preserving source priority.

This feature increases flexibility of standard completion mechanism and may
reduce the need for external completion plugins for many users.

**Examples:**

Complete matches from [LSP](https://github.com/yegappan/lsp) client. Notice the use of `refresh: always` and `function()`.

```vim
set cpt+=ffunction("g:LspCompletor"\\,\ [5]). # maxitems = 5

def! g:LspCompletor(maxitems: number, findstart: number, base: string): any
    if findstart == 1
        return g:LspOmniFunc(findstart, base)
    endif
    return {words: g:LspOmniFunc(findstart, base)->slice(0, maxitems), refresh: 'always'}
enddef
autocmd VimEnter * g:LspOptionsSet({ autoComplete: false, omniComplete: true })
```

Complete matches from `:iabbrev`.

```vim
set cpt+=fAbbrevCompletor

def! g:AbbrevCompletor(findstart: number, base: string): any
    if findstart > 0
        var prefix = getline('.')->strpart(0, col('.') - 1)->matchstr('\S\+$')
        if prefix->empty()
            return -2
        endif
        return col('.') - prefix->len() - 1
    endif
    var lines = execute('ia', 'silent!')
    if lines =~? gettext('No abbreviation found')
        return v:none  # Suppresses warning message
    endif
    var items = []
    for line in lines->split("\n")
        var m = line->matchlist('\v^i\s+\zs(\S+)\s+(.*)$')
        if m->len() > 2 && m[1]->stridx(base) == 0
            items->add({ word: m[1], info: m[2], dup: 1 })
        endif
    endfor
    return items->empty() ? v:none :
        items->sort((v1, v2) => v1.word < v2.word ? -1 : v1.word ==# v2.word ? 0 : 1)
enddef
```

**Auto-completion:**

Vim's standard completion frequently checks for user input while searching for
new matches. It is responsive irrespective of file size. This makes it
well-suited for smooth auto-completion. You can try with above examples:

```vim
set cot=menuone,popup,noselect inf

autocmd TextChangedI * InsComplete()

def InsComplete()
    if getcharstr(1) == '' && getline('.')->strpart(0, col('.') - 1) =~ '\k$'
        SkipTextChangedIEvent()
        feedkeys("\<c-n>", "n")
    endif
enddef

inoremap <silent> <c-e> <c-r>=<SID>SkipTextChangedIEvent()<cr><c-e>

def SkipTextChangedIEvent(): string
    # Suppress next event caused by <c-e> (or <c-n> when no matches found)
    set eventignore+=TextChangedI
    timer_start(1, (_) => {
        set eventignore-=TextChangedI
    })
    return ''
enddef
```

closes: #17065

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: glepnir <glephunter@gmail.com>
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1300: wrong detection of -inf v9.1.1300
John Marriott [Mon, 14 Apr 2025 19:19:34 +0000 (21:19 +0200)] 
patch 9.1.1300: wrong detection of -inf

Problem:  wrong detection of -inf
Solution: correctly compare 4 characters and not 3
          (John Marriott)

closes: #17109

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(doc): update enum helptext
Yegappan Lakshmanan [Mon, 14 Apr 2025 19:14:33 +0000 (21:14 +0200)] 
runtime(doc): update enum helptext

closes: #17112

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1299: filetype: mbsyncrc files are not recognized v9.1.1299
Pierrick Guillaume [Sun, 13 Apr 2025 16:25:33 +0000 (18:25 +0200)] 
patch 9.1.1299: filetype: mbsyncrc files are not recognized

Problem:  filetype: mbsyncrc files are not recognized
Solution: detect isyncrc and "*.mbsyncrc" files as mbsync filetype,
          include filetype and syntax plugin (Pierrick Guillaume)

mbsync is a command line application which synchronizes mailboxes;
currently Maildir and IMAP4 mailboxes are supported.
New messages, message deletions and flag changes can be propagated both ways;
the operation set can be selected in a fine-grained manner.

References:
mbsync syntax overview: mbsync manual (isync v1.4.4)
https://isync.sourceforge.io/mbsync.html

Upstream support for the mbsync filetype.
Original plugin: https://github.com/Fymyte/mbsync.vim

closes: #17103

Signed-off-by: Pierrick Guillaume <pguillaume@fymyte.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoCI: install xcode 16.3 on macos-15 runner
Philip H. [Sun, 13 Apr 2025 16:19:56 +0000 (18:19 +0200)] 
CI: install xcode 16.3 on  macos-15 runner

closes: #17111

Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(doc): update options.txt and clarify 'wildmode' further
Christian Brabandt [Sun, 13 Apr 2025 16:06:49 +0000 (18:06 +0200)] 
runtime(doc): update options.txt and clarify 'wildmode' further

related: #17100

Co-authored-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(gleam): update Maintainer and filetype options
Kirill Morozov [Sun, 13 Apr 2025 15:58:32 +0000 (17:58 +0200)] 
runtime(gleam): update Maintainer and filetype options

closes: #17086

Signed-off-by: Kirill Morozov <kirill@robotix.pro>
Signed-off-by: Trilowy <49493635+trilowy@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1298: define_function() is too long v9.1.1298
Yegappan Lakshmanan [Sun, 13 Apr 2025 15:49:50 +0000 (17:49 +0200)] 
patch 9.1.1298: define_function() is too long

Problem:  define_function() is too long
Solution: refactor and split up into smaller functions
          (Yegappan Lakshmanan)

closes: #17105

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1297: Ctrl-D scrolling can get stuck v9.1.1297
Luuk van Baal [Sun, 13 Apr 2025 15:45:34 +0000 (17:45 +0200)] 
patch 9.1.1297: Ctrl-D scrolling can get stuck

Problem:  cursor_correct() calculates a valid cursor position which
  is later changed by update_topline() and causes Ctrl-D
          scrolling to be stuck (Daniel Steinberg, after v9.1.0258).
Solution: Update the valid cursor position before validating topline
          (Luuk van Baal).

fixes: #17106
closes: #17110

Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(new-tutor): update tutor and correct comandline completion
Phạm Bình An [Sun, 13 Apr 2025 15:30:59 +0000 (17:30 +0200)] 
runtime(new-tutor): update tutor and correct comandline completion

Problem: Some parts of the tutor are outdated.

- For example, pressing `<Tab>` after typing `:e` does not complete the
command `:edit`, but shows a completion menu with the first entry being
`:earlier`.

closes: #17107

Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1296: completion: incorrect truncation logic v9.1.1296
glepnir [Sat, 12 Apr 2025 16:35:34 +0000 (18:35 +0200)] 
patch 9.1.1296: completion: incorrect truncation logic

Problem:  completion: incorrect truncation logic (after: v9.1.1284)
Solution: replace string allocation with direct screen rendering and
          fixe RTL/LTR truncation calculations (glepnir)

closes: #17081

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1295: clientserver: does not handle :stopinsert correctly v9.1.1295
Christian Brabandt [Sat, 12 Apr 2025 16:09:28 +0000 (18:09 +0200)] 
patch 9.1.1295: clientserver: does not handle :stopinsert correctly

Problem:  clientserver: When in insert mode, a :stopinsert command
          is not correctly processed (user202729)
Solution: If the :stopinsert command is received while waiting for
          input, stuff the NOP key into the type-ahead buffer and
          detect that :stopinsert was used in edit() so that the
          cursor position is decremented.

fixes: #17016
closes: #17024

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(doc): disable last-position-jump in diff mode
Christian Brabandt [Sat, 12 Apr 2025 16:07:39 +0000 (18:07 +0200)] 
runtime(doc): disable last-position-jump in diff mode

This has been bothering me quite for some time and I never knew why it
happened. Just today it occurred to me this might have been because of
the last-position-jump.

So I figured, let's fix it for everybody, not just me.

closes: #17092

Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(doc): Improve 'wildmode' setting desciption
Girish Palya [Sat, 12 Apr 2025 16:03:32 +0000 (18:03 +0200)] 
runtime(doc): Improve 'wildmode' setting desciption

closes: #17100

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1294: gui tabline menu does not use confirm when closing tabs v9.1.1294
JMcKiern [Sat, 12 Apr 2025 09:51:00 +0000 (11:51 +0200)] 
patch 9.1.1294: gui tabline menu does not use confirm when closing tabs

Problem:  gui tabline menu does not use confirm when closing tabs
Solution: use ":confirm tabclose" explicitly (JMcKiern)

closes: #17093

Signed-off-by: JMcKiern <jmckiern@tcd.ie>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(doc): correct backslash escaping comma example
Qiming zhao [Sat, 12 Apr 2025 09:40:17 +0000 (11:40 +0200)] 
runtime(doc): correct backslash escaping comma example

closes: #17096

Signed-off-by: Qiming zhao <chemzqm@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1293: comment plugin does not handle 'exclusive' selection for comment... v9.1.1293
Maxim Kim [Sat, 12 Apr 2025 09:34:08 +0000 (11:34 +0200)] 
patch 9.1.1293: comment plugin does not handle 'exclusive' selection for comment object

Problem:  comment plugin does not handle 'exclusive' selection for
          comment object (@mawkish)
Solution: handle special case selection='exclusive' for inline comment
          object (Maxim Kim)

fixes: #17023
closes: #17098

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1292: statusline not correctly evaluated v9.1.1292
Hirohito Higashi [Sat, 12 Apr 2025 09:28:18 +0000 (11:28 +0200)] 
patch 9.1.1292: statusline not correctly evaluated

Problem:  statusline not correctly evaluated
          (Peter Kenny, after v9.1.1291)
Solution: revert part of patch v9.1.1291
          (Hirohito Higashi)

fixes: #17095
closes: #17094

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(sh): Do not look up a "sh" utility in $PATH for "sh_13.sh"
Aliaksei Budavei [Sat, 12 Apr 2025 09:18:10 +0000 (11:18 +0200)] 
runtime(sh): Do not look up a "sh" utility in $PATH for "sh_13.sh"

Dash may not be installed on a BSD CI runner, list it in the
shebang line.

See #17084
closes: #17094

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(filetype): make shell filetype detection more robust
Aliaksei Budavei [Thu, 10 Apr 2025 19:52:14 +0000 (21:52 +0200)] 
runtime(filetype): make shell filetype detection more robust

closes: #17063

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1291: too many strlen() calls in buffer.c v9.1.1291
John Marriott [Thu, 10 Apr 2025 19:34:19 +0000 (21:34 +0200)] 
patch 9.1.1291: too many strlen() calls in buffer.c

Problem:  too many strlen() calls in buffer.c
Solution: refactor buffer.c and remove strlen() calls
          (John Marriott)

closes: #17063

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(keymaps): include 2 Brazilian Keymaps
Elsarques [Thu, 10 Apr 2025 18:04:14 +0000 (20:04 +0200)] 
runtime(keymaps): include 2 Brazilian Keymaps

closes: #17072

Signed-off-by: Elsarques <luismarques0504@proton.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agoruntime(vim): Update-base-syntax, match full :*grep, :make, :sort and :filter commands
Doug Kearns [Thu, 10 Apr 2025 17:59:22 +0000 (19:59 +0200)] 
runtime(vim): Update-base-syntax, match full :*grep, :make, :sort and :filter commands

closes: #17082

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
3 months agopatch 9.1.1290: tests: missing cleanup in test_filetype.vim v9.1.1290
zeertzjq [Thu, 10 Apr 2025 17:54:16 +0000 (19:54 +0200)] 
patch 9.1.1290: tests: missing cleanup in test_filetype.vim

Problem:  tests: missing cleanup in test_filetype.vim, wrong name in
          test_plugin_matchparen
Solution: Add :bwipe corresponding to :split, rename test case

closes: #17088

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>