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#139922975a54f28
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#13967closes: vim/vim#13984c9e79e5284
Cherry-pick test_autocmd.vim change from patch 8.2.4149.
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Visual hl wrong when it ends before multibyte 'showbreak'.
(lacygoil)
Solution: Use vcol_sbr instead of adding n_extra.
(zeertzjq)
fixes: vim/vim#11272closes: vim/vim#13996df23d7f4bd
Bug doesn't apply to Nvim.
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#13985ae07ebc04b
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#139867ce34c9a94
Problem: LineNrAbove and LineNrBelow background wrong on wrapped lines.
Solution: Update number column also for wrapped part of a line.
(zeertzjq)
closes: vim/vim#13974ebfd856cfd
Cherry-pick test_number.vim changes from patch 9.0.0626.
Problem: insert completion not correct when adding new leader
Solution: Reset compl_curr_match to compl_shown_match
(glepnir)
closes: vim/vim#13957cbb46b4398
- Consistently use the variable CMAKE_BUILD_TYPE to select build type.
- Remove broken `doc_html` target.
- Remove swap files created by oldtest when cleaning.
- Only rerun `lintdoc` if any documentation files has changed.
Problem: Crash when using gettabwinvar() with invalid arguments. (Yilin
Yang)
Solution: Use "curtab" if "tp" is NULL. (closesvim/vim#5475)
ee93b737aa
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Segfault with CompleteChanged autocommand
(markonm )
Solution: Test match->cp_prev for being NULL before accessing it
closes: vim/vim#13929fef6630166
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Recorded register cannot be translated using keytrans() when
it involves character search (iddqd505)
Solution: Record a K_IGNORE instead of a K_NOP (zeertzjq)
related: vim/vim#13916closes: vim/vim#13925bf321806bf
Problem: E95 is possible if a buffer called "[Command Line]" already
exists when opening the cmdwin. This can also happen if the
cmdwin's buffer could not be deleted when closing.
Solution: Un-name the cmdwin buffer, and give it a special name instead,
similar to what's done for quickfix buffers and for unnamed
prompt and scratch buffers. As a result, BufFilePre/Post are
no longer fired when opening the cmdwin. Add a "command" key
to the dictionary returned by getbufinfo() to differentiate
the cmdwin buffer instead. (Sean Dewar)
Cherry-pick test_normal changes from v9.0.0954.
1fb4103206
Problem: Autocmds triggered from opening the cmdwin (in win_split and
do_ecmd) can cause issues such as E199, as the current checks
are insufficient.
Solution: Commands executed from the cmdwin apply to the old curwin/buf,
so they should be kept in a "suspended" state; abort if
they've changed. Also abort if cmdwin/buf was tampered with,
and check that curwin is correct. Try to clean up the cmdwin
buffer (only if hidden and non-current to simplify things; the
same approach is used when closing cmdwin normally), and add a
beep. (Sean Dewar)
Rename the old Test_cmdwin_interrupted() like in the patch (can be moved to
test_cmdwin.vim when v9.0.0027 is ported).
Move the error message to `e_active_window_or_buffer_changed_or_deleted`.
43b395ec2e
Problem: Things that temporarily change/restore curwin/buf (e.g:
win_execute, some autocmds) may break assumptions that
curwin/buf is the cmdwin when "cmdwin_type != 0", causing
issues.
Solution: Expose the cmdwin's real win/buf and check that instead. Also
try to ensure these variables are NULL if "cmdwin_type == 0",
allowing them to be used directly in most cases without
checking cmdwin_type. (Sean Dewar)
Reset and save `cmdwin_old_curwin` in a similar fashion.
Apply suitable changes for API functions and add Lua tests.
988f74311c
Problem: Cannot map Super Keys in GTK UI
(Casey Tucker)
Solution: Enable Super Key mappings in GTK using <D-Key>
(Casey Tucker)
As a developer who works in both Mac and Linux using the same keyboard,
it can be frustrating having to remember different key combinations or
having to rely on system utilities to remap keys.
This change allows `<D-z>` `<D-x>` `<D-c>` `<D-v>` etc. to be recognized
by the `map` commands, along with the `<D-S-...>` shifted variants.
```vimrc
if has('gui_gtk')
nnoremap <D-z> u
nnoremap <D-S-Z> <C-r>
vnoremap <D-x> "+d
vnoremap <D-c> "+y
cnoremap <D-v> <C-R>+
inoremap <D-v> <C-o>"+gP
nnoremap <D-v> "+P
vnoremap <D-v> "-d"+P
nnoremap <D-s> :w<CR>
inoremap <D-s> <C-o>:w<CR>
nnoremap <D-w> :q<CR>
nnoremap <D-q> :qa<CR>
nnoremap <D-t> :tabe<CR>
nnoremap <D-S-T> :vs#<CR><C-w>T
nnoremap <D-a> ggVG
vnoremap <D-a> <ESC>ggVG
inoremap <D-a> <ESC>ggVG
nnoremap <D-f> /
nnoremap <D-g> n
nnoremap <D-S-G> N
vnoremap <D-x> "+x
endif
```
closes: vim/vim#1269892e90a1e10
Co-authored-by: Casey Tucker <dctucker@hotmail.com>
Problem: Incorrect number of trailing spaces inserted for multibyte
characters when pasting a blockwise register in blockwise visual
mode (VanaIgr)
Solution: Skip over trailing UTF-8 bytes when computing the number of trailing
spaces (VanaIgr)
When pasting in blockwise visual mode, and the register type is <CTRL-V>, Vim
aligns the text after the replaced area by inserting spaces after pasted
lines that are shorter than the longest line. When a shorter line contains
multibyte characters, each trailing UTF-8 byte's width is counted in addition
to the width of the character itself. Each trailing byte counts as being 4
cells wide (since it would be displayed as <xx>).
closes: vim/vim#139096638ec8afa
Co-authored-by: VanaIgr <vanaigranov@gmail.com>
Problem: 'linebreak' may still apply to leading whitespace
(VanaIgr)
Solution: Compare pointers instead of virtual columns.
(zeertzjq)
related: #27180closes: vim/vim#13915703f9bc943
Co-authored-by: VanaIgr <vanaigranov@gmail.com>
Problem: :drop does not re-use empty buffer
(Rocco Mao)
Solution: Make :drop re-use an empty buffer
(Rocco Mao)
fixes: vim/vim#13851closes: vim/vim#13881f96dc8d07f
Co-authored-by: Rocco Mao <dapeng.mao@qq.com>
Problem: ml_get: invalid lnum when :s replaces visual selection
(@ropery)
Solution: substitute may decrement the number of lines in a buffer,
so validate, that the bottom lines of the visual selection
stays within the max buffer line
fixes: vim/vim#13890closes: vim/vim#138927c71db3a58
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Missing test for Chuck filetype
after commit 27a4632af6753
(Christian Clason)
Solution: Add a filetype test
c1884c94c5
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Sharing queries with upstream and Helix is difficult due to
different capture names.
Solution: Define and document a new set of standard captures that
matches tree-sitter "standard captures" (where defined) and is closer to
Helix' Atom-style nested groups.
This is a breaking change for colorschemes that defined highlights based
on the old captures. On the other hand, the default colorscheme now
defines links for all standard captures (not just those used in bundled
queries), improving the out-of-the-box experience.
Problem: Modifying a hidden buffer still interferes with prompt buffer
mode changes.
Solution: Save and restore b_prompt_insert.
(zeertzjq)
closes: vim/vim#13875
Modifying hidden buffer still interferes with prompt buffer mode changes
f267847017
Problem: too vague errors for 'listchars'/'fillchars'
Solution: Include the field name in error message.
(zeertzjq)
related: #27050closes: vim/vim#138776a8d2e1634
Co-authored-by: Cole Frankenhoff <cole.nhf@gmail.com>
Problem: Insert mode not stopped if an autocommand modifies a hidden
buffer while closing a prompt buffer.
Solution: Don't set b_prompt_insert if stop_insert_mode is already set.
(zeertzjq)
closes: vim/vim#1387296958366ad
* vim-patch:9.1.0035: i_CTRL-] triggers InsertCharPre
Problem: i_CTRL-] triggers InsertCharPre
Solution: Return if CTRL-] is received. InsertCharPre
is supposed to be only used for chars to be inserted
but i_CTRL-] triggers expansion and is not inserted
into the buffer (altermo)
closes: vim/vim#13853closes: vim/vim#138647d711fe209
Problem: Modula2 filetype support lacking
Solution: Improve the Modula-2 runtime support, add additional modula2
dialects, add compiler plugin, update syntax highlighting,
include syntax tests, update Makefiles (Doug Kearns)
closes: vim/vim#6796closes: vim/vim#811568a8947069
- Luaify the detection script:
- Split the `(*!m2foo*)` and `(*!m2foo+bar*)` detection into two Lua patterns,
as Lua capture groups cannot be used with `?` and friends (as they only work
on character classes).
- Use `vim.api.nvim_buf_call()` (ew) to call `modula2#SetDialect()` to ensure
`b:modula2` is set for the given bufnr.
- Skip the syntax screendump tests. (A shame as they test some of the detection
from `(*!m2foo+bar*)` tags, but I tested this locally and it seems to work)
- Port the synmenu.vim changes from Vim9 script. (Also tested this locally)
- (And also add the missing comma for `b:browsefilter` from earlier.)
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem: Vim is missing a foreach() func
Solution: Implement foreach({expr1}, {expr2}) function,
which applies {expr2} for each item in {expr1}
without changing it (Ernie Rael)
closes: vim/vim#12166e79e207760
Partial port as this doesn't handle non-materialized range() lists.
vim-patch:c92b8bed1fa6
runtime(help): delete duplicate help tag E741 (vim/vim#13861)
c92b8bed1f
Co-authored-by: Ernie Rael <errael@raelity.com>
Problem: Cannot easily get the list of matches
Solution: Add the matchstrlist() and matchbufline() Vim script
functions (Yegappan Lakshmanan)
closes: vim/vim#13766
Omit CHECK_LIST_MATERIALIZE(): it populates a List with numbers only,
and there is a check for strings below.
f93b1c881a
vim-patch:eb3475df0d92
runtime(doc): Replace non-breaking space with normal space (vim/vim#13868)
eb3475df0d
Co-authored-by: Yegappan Lakshmanan <4298407+yegappan@users.noreply.github.com>
Problem: i_CTRL-R- doesn't work for multibyte chars in Replace mode,
Coverity complains missing return value for u_save_cursor()
Solution: Use mb_charlen() and del_chars() instead, handle failure mode
for u_save_cursor() correctly (@zeertzjq)
closes: vim/vim#13846424ec1f235
Problem: i_CTRL-R- no longer works in replace mode
Solution: delete characters in replace mode before putting, add a test,
add a bit warning into the documentation, that i_CTRL-R-P/O
is not supported in Replace mode for now
fixes: vim/vim#13792closes: vim/vim#138165d5cbb2b9a
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Deleted lines go to wrong yank register.
Solution: Reset y_append when not calling get_yank_register(). (Christian
Brabandt, closesvim/vim#8872)
78eb9cce91
Nvim has removed y_append static variable and already works as expected.
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: default diff highlighting is too noisy
Solution: Link diff highlighting groups to new
Added/Removed/Changed, revert previous change
(Romain Lafourcade)
Remove diff* links added in vim/vim#13776 and doc added in commit b1392be
The links added in vim/vim#13776 are way too noisy for the contexts in which
the `diff` syntax is applied (git commits, patches, etc.).
This commit:
- removes those links
- adds new default highlighting groups Added, Changed and
Removed
- links the diff highlighting groups to those new defaults
- removes the doc changes
- adjusts the syntax_completion test for those newly added group
names
Note: Changes to the default color schemes will be handled separately,
by adding links to those newly created Added/Removed/Changed
highlighting groups.
related: vim/vim#13776closesvim/vim#13825124371c5a1
Co-authored-by: Romain Lafourcade <romain.lafourcade@razorfish.fr>
Problem: regexp cannot match combining chars in collection
Solution: Check for combining characters in regex collections for the
NFA and BT Regex Engine
Also, while at it, make debug mode work again.
fixesvim/vim#10286closes: vim/vim#12871d2cc51f9a1
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: regression with empty inner blocks introduced
(after v9.1.0007)
Solution: Set correct cursor position, Check for visual mode
being active (Maxim Kim)
relates: vim/vim#13514closes: vim/vim#138193779516988
Co-authored-by: Maxim Kim <habamax@gmail.com>
Problem: can select empty inner text blocks
(laurentalacoque)
Solution: make selecting empty inner text blocks an error
textobjects: Make selecting inner empty blocks an error
fixes: vim/vim#13514closes: vim/vim#13523ad4d7f446d
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Keymap completion is not available
Solution: Add keymap completion (Doug Kearns)
Add keymap completion to the 'keymap' option, user commands and builtin
completion functions.
closes: vim/vim#1369281642d9d6f
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Avoid `prevwin == curwin` when closing `curwin`
Problem: When closing the current window (or when moving it to a tabpage), the
previous window may refer to the new current window
(`winnr() == winnr('#')`) if that window is selected as the
new current window.
Solution: Set `prevwin = NULL` when switching away from an invalid `curwin` and
the target window was the `prevwin`.
(Sean Dewar)
related: vim/vim#4537closes: vim/vim#13762bf44b69d1f
Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
Problem: a closing fold expression may unexpectedly start a new fold
when it should end a fold
(reported by Shota Nozaki)
Solution: if a fold hasn't started yet, do not immediately
start a new fold with level 1
(Shota Nozaki)
fixes: vim/vim#12768closes: vim/vim#137480689b87059
Co-authored-by: Shota Nozaki <emonkak@gmail.com>
Problem: cursor wrong after { in single line buffer
(Edwin Chan)
Solution: do not place the cursor at the end for a single
line buffer when moving backwards
(Gary Johnson)
closes: vim/vim#13780closes: vim/vim#137839e6549d2fb
Co-authored-by: Gary Johnson <garyjohn@spocom.com>
Problem: Visual selection isn't drawn with 'breakindent' when the line
doesn't fit in the window (Jaehwang Jung)
Solution: Adjust wlv->fromcol also for 'breakindent' (zeertzjq)
closes: vim/vim#13767closes: vim/vim#1376823627722d3
Problem: no filetype detection for execline scripts
Solution: Add filetype detection for execline
as a prior to adding syntax support for execline (see
https://github.com/djpohly/vim-execline/issues/2), i went ahead and made
the filetype detection for execline scripts.
closes: vim/vim#13689
Signed-Off-By: Mazunki Hoksaas <rolferen@gmail.com>
63210c214a
Co-authored-by: Mazunki Hoksaas <rolferen@gmail.com>