Problem: use-after-free in do_ecmd
Solution: Verify oldwin pointer after reset_VIsual()
e1dc9a6275
N/A patches for version.c:
vim-patch:9.0.1841: style: trailing whitespace in ex_cmds.c
Co-authored-by: Christian Brabandt <cb@256bit.org>
Downloading the necessary files all at once instead of doing dependency
handling with luarocks speeds up installation immensely. We speed up the
process even more by using luv as a replacement for the C modules in the
busted dependencies, which allows us to skip costly compilation times.
Co-authored-by: bfredl <bjorn.linse@gmail.com>
Problem: Wrong cursor position with virtual text before double-width
char at window edge.
Solution: Check for double-width char before adding virtual text size.
closes: vim/vim#12977ac2d8815ae
This fixes the issue where the LspNotify handlers for inlay_hint /
diagnostics would end up refreshing all attached clients.
The handler would call util._refresh, which called
vim.lsp.buf_request, which calls the method on all attached clients.
Now util._refresh takes an optional client_id parameter, which is used
to specify a specific client to update.
This commit also fixes util._refresh's handling of the `only_visible`
flag. Previously if `only_visible` was false, two requests would be made
to the server: one for the visible region, and one for the entire file.
Co-authored-by: Stanislav Asunkin <1353637+stasjok@users.noreply.github.com>
Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
Problem: Wrong cursor position with virtual text before a whitespace
character and 'linebreak'.
Solution: Always set "col_adj" to "size - 1" and apply 'linebreak' after
adding the size of 'breakindent' and 'showbreak'.
closes: vim/vim#129566e55e85f92
N/A patches:
vim-patch:9.0.1826: keytrans() doesn't translate recorded key typed in a GUI
Problem: Rexx files may not be recognised
Solution: Add shebang detection and improve disambiguation of *.cls
files
closes: vim/vim#12951e06afb7860
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Unfortunately the gc=false objects can refer to a dangling tree if the
gc=true tree was freed first. This reuses the same tree object as the
node itself is keeping alive via the uservalue of the node userdata.
(wrapped in a table due to lua 5.1 restrictions)
Problem: `push_tree`, every time its called for the same TSTree with
`do_copy=false` argument, creates a new userdata for it. Each userdata,
when garbage collected, frees the same TSTree C object.
Solution: Add flag to userdata, which indicates, should C object,
which userdata points to, be freed, when userdata is garbage collected.
Some more reasonable defaults for topline:
- if topline was replaced with another line, that now becomes topline
- if line was inserted just before topline, display it. This is more
similar to the previous API behavior.
Problem: 'linebreak' is incorrectly drawn after 'breakindent'.
Solution: Don't include 'breakindent' size when already after it.
closes: vim/vim#12937closes: vim/vim#129401d3e0e8f31
Problem: camel-case spelling has issues with digits
Solution: Improve the camCase spell checking by taking digits
and caps into account
Rewrite the conditions to check for word boundaries by taking into
account the presence of digits and all-caps sequences such as acronyms.
closes: vim/vim#12644closes: vim/vim#12933d08745040b
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Problem: Multiline regex with Visual selection fails when Visual
selection contains virtual text after last char.
Solution: Only include virtual text after last char when getting full
line length.
closes: vim/vim#12908e3daa06be1
Problem: Cursor position still wrong with 'showbreak' and virtual text
after last character or 'listchars' "eol".
Solution: Remove unnecessary w_wcol adjustment in curs_columns(). Also
fix first char of virtual text not shown at the start of a screen
line.
closes: vim/vim#12478closes: vim/vim#12532closes: vim/vim#129046a3897232a
Problem:
'endofline' can be used to detect if a file ends of <EOL>, however
editorconfig can break this.
Solution:
Set 'endofline' during BufWritePre
Fixes: #24869
Problem: Normal mode "gM", "gj", "gk" commands behave incorrectly with
virtual text.
Solution: Use linetabsize() instead of linetabsize_str().
closes: vim/vim#12909d809c0a903
The change in #248240081549 was not a regression, however it was an
incomplete change. Unfortunately some common plugins come to depend on
this exising self-inconsistent behavior. These plugins are going to need
to update for 0.10
nvim_buf_set_lines used to NOT adjust the topline correctly if a buffer
was displayed in just one window. However, if displayed in multiple
windows, it was correctly adjusted for any window not deemed the
current window for the buffer (which could be an arbitrary choice if the
buffer was not already current, as noted in the last rafactor)
This fixes so that all windows have their topline adjusted. The added
tests show this behavior, which should be the reasonable one.
Problem: Now way to show text at the bottom part of floating window
border (a.k.a. "footer").
Solution: Allows `footer` and `footer_pos` config fields similar to
`title` and `title_pos`.
Most of the messy things when changing a non-current buffer is
not about the buffer, it is about windows. In particular, it is about
`curwin`.
When editing a non-current buffer which is displayed in some other
window in the current tabpage, one such window will be "borrowed" as the
curwin. But this means if two or more non-current windows displayed the buffers,
one of them will be treated differenty. this is not desirable.
In particular, with nvim_buf_set_text, cursor _column_ position was only
corrected for one single window. Two new tests are added: the test
with just one non-current window passes, but the one with two didn't.
Two corresponding such tests were also added for nvim_buf_set_lines.
This already worked correctly on master, but make sure this is
well-tested for future refactors.
Also, nvim_create_buf no longer invokes autocmds just because you happened
to use `scratch=true`. No option value was changed, therefore OptionSet
must not be fired.
Problem: wrong cursor position with 'showbreak' and lcs-eol
Solution: Add size of 'showbreak' before when 'listchars' "eol" is used.
Also fix wrong cursor position with wrapping virtual text on
empty line and 'showbreak'.
closes: vim/vim#128911193951beb
Problem: cannot distinguish Forth and Fortran *.f files
Solution: Add Filetype detection Code
Also add *.4th as a Forth filetype
closes: vim/vim#1225119a3bc3add
Don't remove filetype files from Vim patches:
- filetype.vim, script.vim, ft.vim usually contain useful changes
- script.vim and ft.vim don't even have their paths spelled correctly
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem: Problems when setting bin/paste option
Solution: When setting binary/paste, remember that this also affects
depending options, so that :verbose set returns the right
location.
Mention if depending options for 'binary' or 'paste' have been reset
indirectly. Add a test to verify it works.
Also noticed as small bug, that the global option value for expandtab
was not reset when paste option is set, so fix that while at it.
closes: vim/vim#12837closes: vim/vim#12879757593c07a
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: sidescrolloff and scrolloff options work slightly
different than other global-local options
Solution: Make it behave consistent for all global-local options
It was noticed, that sidescrolloff and scrolloff options behave
differently in comparison to other global-local window options like
'listchars'
So make those two behave like other global-local options. Also add some
extra documentation for a few special local-window options.
Add a few tests to make sure all global-local window options behave
similar
closes: vim/vim#12956closes: vim/vim#126434a8eb6e7a9
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Wrong display with wrapping virtual text or unprintable chars,
'showbreak' and 'smoothscroll'.
Solution: Don't skip cells taken by 'showbreak' in screen lines before
"w_skipcol". Combined "n_skip" and "skip_cells".
closes: vim/vim#12597b557f48982
Problem: Using freed memory when 'tagfunc' wipes out buffer that holds
'complete'.
Solution: Make a copy of the option. Make sure cursor position is valid.
0ff01835a4
Cherry-pick a cmdwin change from patch 9.0.0500.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: The cursor line number becomes negative when using :z^ in an empty
buffer. (neovim vim/vim#6557)
Solution: Correct the line number. Also reset the column.
a364cdb648
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Typos in tests; one lua line not covered by test.
Solution: Fix typos. Add test case. (Dominique Pellé, closesvim/vim#9994)
81b573d7e5
Cherry-pick test_menu.vim change from patch 9.0.1453.
N/A patch:
vim-patch:8.2.3045: minor typos
Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
Problem: Autocmd test is a bit flaky on MS-Windows.
Solution: Add a bit more sleeping. (Ken Takata, closesvim/vim#11095)
ae04a6049b
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: On MS-Windows some tests are flaky.
Solution: Add sleeps, disable swapfile, mark test as flaky. (Ken Takata,
closesvim/vim#11082)
0500e87eba
Co-authored-by: K.Takata <kentkt@csc.jp>
Problem: Using separate delete() call instead of writefile() 'D' flag.
Solution: Use the writefile 'D' flag.
3411265a36
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Deleting files in tests is a hassle.
Solution: Use the new 'D' flag of writefile().
e1f3ab73bc
vim-patch:e1f3ab73bc7c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: "for" and "while" not recognized after :vim9cmd and :legacy.
(Emanuele Torre)
Solution: Recognize all the command modifiers. (closesvim/vim#11087)
Add a test to check the list of modifiers.
9132426334
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Using common name in tests leads to flaky tests.
Solution: Rename files and directories to be more specific.
e7cda97b6b
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: When switching window in autocmd the restored cursor position may
be wrong.
Solution: Do not restore the cursor if it was not set. (closesvim/vim#10775)
b03950fafa
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Window title test still fails in some configurations.
Solution: Explicitly set the 'title' option.
1450112eef
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Window title test fails in some configurations.
Solution: Only run the test if the title can be obtained.
a6c09a7c20
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Using setbufvar() may change the window title.
Solution: Do not redraw when creating the autocommand window. (closesvim/vim#9613)
dff97e65eb
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: CTRL-A does not work properly with the cmdline popup menu.
Solution: Fix issues with CTRL-A. Add more tests for the cmdline popup
menu. Remove TermWait() before VeriryScreenDump(). Refactor the
cmdline popup code. (Yegappan Lakshmanan, closesvim/vim#9735)
560dff49c0
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Test_xrestore sometimes fails.
Solution: Mark the test as flayky. Move marking test as flaky to the test
instead of listing them in runtest.
f08b0eb869
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Test for cmdline window and terminal fails on MS-Windows.
Solution: Skip the test on MS-Windows.
0b49648486
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Crash when using a terminal popup window from the cmdline window.
Solution: Instead of checking cmdwin_type call cmdwin_is_active().
(closesvim/vim#8286)
e5b4486c42
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Tests using term_wait() can still be flaky.
Solution: Increase the wait time when rerunning a test. (James McCoy,
closesvim/vim#5899) Halve the initial times to make tests run faster
when there is no rerun.
6a2c5a7dd5
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Some tests fail when the system is slow.
Solution: Make the run number global, use in the test to increase the
waiting time. (closesvim/vim#5841)
3ed9efc2b1
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Autocmd test fails on a slow system.
Solution: Adjust the expectations. (James McCoy, closesvim/vim#5685)
8fb1b47a5e
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Some tests fail when run in the GUI.
Solution: Make sure the window width is enough. In the GUI run terminal Vim
in the terminal, if possible.
3180fe6c6d
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: A couple of tests may fail when features are missing.
Solution: Check for features. (Dominique Pelle, closesvim/vim#5561)
705724e430
Just copy the two 'wincolor' test functions from Vim.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: state() test fails on some Mac systems.
Solution: Increase the wait time. (closesvim/vim#4983)
b7a97ef340
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Test for SafeStateAgain may still fail.
Solution: Send another message to trigger SafeStateAgain.
0f6629a08a
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Test for SafeState and SafeStateAgain may fail.
Solution: Accept more possible responses
513537bfff
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: No tests for SafeState and SafeStateAgain.
Solution: Add tests.
cadbe1b1fb
This test is quite useless. Don't port to Lua.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: No tests for state().
Solution: Add tests. Clean up some feature checks. Make "a" flag work.
c258549032
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Runtime: no support for bicep files
Solution: Add filetype support for bicepparam
closes: vim/vim#127842d0988ef93
Co-authored-by: Scott McKendry <scott.c.mckendry@gmail.com>
Problem: Runtime: Missing QML support
Solution: Add QML support to Vim
closes: vim/vim#12810bedc69f9d6
Co-authored-by: ChaseKnowlden <haroldknowlden@gmail.com>
Problem: Cursor is adjusted in window that did not change in size by
'splitkeep'.
Solution: Only check that cursor position is valid in a window that
has changed in size.
closes: vim/vim#1250916af913eee
Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
Problem: no support for custom cmdline completion
Solution: Add new vimscript functions
Add the following two functions:
- getcmdcompltype() returns custom and customlist functions
- getcompletion() supports both custom and customlist
closes: vim/vim#1222892997dda78
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Problem: crash when passing invalid buffer to undotree()
Solution: Use get_buf_arg() instead of tv_get_buf_from_arg().
closes: vim/vim#12862closes: vim/vim#12830ab9f2ecfd4
Problem: Visual highlight not working with cursor at end of screen line
and 'showbreak'.
Solution: Only update "vcol_prev" when drawing buffer text.
closes: vim/vim#128658fc6a1dae0
Problem: can't move to last non-blank char
Solution: Make g<end> behave like that
Make it possible to move to last non-blank char on a line
We can distinguish between g0 and g^ to move to the very first character
and the first non-blank char.
And while we can move to the last screen char, we cannot go to the last
non-blank screen char.
Since I think g$ is the more widely used and known movement command (and
g<end> is synonymous to it) change the behaviour of g<end> to move to
last non-screen char instead and don't have this be the same command as
the g$ command anymore.
If you want to keep the old behaviour, you can use:
```
nnoremap g<end> g$
```
Add a test to verify the behaviour.
closes: vim/vim#12593b5f6fe9ca2
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Missing test coverage for blockwise Visual highlight with
virtual that starts with a double-width char.
Solution: Add a new virtual text to the test. Some other small fixes.
closes: vim/vim#12835fc3058495d
Problem: Wrong curswant when clicking and the second cell of a
double-width char.
Solution: Don't copy virtcol of the first char to the second one.
closes: vim/vim#128429994160bfe
Problem: reverse() on string doesn't work in compiled function.
Solution: Accept string in argument type check. (Yegappan Lakshmanan,
closesvim/vim#12377)
f9dc278946
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: reverse() does not work for a String.
Solution: Implement reverse() for a String. (Yegappan Lakshmanan,
closesvim/vim#12179)
03ff1c2dde
vim-patch:9.0.1738: Duplicate code to reverse a string
Problem: Duplicate code to reverse a string
Solution: Move reverse_text() to strings.c and remove string_reverse().
closes: vim/vim#128474dd266cb66
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Wrong cursor position when clicking after concealed text
with 'virtualedit'.
Solution: Store virtual columns in ScreenCols[] instead of text
columns, and always use coladvance() when clicking.
This also fixes incorrect curswant when clicking on a TAB, so now
Test_normal_click_on_ctrl_char() asserts the same results as the ones
before patch 9.0.0048.
closes: vim/vim#12808e500ae8e29
Remove the mouse_adjust_click() function.
There is a difference in behavior with the old mouse_adjust_click()
approach: when clicking on the character immediately after concealed
text that is completely hidden, cursor is put on the clicked character
rather than at the start of the concealed text. The new behavior is
better, but it causes unnecessary scrolling in a functional test (which
is an existing issue unrelated to these patches), so adjust the test.
Now fully merged:
vim-patch:9.0.0177: cursor position wrong with 'virtualedit' and mouse click
Problem: cursor position wrong when clicking on an unprintable char
Solution: Don't update prev_ptr when wlv.n_extra is not zero.
closes: vim/vim#12664b25dbb3f9b
Tests only. Code superseded by patch 9.0.1725.
Problem: Cursor in wrong column with mouse click after concealed text.
Solution: Store the text column when drawing text.
b90818867c
Tests only. Code changes moved to the port of patch 9.0.1725.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: blockwise Visual highlight not working with virtual text
Solution: Reset the correct variable at the end of virtual selection and
Check for double-width char inside virtual text.
closes: vim/vim#126066e940d9a1d
Need to remove area_active and use wlv.fromcol and wlv.tocol directly.
Problem: A double-width char in a floating window causes an extra
space to be drawn to the left of its boundary.
Solution: Only reset skipstart at the first column.
Fix#24775