Commit Graph

731 Commits

Author SHA1 Message Date
zeertzjq
448cf10c47
vim-patch:9.1.0159: Crash in WinClosed after BufUnload closes other windows (#27792)
Problem:  Crash in WinClosed after BufUnload closes other windows
Solution: Don't trigger WinClosed if the buffer is NULL (zeertzjq)

Now win_close_othertab() doesn't trigger any autocommands if the buffer
is NULL, so remove the autocmd blocking above (which was added not long
ago in patch v9.0.0550) for consistency.

Also remove an unreachable close_last_window_tabpage() above:
- It is only reached if only_one_window() returns TRUE and last_window()
  returns FALSE.
- If only_one_window() returns TRUE, there is only one tabpage.
- If there is only one tabpage and last_window() returns FALSE, the
  one_window() in last_window() must return FALSE, and the ONE_WINDOW
  in close_last_window_tabpage() must also be FALSE.
- So close_last_window_tabpage() doesn't do anything and returns FALSE.

Then the curtab != prev_curtab check also doesn't make much sense, and
the only_one_window() can be replaced with a check for popup and a call
to last_window() since this is a stricter check than only_one_window().

closes: vim/vim#14166

b2ec0da080
2024-03-10 07:03:36 +08:00
zeertzjq
241c161299
vim-patch:9.1.0161: expand() removes slash after env variable that ends with colon (#27791)
Problem:  expand() removes a slash after an environment variable that
          ends with a colon on Windows.
Solution: Check the correct char for a colon (zeertzjq)

closes: vim/vim#14161

Note: Vim still removes the path-separator at the end, if another path separator
follows directly after it, e.g. on:

```
    echo $FOO='/usr/'
    echo expand('$FOO/bar') == '/usr/bar'
```

see:

,----[ misc1.c:1630 ]
|   // if var[] ends in a path separator and tail[] starts
|   // with it, skip a character
|   if (after_pathsep(dst, dst + c)
| #if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA)
| 	  && (dst == save_dst || dst[-1] != ':')
| #endif
| 	  && vim_ispathsep(*tail))
|       ++tail;
`----

13a014452a

Cherry-pick test_expand.vim change from patch 9.0.1257.
2024-03-10 06:47:09 +08:00
Sean Dewar
b596732831
Merge pull request #27330 from seandewar/win_set_config-fixes
fix(api): various window-related function fixes

This is a big one!
2024-03-09 22:32:20 +00:00
Sean Dewar
c3d22d32ee
vim-patch:8.2.3862: crash on exit with EXITFREE and using win_execute()
Problem:    Crash on exit with EXITFREE and using win_execute().
Solution:   Also save and restore tp_topframe. (issue vim/vim#9374)

dab17a0689

Couldn't repro the crash in the test, but I only care about this patch so
switch_win sets topframe properly for win_split_ins in nvim_open_win and
nvim_win_set_config.
Add a test using nvim_win_call and :wincmd, as I couldn't repro the issue via
nvim_open_win or nvim_win_set_config (though it's clear they're affected by this
patch).

That said, at that point, could just use {un}use_tabpage inside switch_win
instead, which also updates tp_curwin (though maybe continue to not set it in
restore_win). That would also fix possible inconsistent behaviour such as:

:call win_execute(w, "let curwin_nr1 = tabpagewinnr(1)")
:let curwin_nr2 = tabpagewinnr(1)

Where it's possible for curwin_nr1 != curwin_nr2 if these commands are run from
the 1st tabpage, but window "w" is in the 2nd (as the 1st tabpage's tp_curwin
may still be invalid). I'll probably PR a fix for that later in Vim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-03-09 21:58:30 +00:00
Raphael
0e28493914
vim-patch:8.2.3915: illegal memory access when completing with invalid bytes (#27491)
Problem:    illegal memory access when completing with invalid bytes.
Solution:   Avoid going over the end of the completion text.

vim/vim@4b28ba3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-03-09 19:21:31 +08:00
zeertzjq
6416c6bc94 test(old): remove Test_floatwin_splitmove()
Its corresponding test in Vim is in test_popupwin.win, so having it in
the middle of test_window_cmd.vim is strange, and it is now covered by
tests in ui/float_spec.lua anyway.
2024-03-09 12:27:20 +08:00
Sean Dewar
832bc5c169
vim-patch:9.1.0130: [security]: UAF if win_split_ins autocommands delete "wp"
Problem:  heap-use-after-free in win_splitmove if Enter/Leave
          autocommands from win_split_ins immediately closes "wp".
Solution: check that "wp" is valid after win_split_ins.
          (Sean Dewar)

abf7030a5c
2024-03-08 23:24:05 +00:00
Sean Dewar
e3d4dfb6c3
vim-patch:9.1.0128: win_gotoid() may abort even when not switching a window
Problem:  win_gotoid() checks for textlock and other things when switching
          to a window that is already current (after v9.1.0119)
Solution: return early with success when attempting to switch to curwin
          (Sean Dewar)

2a65e73944
2024-03-08 23:24:05 +00:00
Sean Dewar
b2245307f2
vim-patch:9.1.0121: Infinite loop or signed overflow with 'smoothscroll'
Problem:  infinite loop in win_update with 'smoothscroll' set when
          window width is equal to textoff, or signed integer overflow
          if smaller.
Solution: don't revalidate wp->w_skipcol in that case, as no buffer text
          is being shown. (Sean Dewar)

02fcae02a9

Test_window_split_no_room changes were already cherry-picked earlier.
2024-03-08 23:24:05 +00:00
Sean Dewar
01b27410a3
vim-patch:9.1.0119: can move away from cmdwin using win_splitmove()
Problem:  can switch windows while textlocked via f_win_gotoid and
          f_win_splitmove (which also allows switching in the cmdwin).
Solution: Check text_or_buf_locked in f_win_splitmove()
          (Sean Dewar)

While at it, call text_or_buf_locked() in f_win_gotoid() instead of testing for
cmdwin_type() (which text_buf_locked() does and in addition will also verify
that the buffer is not locked).

f865895c87
2024-03-08 23:24:05 +00:00
Sean Dewar
24dfa47e4f
vim-patch:partial:9.1.0117: Stop split-moving from firing WinNew and WinNewPre autocommands
Problem:  win_splitmove fires WinNewPre and possibly WinNew when moving
          windows, even though no new windows are created.
Solution: don't fire WinNew and WinNewPre when inserting an existing
          window, even if it isn't the current window. Improve the
          accuracy of related documentation. (Sean Dewar)

96cc4aef3d

Partial as WinNewPre has not been ported yet (it currently has problems anyway).
2024-03-08 23:24:04 +00:00
Sean Dewar
66f331fef7
vim-patch:9.1.0116: win_split_ins may not check available room
Problem:  win_split_ins has no check for E36 when moving an existing
          window
Solution: check for room and fix the issues in f_win_splitmove()
          (Sean Dewar)

0fd44a5ad8

Omit WSP_FORCE_ROOM, as it's not needed for Nvim's autocmd window, which is
floating. Shouldn't be difficult to port later if it's used for anything else.

Make win_splitmove continue working for turning floating windows into splits.
Move the logic for "unfloating" a float to win_split_ins; unlike splits, no
changes to the window layout are needed before calling it, as floats take no
room in the window layout and cannot affect the e_noroom check.

Add missing tp_curwin-fixing logic for turning external windows into splits, and
add a test.
NOTE: there are other issues with the way "tabpage independence" is implemented
for external windows; namely, some things assume that tp_curwin is indeed a
window within that tabpage, and as such, functions like tabpage_winnr and
nvim_tabpage_get_win currently don't always work for external windows (with the
latter aborting!)

Use last_status over frame_add_statusline, as Nvim's last_status already does
this for all windows in the current tabpage. Adjust restore_full_snapshot_rec to
handle this.
This "restore everything" approach is changed in a future commit anyway, so only
ensure it's robust enough to just pass tests.

Keep check_split_disallowed's current doc comment, as it's actually a bit more
accurate here. (I should probably PR Vim to use this one)

Allow f_win_splitmove to move a floating "wp" into a split; Nvim supports this.
Continue to disallow it from moving the autocommand window into a split (funnily
enough, the check wasn't reachable before, as moving a float was disallowed),
but now return -1 in that case (win_splitmove also returns FAIL for this, but
handling it in f_win_splitmove avoids us needing to switch windows first).

Cherry-pick Test_window_split_no_room fix from v9.1.0121.

Update nvim_win_set_config to handle win_split_ins failure in later commits.
2024-03-08 23:24:04 +00:00
zeertzjq
25124d3607
test(old): change back to using termopen() on Windows (#27772)
It no longer hangs on Windows CI.
2024-03-08 12:21:11 +08:00
zeertzjq
c38764182a vim-patch:9.1.0158: 'shortmess' "F" flag doesn't work properly with 'autoread'
Problem:  'shortmess' "F" flag doesn't work properly with 'autoread'
          (after 9.1.0154)
Solution: Hide the file info message instead of the warning dialog
          (zeertzjq)

closes: vim/vim#14159
closes: vim/vim#14158

8a01744c56
2024-03-08 07:04:39 +08:00
zeertzjq
d741e5d162 vim-patch:9.1.0154: shm=F not respected when reloading buffer with 'autoread'
Problem:  shm=F not respected when reloading buffer with 'autoread'
Solution: Check SHM_FILEINFO in buf_check_timestamp()
          (Shougo Matsushita)

closes: vim/vim#14144

9db39b0ec9

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-03-08 06:53:37 +08:00
zeertzjq
5f3579e6ea
vim-patch:9.1.0157: Duplicate assignment in f_getregion() (#27766)
Problem:  Duplicate assignment in f_getregion().
Solution: Remove the duplicate assignment.  Also improve getregion()
          docs wording and fix an unrelated typo (zeertzjq)

closes: vim/vim#14154

0df8f93bda
2024-03-08 06:44:57 +08:00
zeertzjq
6525832a8c
vim-patch:9.1.0155: can only get getregion() from current buffer (#27757)
Problem:  can only call getregion() for current buffer
Solution: Allow to retrieve selections from different buffers
          (Shougo Matsushita)

closes: vim/vim#14131

84bf6e658d

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-03-07 06:43:08 +08:00
zeertzjq
62d04f21d9
vim-patch:9.1.0146: v:echospace wrong with invalid value of 'showcmdloc' (#27697)
Problem:  v:echospace wrong after setting invalid value to 'showcmdloc'.
Solution: Only call comp_col() if value is valid.
          (zeertzjq)

closes: vim/vim#14119

c27fcf4857
2024-03-02 06:48:11 +08:00
zeertzjq
5d4e1693cb
vim-patch:9.1.0145: v:echospace not correct when 'showcmdloc' != last (#27682)
Problem:  the amount of available space (v:echospace) on the command
          line is not correct when showcmdloc is drawn into the
          statusline or tabline.
Solution: only add SHOWCMD_COLS to the shown command column when
          'showcmdloc' is set to last (Sam-programs)

closes: vim/vim#14108

062141b1a7

Co-authored-by: Sam-programs <130783534+Sam-programs@users.noreply.github.com>
2024-03-01 06:13:38 +08:00
zeertzjq
57e5b9f4ea
vim-patch:9.1.0144: getregion() needs more tests (#27681)
Problem:  getregion() needs more tests
Solution: Run the getregion() test in both the legacy and Vim9 contexts
          (Yegappan Lakshmanan)

closes: vim/vim#14114

4d55c54e30

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-03-01 06:09:20 +08:00
zeertzjq
0eaae1bc05
vim-patch:9.1.0143: [security]: autocmd causes use-after-free in set_curbuf() (#27664)
Problem:  [security]: autocmd cause use-after-free in set_curbuf()
          (kawarimidoll)
Solution: check side-effect of BufLeave autocommand, when the number
          of windows changed, close windows containing buffers that will
          be wiped, if curbuf changed unexpectedly make sure b_nwindows
          is decremented otherwise it cannot be wiped

set_curbuf() already makes some efforts to ensure the BufLeave
autocommands do not cause issues.  However there are still 2 issues
that are not taken care of:

1) If a BufLeave autocommand opens a new window containing the same
buffer as that is going got be closed in close_buffer() a bit later,
we suddenly have another window open, containing a free'd buffer.  So we
must check if the number of windows changed and if it does (and the
current buffer is going to be wiped (according to the 'bufhidden'
setting), let's immediately close all windows containing the current
buffer using close_windows()

2) If a BufLeave autocommand changes our current buffer (displays it in
the current window), buf->b_nwindow will be incremented. As part of
set_curbuf() we will however enter another buffer soon, which means, the
newly created curbuf will have b_nwindows still have set, even so the
buffer is no longer displayed in a window. This causes later problems,
because it will no longer be possible to wipe such a buffer. So just
before entering the final buffer, check if the curbuf changed when
calling the BufLeave autocommand and if it does (and curbuf is still
valid), decrement curbuf->b_nwindows.

Both issues can be verified using the provided test (however the second
issue only because such an impacted buffer won't be wiped, causing
futher issues in later tests).

fixes: vim/vim#13839
closes: vim/vim#14104

55f8bba73b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-29 08:33:02 +08:00
zeertzjq
ce7c51a1a3
vim-patch:9.1.0142: getregion() can be improved (#27662)
Problem:  getregion() can be improved (after v9.1.120)
Solution: change getregion() implementation to use pos as lists and
          one optional {opt} dictionary (Shougo Matsushita)

Note: The following is a breaking change!

Currently, the getregion() function (included as of patch v9.1.120) takes
3 arguments: the first 2 arguments are strings, describing a position,
arg3 is the type string.

However, that is slightly inflexible, there is no way to specify
additional arguments. So let's instead change the function signature to:

getregion(pos1, pos2 [, {Dict}]) where both pos1 and pos2 are lists.
This is slightly cleaner, and gives us the flexibility to specify
additional arguments as key/value pairs to the optional Dict arg.

Now it supports the "type" key to specify the selection type
(characterwise, blockwise or linewise) and now in addition one can also
define the selection type, independently of what the 'selection' option
actually is.

Technically, this is a breaking change, but since the getregion()
Vimscript function is still quite new, this should be fine.

closes: vim/vim#14090

19b718828d

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-02-29 07:19:26 +08:00
zeertzjq
e592657df8
vim-patch:9.1.0141: Put in Visual mode wrong if it replaces fold marker (#27661)
Problem:  Put in Visual mode wrong if it replaces fold marker.
Solution: Temporarily disable folding during put in Visual mode.
          (zeertzjq)

fixes: vim/vim#14097
closes: vim/vim#14100

4e141c66b9
2024-02-29 06:48:29 +08:00
zeertzjq
0d75324e3b
vim-patch:9.1.0137: <Del> in cmdline mode doesn't delete composing chars (#27636)
Problem:  <Del> in cmdline mode doesn't delete composing chars
Solution: Use mb_head_off() and mb_ptr2len() (zeertzjq)

closes: vim/vim#14095

ff2b79d239
2024-02-27 06:09:06 +08:00
zeertzjq
091e374c7f
vim-patch:9.1.0135: Insufficient testing for 'delcombine' (#27616)
Problem:  Insufficient testing for 'delcombine'.
Solution: Add test for both Normal and Insert modes without Arabic.
          (zeertzjq)

closes: vim/vim#14086

cd3a13e774
2024-02-25 07:48:54 +08:00
zeertzjq
04f723f1a5
vim-patch:9.1.0131: buffer-completion may not always find all matches (#27610)
Problem:  buffer-completion code too complicated and does not always
          find all matches (irisjae)
Solution: do not try to anchor pattern to beginning of line or
          directory-separator, always return all matches

Note: we are considering the non-fuzzy buffer-matching here.

Currently, the buffer-completion code makes 2 attempts to match a
pattern against the list of available patterns. First try is to match
the pattern and anchor it to either the beginning of the file name or
at a directory-separator (// or \\).

When a match is found, Vim returns the matching buffers and does not try
to find a match anywhere within a buffer name. So if you have opened two
buffers like /tmp/Foobar.c and /tmp/MyFoobar.c using `:b Foo` will only
complete to the first filename, but not the second (the same happens
with `getcompletion('Foo', 'buffer')`).

It may make sense, that completion priorities buffer names at directory
boundaries, but it inconsistent, may cause confusion why a certain
buffer name is not completed when typing `:b Foo<C-D>` which returns
only a single file name and then pressing Enter (to switch to that
buffer), Vim will error with 'E93: More than one match for Foo').
Similar things may happen when wiping the /tmp/Foobar.c pattern and
afterwards the completion starts completing other buffers.

So let's simplify the code and always match the pattern anywhere in the
buffer name, do not try to favor matches at directory boundaries. This
is also simplifies the code a bit, we do not need to run over the list
of buffers several times, but only twice.

fixes vim/vim#13894
closes: vim/vim#14082

0dc0bff000

Cherry-pick test_cmdline.vim from patch 9.1.0019 as it already passes.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-24 22:59:28 +08:00
zeertzjq
febf481002
vim-patch:9.1.0132: "C" doesn't include composing chars with 'virtualedit' (#27605)
Problem:  using "C" and 've=all' set, doesn't include composing chars
          when changing a line, keeps the composing chars for whatever
          is typed afterwards.
Solution: Use mb_head_off() and mb_ptr2len() instead of mb_tail_off().
          (zeertzjq)

closes: vim/vim#14083

048761bcd4
2024-02-24 22:04:52 +08:00
zeertzjq
06df895e71 vim-patch:9.1.0126: Internal error when using upper-case mark in getregion()
Problem:  Internal error when passing mark in another buffer to
          getregion().
Solution: Don't allow marks in another buffer (zeertzjq)

closes: vim/vim#14076

Internal error when passing mark in another buffer to getregion()

421b597470
2024-02-23 06:39:05 +08:00
zeertzjq
20e4001eee vim-patch:9.1.0120: hard to get visual region using Vim script
Problem:  hard to get visual region using Vim script
Solution: Add getregion() Vim script function
          (Shougo Matsushita, Jakub Łuczyński)

closes: vim/vim#13998
closes: vim/vim#11579

3f905ab3c4

Cherry-pick changes from patch 9.1.0122, with :echom instead of :echow.

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl>
2024-02-23 06:39:03 +08:00
zeertzjq
f25c0c1eb9
vim-patch:ef387c062bb1 (#27553)
runtime(filetype): Modula-2 files with priority not detected (vim/vim#14055)

Problem:  Modula-2 files with a specified priority are not detected.
Solution: Match the priority syntax in module header lines when
          performing heuristic content detection.

Disable the :defcompile debug line.  This was accidentally left enabled
in commit 68a8947.

ef387c062b

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-02-21 06:29:53 +08:00
zeertzjq
8f1f2a1d9f
vim-patch:9.1.0115: Using freed memory with full tag stack and user data (#27525)
Problem:  Using freed memory with full tag stack and user data
          (Konstantin Khlebnikov)
Solution: Clear the user data pointer of the newest entry.
          (zeertzjq, Konstantin Khlebnikov)

fixes: neovim/neovim#27498
closes: vim/vim#14053

c86bff1771

Cherry-pick Test_tag_stack() changes from patch 9.0.0767.

Co-authored-by: Konstantin Khlebnikov <koct9i@gmail.com>
2024-02-19 06:53:13 +08:00
zeertzjq
eb8a3e0575
vim-patch:9.1.0114: Setting some options may change curswant (#27514)
Problem:  Setting some options changes curswant unnecessarily.
Solution: Add a P_HLONLY flag that prevents changing curswant.
          (zeertzjq)

closes: vim/vim#14044

fcaed6a70f
2024-02-18 17:20:49 +08:00
zeertzjq
c1fa8789c1 vim-patch:9.1.0112: Remove undo information, when cleaning quickfix buffer
Problem:  When the quickfix buffer has been modified an autocommand
          may invalidate the undo stack (kawarimidoll)
Solution: When clearing the quickfix buffer, also wipe the undo stack

fixes: vim/vim#13905
closes: vim/vim#13928

f0d3d4a426

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-16 07:18:06 +08:00
Christian Clason
0a51e7626a vim-patch:9.1.0111: filetype: no support for bats files
The '*.bats' file type is for Bash Automated Testing System (BATS)
scripts. BATS scripts are Bash with a special '@test' extension but they
otherwise work with Vim's bash filetype.

See https://github.com/bats-core/bats-core

closes: vim/vim#14039

d00fb4b3a2

Co-authored-by: Brandon Maier <brandon.maier@collins.com>
2024-02-15 10:01:16 +01:00
Christian Clason
d0599b0ed9 vim-patch:9.1.0110: filetype: add 'Config.in' filetype detection
The 'Config.in' file type is for Buildroot configuration files.
Buildroot Config.in files use the same Kconfig backend as the Linux
kernel's Kconfig files.

Buildroot also has other filename variants that follow "Config.in.*",
they are used to distinguish multiple Config.in files in the same
directory.

See https://buildroot.org/downloads/manual/manual.html#_literal_config_in_literal_file

closes: vim/vim#14038

5f20f050ef

Co-authored-by: Brandon Maier <brandon.maier@collins.com>
2024-02-15 10:01:16 +01:00
Christian Clason
7ed75d410a vim-patch:9.1.0109: filetype: no support for its files
Problem:  filetype: no support for its files
Solution: Add detection for *.its files as dts file type
          (Brandon Maier)

The '*.its' file type is for U-Boot Flattened Image Trees (FIT) which
use the flattened devicetree format.

See https://github.com/u-boot/u-boot/blob/master/doc/usage/fit/source_file_format.rst#terminology

closes: vim/vim#14037

cf1d65e060

Co-authored-by: Brandon Maier <brandon.maier@collins.com>
2024-02-15 10:01:16 +01:00
Christian Clason
4f07ad7786 vim-patch:9.1.0108: filetype: no support for dtso files
Problem:  filetype: no support for dtso files
Solution: Add detection for *.dtso files as dts file type
          (Markus Schneider-Pargmann)

*.dtso files are devicetree overlay files which have the same syntax as dts or dtsi files.

closes: vim/vim#14026

b1700fb33f

Co-authored-by: Markus Schneider-Pargmann <msp@baylibre.com>
2024-02-15 10:01:16 +01:00
zeertzjq
b2f7a3aaad
vim-patch:9.1.0105: Style: typos found (#27462)
Problem:  Style: typos found
Solution: correct them
          (zeertzjq)

closes: vim/vim#14023

e71022082d
2024-02-14 06:39:47 +08:00
zeertzjq
4860cc5bdc
vim-patch:9.1.0101: upper-case of German sharp s should be U+1E9E (#27449)
Problem:  upper-case of ß should be U+1E9E (CAPITAL LETTER SHARP S)
          (fenuks)
Solution: Make gU, ~ and g~ convert the U+00DF LATIN SMALL LETTER SHARP S (ß)
          to U+1E9E LATIN CAPITAL LETTER SHARP S (ẞ), update tests
          (glepnir)

This is part of Unicode 5.1.0 from April 2008, so should be fairly safe
to use now and since 2017 is part of the German standard orthography,
according to Wikipedia:
https://en.wikipedia.org/wiki/Capital_%E1%BA%9E#cite_note-auto-12

There is however one exception: UnicodeData.txt for U+00DF
LATIN SMALL LETTER SHARP S does NOT define U+1E9E LATIN CAPITAL LETTER
SHARP S as its upper case version. Therefore, toupper() won't be able
to convert from lower sharp s to upper case sharp s (the other way
around however works, since U+00DF is considered the lower case
character of U+1E9E and therefore tolower() works correctly for the
upper case version).

fixes: vim/vim#5573
closes: vim/vim#14018

bd1232a1fa

Co-authored-by: glepnir <glephunter@gmail.com>
2024-02-13 07:38:12 +08:00
zeertzjq
86458dde0e
vim-patch:9.1.0103: 'breakindentopt' "min" not correct with 'signcolumn' (#27451)
Problem:  'breakindentopt' "min" works incorrectly with 'signcolumn'.
Solution: Use win_col_off() and win_col_off2().
          (zeertzjq)

closes: vim/vim#14014

f0a9d65e0a
2024-02-13 07:33:24 +08:00
zeertzjq
2493fd020d
vim-patch:9.1.0102: settabvar() may change the last accessed tabpage (#27450)
Problem:  settabvar() may change the last accessed tabpage.
Solution: Save and restore lastused_tabpage.
          (zeertzjq)

closes: vim/vim#14017

b47fbb4083
2024-02-13 07:27:27 +08:00
Raphael
4682f158a0
vim-patch:9.1.0098: CompleteChanged not triggered when new leader added without matches (#27436)
Problem:  CompleteChanged not triggered when new leader added causing
          no matching item in the completion menu
Solution: When completion is active but no items matched still trigger
          CompleteChanged event
          (glepnir)

closes: vim/vim#13982

0d3c0a66a3

Fix #15077
2024-02-12 14:57:13 +08:00
zeertzjq
9605cfe06c
vim-patch:9.1.0097: 'breakindent' behaves inconsistently with 'list' and splits (#27432)
Problem:  'breakindent' behaves inconsistently with 'list' and splits.
Solution: Use 'listchars' from the correct window and handle caching
          properly. Move cheaper comparisons to the top.
          (zeertzjq)

closes: vim/vim#14008

efabd7c8d4
2024-02-12 06:34:16 +08:00
Trevor Arjeski
170c890dca
feat(shortmess): "q" flag fully hides recording message (#27415)
When "q" is set in 'shortmess' it now fully hides the "recording @a" message
when you are recording a macro instead of just shortening to "recording". This
removes duplication when using reg_recording() in the statusline.

Related #19193
2024-02-11 07:39:39 +08:00
Raphael
7ab003ec79
vim-patch:9.1.0087: Restoring lastused_tabpage too early in do_arg_all() (#27411)
Problem:  Restore lastused_tabpage too early in do_arg_all() function it
          will change later in the function.
Solution: Restore lastused_tabpage a bit later, when being done with
          tabpages (glepnir)

closes: vim/vim#13992

2975a54f28
2024-02-10 12:21:31 +08:00
zeertzjq
3f419d84fb
vim-patch:9.1.0088: TextChanged not triggered for :norm! commands (#27405)
Problem:  TextChanged not triggered for :norm! commands
          (machakann, after v9.0.2031)
Solution: Only reset curbuf->b_last_changedtick if TextChangedI
          was triggered in insert mode (and not blocked)

Note: for unknown reasons, the test fails on Windows (but seems to work
fine when running interactively)

fixes: vim/vim#13967
closes: vim/vim#13984

c9e79e5284

Cherry-pick test_autocmd.vim change from patch 8.2.4149.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-10 06:53:26 +08:00
zeertzjq
0d4d3e4325
vim-patch:9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak' (#27404)
Problem:  Visual hl wrong when it ends before multibyte 'showbreak'.
          (lacygoil)
Solution: Use vcol_sbr instead of adding n_extra.
          (zeertzjq)

fixes: vim/vim#11272
closes: vim/vim#13996

df23d7f4bd

Bug doesn't apply to Nvim.
2024-02-10 06:53:10 +08:00
zeertzjq
da3facb7ee vim-patch:9.1.0083: Redrawing can be improved when deleting lines with 'number'
Problem:  Redrawing can be improved when inserting/deleting lines with 'number'.
Solution: Only redraw the number column of lines below changed lines.
          Add a test as this wasn't previously tested.
          (zeertzjq)

closes: vim/vim#13985

ae07ebc04b
2024-02-08 19:20:07 +08:00
zeertzjq
1c2b9e8dd8 vim-patch:9.1.0082: Redrawing can be improved when deleting lines with 'cursorline'
Problem:  Redrawing can be improved when deleting lines with 'cursorline'.
Solution: Use smarter invalidation and adjustment.  Remove unnecessary
          UPD_VALID as it is already set at the top of the loop.  Make
          the test for vim/vim#4862 fail without the fix.
          (zeertzjq)

closes: vim/vim#13986

7ce34c9a94
2024-02-08 19:20:07 +08:00
zeertzjq
7fa84f32e7
vim-patch:9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines (#27363)
Problem:  LineNrAbove and LineNrBelow background wrong on wrapped lines.
Solution: Update number column also for wrapped part of a line.
          (zeertzjq)

closes: vim/vim#13974

ebfd856cfd

Cherry-pick test_number.vim changes from patch 9.0.0626.
2024-02-06 20:18:23 +08:00