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>