Problem: When Vim is launched with a UNC directory, netrw treats it as a
relative path and compose it again.
Solution: This is due to `exists("g:netrw_cygwin")` always being true.
We can directly use `g:netrw_cygwin`.
closes: vim/vim#19015538da34ad3
Co-authored-by: tao <2471314@gmail.com>
Problem: tests: test_virtualedit.vim leaves swapfiles behind
Solution: Close open buffers using :bw! instead of :close!
a8a0ee5004
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Substitute that joins lines drops text properties.
Solution: Move text properties of the last line to the new line.
213bbaf15a
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem:
`on_accept` is a bit cumbersome to customize.
Solution:
* Before: users had to override the entire `on_accept` logic for their changes to be applied.
* Now: users can modify the item and return it to apply the modified changes, or return `nil` to fully customize how the changes are applied.
Problem:
When the popupmenu has no border but includes a scrollbar, the info window
column is misaligned due to a missing column offset.
Solution:
Apply a one-column offset to the info window when the popup menu has no border
and a scrollbar is present.
Problem: not possible to translation position in buffer
Solution: use _() macro to mark the output as translatable
(Emir SARI)
Row/Column indicator separator is currently not customizable. Some
languages have a space after the comma as the usual practice, plus this
would help translators use a custom separator like colons if necessary.
Additionally, after a save, the line and the byte indicator is also
hardcoded, this enables i18n for that as well.
closes: vim/vim#1760881f9815831
Co-authored-by: Emir SARI <emir_sari@icloud.com>
Problem: Changing `src` of already installed plugin currently takes
effect immediately inside `vim.pack.add()` and acts as "delete and
later fresh install". Although more robust, this might lead to
unintentional data loss (since plugin is deleted) if the plugin was
manually modified or the new source is not valid.
Also this introduces unnecessary differentiation between "change
`version`" and "change `src`" of already installed plugin.
Solution: Require an explicit `vim.pack.update()` to change plugin's
source. It is done by conditionally changing `origin` remote of the
Git repo. The effect does not require update confirmation in order to
have new changes fetched from the new `src` right away.
If in the future there are more types of plugins supported (i.e. not
only Git repos), also do extra work (like delete + install) during
`vim.pack.update()`.
vim-patch:8.2.3793: using "g:Func" as a funcref does not work in script context
vim-patch:6ec7d40b7 runtime(getscript): GLVS plugin fails with wget.exe with PowerShell
vim-patch:2387c49f6 translation(zh_CN): Add license disclaimer
vim-patch:9.1.2002: Vim9: heap-use-after-free when when accessing protect class member
vim-patch:9.1.2010: Missing out-of-memory checks in vim9class.c
vim-patch:9.1.2011: crash when unreferencing gtk icon theme
Applicable patches became N/A due to previous ports (a4ea6027) and vim9:
vim-patch:8.2.0335: no completion for :disassemble
vim-patch:8.2.2033: Vim9: :def without argument gives compilation error
vim-patch:8.2.4288: preprocessor indents are inconsistent
vim-patch:8.2.4324: Vim9: script-local function name can start with "_"
vim-patch:8.2.4360: Vim9: allowing use of "s:" leads to inconsistencies
vim-patch:8.2.4957: text properties in a wrong position after a block change
vim-patch:9.0.0166: when using text properties line text length computed twice
vim-patch:9.0.0219: cannot make a funcref with "s:func" in a def function
vim-patch:9.0.1357: using null_object results in an internal error
vim-patch:9.0.1484: Coverity warns for using invalid array index
vim-patch:9.1.0274: MS-Windows: a few compiler warnings
vim-patch:9.1.1339: missing out-of-memory checks for enc_to_utf16()/utf16_to_enc()
vim-patch:9.1.1434: MS-Windows: missing out-of-memory checks in os_win32.c
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>