1555 Commits

Author SHA1 Message Date
f487ae90cf vim-patch:9.1.1539: completion: messages don't respect 'shm' setting (#34923)
Problem:  completion: messages don't respect 'shm' setting
Solution: Turn off completion messages when 'shortmess' includes "c"
          (Girish Palya).

`:set shortmess+=c` is intended to reduce noise during completion by
suppressing messages.
Previously, some completion messages still appeared regardless of this setting.

This change ensures that **all** completion-related messages are suppressed
when `'c'` is present in `'shortmess'`.

Not entirely sure if the original behavior was intentional. If there's a
reason certain messages were always shown, feel free to close this without
merging.

closes: vim/vim#17737

fe1d3c8af7

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-13 22:53:40 +00:00
d4074b812d vim-patch:9.1.1538: tests: string options in gen_opt_test.vim not fully sorted (#34891)
Problem:  tests: string options in gen_opt_test.vim aren't fully sorted.
Solution: Sort the string options alphabetically.  Also make description
          of 'maxsearchcount' start with lower-case for consistency with
          other options, update documentation for searchcount().

closes: vim/vim#17720

7306e8fcdb
2025-07-11 22:56:43 +00:00
00f8f94d5b vim-patch:9.1.1535: the maximum search count uses hard-coded value 99 (#34873)
Problem:  The maximum search count uses a hard-coded value of 99
          (Andres Monge, Joschua Kesper)
Solution: Make it configurable using the 'maxsearchcount' option.

related: vim/vim#8855
fixes: vim/vim#17527
closes: vim/vim#17695

b7b7fa04bf

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-11 09:17:05 +08:00
5fe310c5e6 vim-patch:9.1.1528: completion: crash with getcompletion()
Problem:  completion: crash with getcompletion()
          (zeertzjq)
Solution: Don't set may_expand_pattern in f_getcompletion(),
          unset may_expand_pattern() once it is not longer needed
          (Girish Palya).

fixes: vim/vim#17680
closes: vim/vim#17686

f2ec8d4afc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-09 08:06:23 +08:00
ef0ec7edac vim-patch:9.1.1526: completion: search completion match may differ in case
Problem:  completion: search completion match may differ in case
          (techntools)
Solution: add "exacttext" to 'wildoptions' value (Girish Palya)

This flag does the following:

exacttext
      When this flag is present, search pattern completion
      (e.g., in |/|, |?|, |:s|, |:g|, |:v|, and |:vim|)
      shows exact buffer text as menu items, without
      preserving regex artifacts like position
      anchors (e.g., |/\<|). This provides more intuitive
      menu items that match the actual buffer text. However,
      searches may be less accurate since the pattern is not
      preserved exactly.
      By default, Vim preserves the typed pattern (with
      anchors) and appends the matched word. This preserves
      search correctness, especially when using regular
      expressions or with 'smartcase' enabled. However, the
      case of the appended matched word may not exactly
      match the case of the word in the buffer.

fixes: vim/vim#17654
closes: vim/vim#17667

93c2d5bf7f

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-09 08:06:23 +08:00
db7c2acbc6 vim-patch:9.1.1532: termdebug: not enough ways to configure breakpoints (#34851)
Problem:  termdebug: not enough ways to configure breakpoints
Solution: add the termdebug_config['signs'] config setting, rework the
          termdebug test cases (Dimitry Ishenko)

Allow to configure custom breakpoint signs so one can do something like
this:

```vim
let g:termdebug_config['signs'] = ['>1', '>2', '>3', '>4', '>5', '>6', '>7', '>8', '>9']
let g:termdebug_config['sign'] = '>>'
```

where the first 9 breakpoints will have their own signs and the rest
will be the same (>>).

While at it, rework the test for the termdebug plugin:

- Added test for g:termdebug_config['signs'].
- Added test for g:termdebug_config['sign'].
- Moved test for g:termdebug_config['sign_decimal'] into
  Test_termdebug_basic()

closes: vim/vim#17694

c4bca1de0b

Co-authored-by: Dimitry Ishenko <dimitry.ishenko@gmail.com>
2025-07-08 22:38:58 +00:00
27daeb0d68 vim-patch:9.1.1520: completion: search completion doesn't handle 'smartcase' well (#34840)
Problem:  When using `/` or `?` in command-line mode with 'ignorecase' and
          'smartcase' enabled, the completion menu could show items that
          don't actually match any text in the buffer due to case mismatches

Solution: Instead of validating menu items only against the user-typed
          pattern, the new logic also checks whether the completed item
          matches actual buffer content. If needed, it retries the match
          using a lowercased version of the candidate, respecting
          smartcase semantics.

closes: vim/vim#17665

af22007784

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-08 08:07:42 +08:00
842ca1fd5c vim-patch:9.1.1519: tests: Test_termdebug_decimal_breakpoints() may fail
Problem:  Test_termdebug_decimal_breakpoints() fails with List index out
          of range, because when adding the second breakpoint, the
          cursor is still on the very first line (a header include line)
          and therefore gdb refuses to set the breakpoint with:
          `msg="No compiled code for line 1 in file XTD_decimal.c"`
Solution: Run the program, so that it will break at the very first
          defined breakpoint and then once we are in the program,
          set further breakpoints

closes: vim/vim#17689

faed074ab7

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-07-08 07:22:25 +08:00
62822d750d vim-patch:9.1.0877: tests: missing test for termdebug + decimal signs
Problem:  tests: missing test for termdebug + decimal signs
Solution: Add a termdebug test (Ubaldo Tiberi)

closes: vim/vim#16081

b5c1557323

Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
2025-07-08 07:22:25 +08:00
c3c8d25293 vim-patch:9.1.1521: completion: pum does not reset scroll pos on reopen with 'noselect' (#34836)
Problem:  When 'wildmode' is set to include "noselect", the popup menu (pum)
          incorrectly retained its scroll position when reopened. This
          meant that after scrolling down through the menu with `<C-n>`,
          reopening the menu (e.g., by retyping the command and
          triggering completion again) would show the menu starting from
          the previously scrolled position, rather than from the top.
          This could confuse users, as the first visible item would not
          be the first actual match in the list.

Solution: Ensure that the popup menu resets its scroll position to the
          top when reopened (Girish Palya).

closes: vim/vim#17673

0cd7f3536b

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-08 06:37:30 +08:00
3177841bdf vim-patch:9.1.1517: filetype: autopkgtest files are not recognized
Problem:  filetype: autopkgtest files are not recognized
Solution: detect */debian/tests/control files as autopkgtest filetype
          (James McCoy)

Autopkgtest is a Debian tool for testing installed versions of packages
when other, related packages are updated.

Reference:
- https://www.debian.org/doc/debian-policy/autopkgtest.txt

related: vim/vim#17679

5bcc492649

Co-authored-by: James McCoy <jamessan@jamessan.com>
2025-07-07 11:24:04 +02:00
6fd2a3040f vim-patch:9.1.1518: getcompletiontype() may crash (#34819)
Problem:  getcompletiontype() crashes when no completion is available
          (after v9.1.1509).
Solution: Don't call set_expand_context() (zeertzjq)

fixes: vim/vim#17681
closes: vim/vim#17684

e2c0f81dd0
2025-07-06 22:46:05 +00:00
cf5506f0fd vim-patch:9.1.1516: tests: no test that 'incsearch' is updated after search completion (#34808)
Problem:  tests: no test that 'incsearch' is updated after accepting
          search completion.
Solution: Add a test case (zeertzjq).

closes: vim/vim#17682

08e5b128b8
2025-07-06 09:41:59 +00:00
8a4977e286 vim-patch:7a734b7: tests: fix typo in comment (after v9.1.1511)
related: vim/vim#17660

7a734b7148
2025-07-06 17:10:11 +08:00
11e967d5af vim-patch:9.1.1511: tests: two edit tests change v:testing from 1 to 0
Problem:  tests: two edit tests change v:testing from 1 to 0.
Solution: Don't change v:testing in these two tests, since it's already
          set to 1 in runtest.vim (zeertzjq).

closes: vim/vim#17660

96076bf41e
2025-07-06 17:10:11 +08:00
9c04eb02ad vim-patch:9.1.1509: patch 9.1.1505 was not good
Problem:  Patch 9.1.1505 was not good
Solution: Revert "patch 9.1.1505: not possible to return completion type
          for :ex command" and instead add the getcompletiontype()
          function (Hirohito Higashi).

related: vim/vim#17606
closes: vim/vim#17662

96b3ef2389

Cherry-pick Test_multibyte_expression() from Vim, as it passes.

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2025-07-06 08:55:32 +08:00
6ebcb4a4d6 vim-patch:9.1.1505: not possible to return completion type for :ex command
Problem:  not possible to return command-line completion type for :ex
          command
Solution: make getcmdcompltype() accept an optional and return the
          command-line completion for that arg (Shougo Matsushita).

closes: vim/vim#17606

5d2354fc07

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2025-07-06 08:41:08 +08:00
85e6feedb0 vim-patch:9.1.1512: completion: can only complete from keyword characters (#34798)
Problem:  completion: can only complete from keyword characters
Solution: remove this restriction, allow completion functions when
          called from i_CTRL-N/i_CTRL-P to be triggered from non-keyword
          characters (Girish Palya)

Previously, functions specified in the `'complete'` option were
restricted to starting completion only from keyword characters (as
introduced in PR 17065). This change removes that restriction.

With this change, user-defined functions (e.g., `omnifunc`, `userfunc`)
used in `'complete'` can now initiate completion even when triggered
from non-keyword characters. This makes it easier to reuse existing
functions alongside other sources without having to consider whether the
cursor is on a keyword or non-keyword character, or worry about where
the replacement should begin (i.e., the `findstart=1` return value).

The logic for both the “collection” and “filtering” phases now fully
respects each source’s specified start column. This also extends to
fuzzy matching, making completions more predictable.

Internally, this builds on previously merged infrastructure that tracks
per-source metadata. This PR focuses on applying that metadata to
compute the leader string and insertion text appropriately for each
match.

Also, a memory corruption has been fixed in prepare_cpt_compl_funcs().

closes: vim/vim#17651

ba11e78f1d

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-06 06:09:28 +08:00
46727a7feb vim-patch:9.1.1510: Search completion may use invalid memory
Problem:  Search completion may use invalid memory (after 9.1.1490).
Solution: Don't get two line pointers at the same time (zeertzjq).

closes: vim/vim#17661

5e34eec6f8
2025-07-05 21:58:38 +08:00
dd707246fd vim-patch:9.1.1490: 'wildchar' does not work in search contexts
Problem:  'wildchar' does not work in search contexts
Solution: implement search completion when 'wildchar' is typed
          (Girish Palya).

This change enhances Vim's command-line completion by extending
'wildmode' behavior to search pattern contexts, including:

- '/' and '?' search commands
- ':s', ':g', ':v', and ':vim' commands

Completions preserve the exact regex pattern typed by the user,
appending the completed word directly to the original input. This
ensures that all regex elements — such as '<', '^', grouping brackets
'()', wildcards '\*', '.', and other special characters — remain intact
and in their original positions.

---

**Use Case**

While searching (using `/` or `?`) for lines containing a pattern like
`"foobar"`, you can now type a partial pattern (e.g., `/f`) followed by
a trigger key (`wildchar`) to open a **popup completion menu** showing
all matching words.

This offers two key benefits:

1. **Precision**: Select the exact word you're looking for without
typing it fully.
2. **Memory aid**: When you can’t recall a full function or variable
name, typing a few letters helps you visually identify and complete the
correct symbol.

---

**What’s New**

Completion is now supported in the following contexts:

- `/` and `?` search commands
- `:s`, `:g`, `:v`, and `:vimgrep` ex-commands

---

**Design Notes**

- While `'wildchar'` (usually `<Tab>`) triggers completion, you'll have
to use `<CTRL-V><Tab>` or "\t" to search for a literal tab.
- **Responsiveness**: Search remains responsive because it checks for
user input frequently.

---

**Try It Out**

Basic setup using the default `<Tab>` as the completion trigger:

```vim
set wim=noselect,full wop=pum wmnu
```

Now type:

```
/foo<Tab>
```

This opens a completion popup for matches containing "foo".
For matches beginning with "foo" type `/\<foo<Tab>`.

---

**Optional: Autocompletion**

For automatic popup menu completion as you type in search or `:`
commands, include this in your `.vimrc`:

```vim
vim9script
set wim=noselect:lastused,full wop=pum wcm=<C-@> wmnu

autocmd CmdlineChanged [:/?] CmdComplete()

def CmdComplete()
  var [cmdline, curpos, cmdmode] = [getcmdline(), getcmdpos(),
expand('<afile>') == ':']
  var trigger_char = '\%(\w\|[*/:.-]\)$'
  var not_trigger_char = '^\%(\d\|,\|+\|-\)\+$'  # Exclude numeric range
  if getchar(1, {number: true}) == 0  # Typehead is empty, no more
pasted input
      && !wildmenumode() && curpos == cmdline->len() + 1
      && (!cmdmode || (cmdline =~ trigger_char && cmdline !~
not_trigger_char))
    SkipCmdlineChanged()
    feedkeys("\<C-@>", "t")
    timer_start(0, (_) => getcmdline()->substitute('\%x00', '',
'ge')->setcmdline())  # Remove <C-@>
  endif
enddef

def SkipCmdlineChanged(key = ''): string
  set ei+=CmdlineChanged
  timer_start(0, (_) => execute('set ei-=CmdlineChanged'))
  return key == '' ? '' : ((wildmenumode() ? "\<C-E>" : '') .. key)
enddef

**Optional: Preserve history recall behavior**
cnoremap <expr> <Up> SkipCmdlineChanged("\<Up>")
cnoremap <expr> <Down> SkipCmdlineChanged("\<Down>")

**Optional: Customize popup height**
autocmd CmdlineEnter : set bo+=error | exec $'set ph={max([10,
winheight(0) - 4])}'
autocmd CmdlineEnter [/?] set bo+=error | set ph=8
autocmd CmdlineLeave [:/?] set bo-=error ph&
```

closes: vim/vim#17570

6b49fba8c8

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-05 21:58:38 +08:00
7138cdaef8 vim-patch:9.1.1477: no easy way to deduplicate text
Problem:  no easy way to deduplicate text
Solution: add the :uniq ex command
          (Hirohito Higashi)

closes: vim/vim#17538

74f0a77bb9

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-07-05 21:36:45 +08:00
0c02c9c70b refactor(getchar): rename test variable (#34769)
Also, test_disable_char_avail() is superseded by test_override() in Vim,
so remove that from vim_diff.txt.
2025-07-05 05:36:01 +08:00
bb75610d99 vim-patch:9.1.1507: symlinks are resolved on :cd commands (#34758)
Problem:  File paths change from symlink to target path after :cd command
          when editing files through symbolic links
Solution: Add "~" flag to 'cpoptions' to control symlink resolution.
          When not included (default), symlinks are resolved maintaining
          backward compatibility. When included, symlinks are preserved
          providing the improved behavior. (glepnir)

related: neovim/neovim#15695
closes: vim/vim#17628

4ade668fb6
2025-07-04 05:44:39 +00:00
c925e7b8ba test(old): emulate test_override('char_avail') using FFI
Add a non-static variable for this, otherwise it'll be really hacky.
This avoid having to rewrite many incsearch tests in Lua.
2025-07-04 11:00:14 +08:00
eef62e815d vim-patch:9.1.1506: tests: missing cleanup in Test_search_cmdline_incsearch_highlight() (#34748)
Problem:  tests: missing cleanup test_override('char_avail', 0) in
          Test_search_cmdline_incsearch_highlight().
Solution: Add the missing cleanup (zeertzjq).

closes: vim/vim#17655

29b29c6b30
2025-07-04 06:28:55 +08:00
715c28d67f test(old): emulate test_override('starting') with FFI (#34742)
I was initially trying to port several cmdline tests from Vim involving
test_override('char_avail') without having to rewrite entire tests in
Lua, but haven't figured out a good way achieve that yet. Nevertheless
emulating test_override('starting') is easier.
2025-07-03 19:21:58 +08:00
fc1be07d28 vim-patch:9.1.1504: filetype: numbat files are not recognized
Problem:  filetype: numbat files are not recognized
Solution: detect *.nbt files as numbat filetype (0xadk)

References:
- https://github.com/sharkdp/numbat
- https://github.com/sharkdp/numbat/tree/master/numbat/modules

closes: vim/vim#17643

20eb68a8f2

Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2025-07-03 09:18:18 +02:00
0a14ac3261 vim-patch:9.1.1503: filetype: haxe files are not recognized
Problem:  filetype: haxe files are not recognized
Solution: detect *.hx files as haxe filetype (0xadk)

References:
- https://haxe.org/
- https://code.haxe.org/category/beginner/hello-world.html

closes: vim/vim#17644

b46e3aa0fa

Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2025-07-03 09:18:18 +02:00
18cfbf8fb2 vim-patch:9.1.1502: filetype: quickbms files are not recognized
Problem:  filetype: quickbms files are not recognized
Solution: detect *.bms files as quickbms filetype
          (0xadk)

Reference:
- https://aluigi.altervista.org/quickbms.htm

closes: vim/vim#17645

fdcdded4d5

Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2025-07-03 09:18:18 +02:00
da42f99eb4 vim-patch:9.1.1501: filetype: flix files are not recognized
Problem:  filetype: flix files are not recognized
Solution: detect *.flix files as flix filetype
          (0xadk)

References:
- https://flix.dev/
- https://doc.flix.dev/introduction.html

closes: vim/vim#17646

b211916e0a

Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2025-07-03 09:18:18 +02:00
66f02ee1fe vim-patch:9.1.1498: completion: 'complete' funcs behave different to 'omnifunc' (#34718)
Problem:  completion: Functions specified in the 'complete' option did
          not have the leader string removed when called with findstart = 0,
          unlike 'omnifunc' behavior
Solution: update behaviour and make behaviour consistent (Girish Palya)

closes: vim/vim#17636

fa16c7ab3f

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-30 23:58:06 +00:00
f1f106be3d vim-patch:9.1.1421: tests: need a test for the new-style tutor.tutor (#34267)
Problem:  tests: need a test for the new-style tutor.tutor, patch
          9.1.1384 broke the expected positions for the signs
Solution: Update all number keys in tutor.tutor.json to match the
          correct line numbers in tutor.tutor, replace tabs by spaces,
          add a screen-dump test to verify it does not regress
          (Pham Bình An)

closes: vim/vim#17416

a541f1de2b
2025-06-28 07:42:51 +00:00
0b91e9f83b vim-patch:9.1.1482: scrolling with 'splitkeep' and line() (#34670)
Problem:  Topline is preemptively updated by line() in WinResized
          autocmd with 'splitkeep' != "cursor".
Solution: Set `skip_update_topline` when 'splitkeep' != "cursor".
          (Luuk van Baal)

fe803c8c04
2025-06-27 11:16:23 +02:00
534ec8d447 vim-patch:9.1.1475: completion: regression when "nearest" in 'completeopt' (#34607)
Problem:  completion: regression when "nearest" in 'completeopt'
Solution: fix compare function (Girish Palya)

closes: vim/vim#17577

cd68f21f60

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-23 07:56:47 +08:00
ee2fc31b36 vim-patch:9.1.1473: inconsistent range arg for :diffget/diffput (#34588)
Problem:  inconsistent range arg for :diffget/diffput
Solution: fix the range specification, place the cursor for :diffput and
          :diffget consistently on the last line (Yee Cheng Chin)

Previously, `:<range>diffget` only allowed using 1 or above in the range
value, making it impossible to use the command for a diff block at the
beginning of the file. Fix the range specification so the user can now
use 0 to specify the space before the first line. This allows
`:0,$+1diffget` to work to retrieve all the changes from the other file
instead of missing the first diff block. Also do this for `:diffput`.

Also, make `:diffput` work more similar to `:diffget`. Make it so that
if the cursor is on the last line and a new line is inserted in the
other file, doing `:diffput` will select that diff block below the line,
just like `:diffget` would.

Also clean up the logic a little bit for edge cases and for handling
line matched diff blocks better.

closes: vim/vim#17579

d75ab0cbf5

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-06-22 08:00:17 +08:00
487112d674 vim-patch:9.1.1468: filetype: bright(er)script files are not recognized
Problem:  filetype: bright(er)script files are not recognized
Solution: detect *.bs files as brighterscript filetype and *.brs as
          brightscript filetype, include filetype plugins (Riley Bruins)

closes: vim/vim#17566

03e5ee25fd

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-06-19 11:10:38 +02:00
8ed6f00ab0 vim-patch:9.1.1471: completion: inconsistent ordering with CTRL-P (#34571)
Problem:  completion: inconsistent ordering with CTRL-P
          (zeertzjq)
Solution: reset compl_curr_match when using CTRL-P (Girish Palya)

fixes: vim/vim#17425
closes: vim/vim#17434

5fbe72edda

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-19 09:24:13 +08:00
5cf135f9a0 vim-patch:9.1.1466: filetype: not all lex files are recognized
Problem:  filetype: not all lex files are recognized
Solution: detect *.ll as lex, llvm or lifelines filetype, depending on
          the content (Eisuke Kawashima)

closes: vim/vim#17560

48295111e5

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-06-18 14:37:06 +02:00
3b85046ed5 fix(messages): "list_cmd" kind for :command, :version (#34529)
Problem:  No ext_messages kind for the :command, :version commands.
          :version is emitted as multiple events.
Solution: Assign them the "list_cmd" kind. Use `msg_put*` to properly
          format the message as a single event.
2025-06-18 07:54:49 +02:00
286371b4d2 feat(prompt): multiline prompt input #33371
Problem:
Cannot enter multiline prompts in a buftype=prompt buffer.

Solution:
- Support shift+enter (`<s-enter>`) to start a new line in the prompt.
- Pasting multiline text via OS paste, clipboard, "xp, etc.
- A/I in editable region works as usual.
- i/a/A/I outside of editable region moves cursor to end of current
  prompt.
- Support undo/redo in prompt buffer.
- Support o/O in prompt buffer.
- Expose prompt location as `':` mark.
2025-06-17 08:46:57 -07:00
ae0981070e vim-patch:9.1.1464: gv does not work in operator-pending mode (#34534)
Problem:  gv does not work in operator-pending mode
          (liushapku)
Solution: remove the check for checkclearop in nv_gv_cmd()
          (phanium)

fixes: vim/vim#3666
closes: vim/vim#17551

cb27992cda

Co-authored-by: phanium <91544758+phanen@users.noreply.github.com>
2025-06-17 00:27:41 +00:00
3e984cf02b vim-patch:9.1.1463: Integer overflow in getmarklist() after linewise operation (#34532)
Problem:  Integer overflow in getmarklist() after linewise operation.
Solution: Don't add 1 to MAXCOL (zeertzjq)

related: neovim/neovim#34524
closes: vim/vim#17552

93318a9933
2025-06-16 23:24:52 +00:00
3a2ac2300b vim-patch:9.1.1454: tests: no test for pum at line break position (#34462)
Problem:  Missing test case for pum display on a wrapped line.
Solution: Add a test case to cover pum behavior at line break positions.
          (glepnir)

closes: vim/vim#17520

6cc9bd4001

Co-authored-by: glepnir <glephunter@gmail.com>
2025-06-12 08:04:36 +08:00
612f8e7c9e vim-patch:9.1.1450: Session has wrong arglist with :tcd and :arglocal (#34430)
Problem:  Session has wrong arglist with :tcd and :arglocal.
Solution: Also use absolute path for :argadd when there is tabpage-local
          directory (zeertzjq).

related: neovim/neovim#34405
closes: vim/vim#17503

a304e49790
2025-06-10 23:35:42 +00:00
ac772706cc vim-patch:9.1.1447: completion: crash when backspacing with fuzzy completion
Problem:  completion: crash when backspacing with fuzzy completion
Solution: Don't dereference compl_first_match when it's NULL
          (zeertzjq).

related: neovim/neovim#34419
closes: vim/vim#17511

91782b4aeb
2025-06-11 06:42:28 +08:00
2c80b05cbd vim-patch:9.1.1446: filetype: cuda-gdb config files are not recognized
Problem:  filetype: cuda-gdb config files are not recognized
Solution: detect .cuda-gdbinit and cuda-gdbinit files as gdb filetype
          (Wu Zhenyu)

closes: vim/vim#17471

601cfa9a23

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-06-10 09:10:47 +02:00
bcba067dc2 vim-patch:9.1.1445: negative matchfuzzy scores although there is a match (#34409)
Problem:  negative matchfuzzy scores although there is a match
          (Maxim Kim)
Solution: reset the score if a match has been found but the score is
          negative (Girish Palya)

The fuzzy algorithm may miss some matches in long strings due to recursion
limits. As a result, the score can end up negative even when matches exist.
In such cases, reset the score to ensure it is non-negative.

fixes: #vim/vim#17449
closes: vim/vim#17469

328332b0b0

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-06-10 00:47:14 +00:00
78e2f62516 vim-patch:9.1.1442: tests: Test_diff_fold_redraw() is insufficient (#34407)
Problem:  tests: Test_diff_fold_redraw() is insufficient
          (after v9.1.1439, Christ van Willegen)
Solution: improve the test (Gary Johnson)

The original Test_diff_fold_redraw() function, added 2025-06-08 at patch
9.1.1439, had a bug and didn't do a very good job of testing the fold
behavior.  This new version is simpler and more thorough.

The bug was that it checked the fold state of one window twice instead
of checking both windows.

closes: vim/vim#17492

69565e3618

Co-authored-by: Gary Johnson <garyjohn@spocom.com>
2025-06-10 08:20:45 +08:00
bcfc22853a vim-patch:9.1.1441: completion: code can be improved
Problem:  completion: code can be improved
Solution: remove reposition_match() and use mergesort_list(),
          for fuzzy completion, sort by fuzzy score immediately after
          setting a new leader (Girish Palya)

closes: vim/vim#17460

b8ee1cf56e

Co-authored-by: Girish Palya <girishji@gmail.com>
Co-authored-by: glepnir <glephunter@gmail.com>
2025-06-10 07:27:09 +08:00
d2dad30898 vim-patch:9.1.1439: Last diff folds not merged (#34380)
Problem:  Last diff folds not merged (after v8.1.1922)
Solution: loop over all windows in the current tabpage and update all
          folds (Gary Johnson)

This commit fixes a bug where the last two folds of a diff are not
merged when the last difference between the two diff'd buffers is
resolved.

Normally, when two buffers are diff'd, folding is used to show only the
text that differs and to hide the text that is the same between the two
buffers.  When a difference is resolved by making a block of text the
same in both buffers, the folds are updated to merge that block with the
folds above and below it into one closed fold.

That updating of the folds did not occur when the block of text was the
last diff block in the buffers.

The bug was introduced by this patch on August 24, 2019:

    patch 8.1.1922: in diff mode global operations can be very slow

    Problem:    In diff mode global operations can be very slow.
    Solution:   Do not call diff_redraw() many times, call it once when
		redrawing.  And also don't update folds multiple times.

Unfortunately, folds were then not updated often enough.

The problem was fixed by adding a short loop to the ex_diffgetput()
function in diff.c to update all the folds in the current tab when the
last difference is removed.

A test for this was added to test_diffmode.vim.  Two of the reference
screen dumps for another test in that file,
Test_diffget_diffput_linematch(), had to be changed to have all the
folds closed rather than to have the last diff block remain open.

closes: vim/vim#17457

3fa0d3514b

Co-authored-by: Gary Johnson <garyjohn@spocom.com>
2025-06-09 06:57:54 +08:00