Problem: ml_get_buf_len() does not consider text properties
(zeertzj)
Solution: Store text length excluding text properties length
in addition in the memline
related vim/vim#14123closes: vim/vim#14133a72d1be5a9
--------
Replace ml_line_len with ml_line_textlen to be explicit
that Nvim doesn't currently support Vim's text properties
and Nvim doesn't support lines with "ambiguous" length.
--------
vim-patch:9.1.0153: Text properties corrupted with fo+=aw and backspace
Problem: Text properties corrupted with fo+=aw and backspace
Solution: Allocate line and move text properties
(zeertzjq)
closes: vim/vim#141477ac1145fbe
vim-patch:9.1.0163: Calling STRLEN() to compute ml_line_textlen when not needed
Problem: Calling STRLEN() to compute ml_line_textlen when not needed.
Solution: Use 0 when STRLEN() will be required and call STRLEN() later.
(zeertzjq)
closes: vim/vim#1415582e079df81
Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Problem: patterns after a buffer-local pattern in a comma-separated aupat are
ignored.
Solution: ensure pat refers to the original buffer after each pattern, not the
buflocal_pat buffer, and when printing make sure it's normalized for
each pattern, not just the first.
Also simplify the logic when printing all autocommands for an event, and ensure
headings aren't repeated for each event when printing autocommands.
Problem: typo in change of commit v9.1.0873
(Christ van Willegen)
Solution: Add back the square brackets
(John Marriott)
closes: vim/vim#16340df4b3ca5dc
Co-authored-by: John Marriott <basilisk@internode.on.net>
Problem: too many strlen() calls in fileio.c
Solution: refactor fileio.c and remove calls to STRLEN(),
check for out-of-memory condition in buf_check_timestamp()
(John Marriott)
closes: vim/vim#1630614ede1890f
Full port requires v8.2.0988 to update readdir_core().
Co-authored-by: John Marriott <basilisk@internode.on.net>
Problem: getregionpos() depends on 'linebreak' setting
Solution: Reset linebreak setting temporarily (McAuley Penney)
When a line is wrapped on word boundaries, getregionpos() may report a
different end column for a visual block than the cursor position used to
define the selection.
Update the blockwise calculation in getregionpos() to use the same
wrapping assumptions as visual block mode, so the reported region
matches the selection boundaries.
Add a regression test that forces wrapping and checks that the end
position stays consistent under "setlocal wrap" and "setlocal
linebreak".
closes: vim/vim#190068ea0e7205c
Co-authored-by: McAuley Penney <jacobmpenney@gmail.com>
Problem: At "if(0) do if(0); while(0); else", else should be aligned
with outer if, but is aligned with inner if.
Solution: In function find_match, ignore "if" and "else" inside a
do-while loop, when looking for "if". (Anttoni Erkkilä)
closes: vim/vim#190049d661b057e
Co-authored-by: Anttoni Erkkilä <anttoni.erkkila@protonmail.com>
Problem: Makefile syntax highlighting incorrectly ends function calls
when encountering ')' inside double or single quoted strings,
causing incorrect highlighting for the remainder of the line.
Solution: Add makeDString and makeSString to the contains list for
makeIdent regions. This allows strings to be recognized inside
variable references and function calls.
fixes: vim/vim#18687closes: vim/vim#18818519dc391d8
Co-authored-by: Beleswar Prasad Padhi <beleswarprasad@gmail.com>
Partially revert 2a33b499a3d7f46dc307234847a6562cef6cf1d8, where all
syn match makeIdent are moved before syn region makeIdent to match $()
(reason: see https://github.com/vim/vim/pull/18403#issuecomment-3341161566)
However this results in https://github.com/vim/vim/issues/18890 ,
because lines like
`$(a) =`
will first start a region search beginning with `$(`
but then the whole target including `)` will be matched by
`syn match makeIdent "^ *[^:#= \t]*\s*="me=e-1`
which leaves the region search for the never-found `)` and let the
region matching overflow.
Same for
`$(a) ::`
`$(a) +=`
The solution is to move those greedy target match back, so they take
priority and prevents region match from happening.
fixes: vim/vim#18890closes: vim/vim#18938aded55463a
Co-authored-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
Problem: Comment formatting does not work by default for bpftrace.
Solution: Change default 'formatoptions' similarly as C and many other
languages.
closes: vim/vim#189965e577c7aa8
Co-authored-by: Stanislaw Gruszka <stf_xl@wp.pl>
Problem: tests: "Xm4" test directory may not be deleted
Solution: Use "R" flag with mkdir() call to have the directory
recursively deleted at the end of function Test_m4_format()
(Muraoka Taro)
Test_m4_format in test_filetype.vim creates the "Xm4" directory with the
'D' flag. Then it creates two files in the "Xm4" directory. One of them,
"alocal.m4," was created with the 'D' flag, so it will disappear after
the test is complete. However, the other, "configure.ac," was created
without any flags, so it will remain even after the test is complete.
Because the parent directory "Xm4" was created with the 'D' flag, the
latter "configure.ac" remains and is not empty, so it will not be
deleted.
This forces the directory to be deleted regardless of its contents. As a
result, the two files "alocal.m4" and "configure.ac" created in the
directory are no longer needed, so they have been deleted.
closes: vim/vim#18995de37e7430a
Co-authored-by: Muraoka Taro <koron.kaoriya@gmail.com>
Problem: bpftrace files are not recognized from the hashbang line.
Solution: Add a hashbang check (Stanislaw Gruszka)
closes: vim/vim#18992f2814754c0
Co-authored-by: Stanislaw Gruszka <stf_xl@wp.pl>
Problem: Visual mode not stopped early enough if win_gotoid() goes to
another buffer. (Sergey Vlasov)
Solution: Stop Visual mode before jumping to another buffer. (closesvim/vim#10217)
3aca0916f0
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Background:
Suppose a window has concealed lines, and sets conceallevel>2,
concealcursor="". The concealed lines are displayed if the window is
curwin and the cursor is on the those lines.
Problem:
line('w$', win) switches curwin to win, and then does validate_botline
for curwin. It computes botline assuming the concealed lines displayed,
resulting in a smaller value than the actual botline that the user sees.
Solution:
Evaluate line('w$', win) without switching curwin.
Apply similar changes to other functions that switches curwin.
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Problem: Vim9: ":*" is not recognized as a range.
Solution: Move recognizing "*" into skip_range(). (closesvim/vim#6938)
3bd8de40b4
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Problem: potential buffer overflow in PBYTE macro
Solution: Check returned memline length
closes: vim/vim#13083
the PBYTE macro is used to put byte c at a position lp of the returned
memline. However, in case of unexpected errors ml_get_buf() may return
either "???" or an empty line in which case it is quite likely that we
are causing a buffer overrun.
Therefore, switch the macro PBYTE (which is only used in ops.c anyhow)
to a function, that verifies that we will only try to access within the
given length of the buffer.
Also, since the macro is only used in ops.c, move the definition from
macros.h to ops.c
ffb13674d1
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Text properties wrong after splitting a line.
Solution: Check for text properties after the line. (closesvim/vim#10857)
7d0f7e9524
textprop is N/A.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: :let will soon be disallowed.
Solution: Add v:disallow_let temporarily. Fix tests.
cfcd011fcd
The change to use checkforcmd() is already included in the port of patch
9.0.1505. This commit adds the missing :const check.
N/A patches:
vim-patch:8.2.1397: Vim9: return type of maparg() not adjusted for fourth arg
vim-patch:8.2.1623: Vim9: using :call where it is not needed
vim-patch:8.2.1766: Vim9: Some tests are still using :let
vim-patch:8.2.1788: Vim9: still allows :let for declarations
vim-patch:8.2.1882: Vim9: v:disallow_let is no longer needed
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: debug text misses one line of return statement.
Solution: Add a line when not at a debug instruction. (closesvim/vim#9137)
112bed0cbe
Vim9 test "Test_Debugger_break_at_return()" commented out
to avoid unexpected side-effects even if all other tests pass.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Some instructions not yet tested.
Solution: Disassemble more instructions. Move tests to a new file. Compile
call to s:function().
5cab73f8cc
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: :disass completion does not understand "s:".
Solution: Expand "s:" to a pattern. (closesvim/vim#8780)
47016f5772
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: completion for :disassemble is incomplete.
Solution: Recognize the "debug" and "profile" arguments.
4ee9d8e04d
Vim9 ":disassemble" is N/A.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Completion for :disas sorts local functions first.
Solution: Sort local functions last, like with :delfunc. (Naohiro Ono,
closesvim/vim#8860)
dfe04dbff5
Vim9 ":disassemble" is N/A
but "commented" test code is a hint for future patches.
Co-authored-by: naohiro ono <obcat@icloud.com>
Problem: Script-local function is deleted when used in a funcref.
Solution: Do not consider a function starting with "<SNR>" reference
counted. (closesvim/vim#9916, closesvim/vim#9820)
fb43cfc2c6
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Problem: Local function name cannot shadow a global function name.
Solution: Ignore global functions when checking a script-local or scoped
function name. (closesvim/vim#6926)
0f769815c8
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: error set by win_set_buf may leak if autocommands immediately close the
new window.
Solution: free the error set by win_set_buf. (prefer nvim_open_win's error as
it's more important and will cause 0 to be returned)
Problem: split_disallowed seemingly exists to prevent issues from changing
frames to accomodate a split window, which doesn't apply to floats.
Solution: remove the restriction for nvim_open_win, but only for floats.
(continue to check b_locked_split though)
NOTE: like before, the buffer we check b_locked_split for may not actually be
the target buffer "buf", as the later call to win_set_buf can fail to switch to
"buf" due to autocommands. (among other things)
Maybe we could attempt to close the new window in that case (or switch to a
different buffer if that also fails), but this is safer. (and simpler)
Fixes#36857 (and possibly some spurious E242s I've observed from extui)
Problem:
VimEnter clears foldinfo, so register_cbs is called again after
VimEnter. The duplicate parser callbacks break incremental fold
computation.
Solution:
Check if the callbacks are already registered.
Problem: After :botright copen and closing the quikfix window, the
cursor ends up in the wrong window. The problem is fr_child
always points to the first (leftmost for FR_ROW, topmost for
FR_COL) child frame. When do :vsplit, the new window is
created on the left, and frame_insert() updates the parent's
fr_child to point to this new left window.
Solution: Create a snapshot before open the quickfix window and restore
it when close it (glepnir).
closes: vim/vim#18961b43f9ded7e
Co-authored-by: glepnir <glephunter@gmail.com>
vim-patch:3a113e04d nsis: add Chinese translation to nsis installer
vim-patch:e1ea10a0a CI: Bump actions/cache from 4 to 5
vim-patch:9.0.1144: reading beyond text
vim-patch:9.0.1669: Crash syncing swapfile in new buffer when using sodium crypt
vim-patch:9.1.1977: MS-Windows: missing dependency on optiondefs.h in Make_cyg_ming.mak
vim-patch:9.1.1990: tests: Test_term_gettty() fails when using conpty on Windows
vim-patch:9.1.1997: Missing out-of-memory check in vim9class.c
vim-patch:9.1.1273: Coverity warns about using uninitialized value
vim-patch:8.2.0419: various memory leaks in Vim9 script code
vim-patch:8.2.0881: compiler warning for argument type
vim-patch:8.2.1532: compiler warning for conversion of size_t to long
vim-patch:8.2.1839: Vim9: memory leaks reported in assign test
vim-patch:8.2.2299: Vim9: invalid memory access making error message flaky
vim-patch:8.2.2673: Vim9: script-local funcref can have lower case name
vim-patch:8.2.3132: compiler warns for size_t to colnr_T conversion
vim-patch:8.2.3224: cannot call script-local function after :vim9cmd