Commit Graph

17724 Commits

Author SHA1 Message Date
zeertzjq 0b2b1b0185
vim-patch:9.1.0340: Problem: Error with matchaddpos() and empty list (#28381)
Problem:  Error with matchaddpos() and empty list
          (@rickhow)
Solution: Return early for an empty list

fixes: vim/vim#14525
closes: vim/vim#14563

f7d31adcc2

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-17 06:49:23 +08:00
zeertzjq 329fc0e5b7
test: API can return Lua function to Lua code (#28380) 2024-04-17 06:34:10 +08:00
zeertzjq f150b62423
fix(lua): only free luarefs when returning from API (#28373) 2024-04-17 05:44:06 +08:00
Theo Fabi 60d1e3e471 fix(msgpack): store grid line event as a value 2024-04-16 16:41:13 -04:00
Luna Saphie Mittelbach 20b38677c2 feat(defaults): use ripgrep (rg) for 'grepprg' if available 2024-04-16 19:21:02 +02:00
zeertzjq 5cfdaaaeac
fix(api): ignore 'autochdir' when renaming other buf (#28376)
Problem:  Renaming non-current buffer changes working directory when
          'autochdir' is set.
Solution: Temporarily disable 'autochdir'.  Add more tests for the
          win_set_buf change.
2024-04-16 20:57:01 +08:00
Raphael 2fc2343728
fix(api): ignore 'autochdir' when setting buf in other win (#28371)
Problem:  Wrong working directory when setting buffer in another window with
          'autochdir' enabled.
Solution: Temporarily disable 'autochdir'.
2024-04-16 19:49:56 +08:00
zeertzjq 7fa24948a9
test: make mapping tests more consistent (#28368)
- Test maparg() and maplist() in the same test.
- Use matches() instead of string.match().
- Avoid overlong lines and strange spacing in exec_lua().
- Revert code change from last PR as the variable may be needed.
2024-04-16 14:05:09 +08:00
zeertzjq 47ba96a6b3
test: getting autocmd Lua callback in Vimscript (#28367)
Also remove unnecessary variable in API converter.
2024-04-16 11:59:55 +08:00
zeertzjq 60fb8a6a8b
fix(messages): avoid crash with :intro and ch=0 (#28343)
This just copies code from msg_start() to wait_return().  Not sure if
there is a better place to put such a block.
2024-04-16 10:38:17 +08:00
zeertzjq e3c083832c
vim-patch:9.1.0335: String interpolation fails for List type (#28364)
Problem:  String interpolation fails for List type
Solution: use implicit string(list) for string interpolation and :put =
          (Yegappan Lakshmanan)

related: vim/vim#14529
closes: vim/vim#14556

bce51d9005

Cherry-pick eval_to_string_eap() from patch 8.2.1914.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-16 10:18:24 +08:00
Gregory Anders 533e01a75b
fix(base64): properly handle embedded NULLs when decoding (#28349) 2024-04-15 11:06:54 -05:00
zeertzjq 4ec8fd43bf
fix(api): make width/height for split by nvim_open_win work (#28341) 2024-04-15 17:55:57 +08:00
zeertzjq 43f8d7e3ef
vim-patch:9.1.0329: String interpolation fails for Dict type (#28335)
Problem:  String interpolation fails for Dict type
Solution: Support Dict data type properly, also support :put =Dict
          (without having to convert it to string() first)
          (Yegappan Lakshmanan)

fixes: vim/vim#14529
closes: vim/vim#14541

f01493c550

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-15 07:11:39 +08:00
Sean Dewar 7180ef6901
feat(api)!: nvim_open_win: noautocmd blocks all autocmds #28192
Problem: noautocmd is confusing; despite its name, it doesn't block all
autocommands (instead it blocks only those related to setting the buffer), and
is commonly used by plugins to open windows while producing minimal
side-effects.

Solution: be consistent and block all autocommands when noautocmd is set.
This includes WinNew (again), plus autocommands from entering the window (if
enter is set) like WinEnter, WinLeave, TabEnter, .etc.

See the discussion at https://github.com/neovim/neovim/pull/14659#issuecomment-2040029517
for more information.

Remove win_set_buf's noautocmd argument, as it's no longer needed.

NOTE: pum_create_float_preview sets noautocmd for win_set_buf, but all its
callers already use block_autocmds.

Despite that, pum_create_float_preview doesn't actually properly handle
autocommands (it has no checks for whether those from win_enter or
nvim_create_buf free the window).

For now, ensure autocommands are blocked within it for correctness (in case it's
ever called outside of a block_autocmds context; the function seems to have been
refactored in #26739 anyway).
2024-04-14 16:10:16 -07:00
zeertzjq 6685481dfa
vim-patch:9.1.0320: Wrong cursor position after using setcellwidths() (#28334)
Problem:  Wrong cursor position after using setcellwidths().
Solution: Invalidate cursor position in addition to redrawing.
          (zeertzjq)

closes: vim/vim#14545

05aacec6ab

Reorder functions in test_utf8.vim to match upstream.
2024-04-15 06:11:30 +08:00
zeertzjq f6a3fdd684
refactor: fix clang NonNullParamChecker warnings (#28327) 2024-04-14 21:48:32 +08:00
zeertzjq 4c31a1b807
fix(tui): make setcellwidths() work for non-ambiwidth chars (#28322) 2024-04-14 09:29:38 +08:00
zeertzjq e81fe387d6 vim-patch:9.1.0313: Crash when using heredoc with comment in command block
Problem:  Crash when using heredoc with comment in command block.
Solution: Handle a newline more like the end of the line, fix coverity
          warning (zeertzjq).

closes: vim/vim#14535

1f5175d9af
2024-04-14 05:06:50 +08:00
zeertzjq 617a385142 vim-patch:9.1.0312: heredocs are not supported for :commands
Problem:  heredocs are not supported for :commands
          (balki)
Solution: Add heredoc support
          (Yegappan Lakshmanan)

fixes: vim/vim#14491
closes: vim/vim#14528

e74cad3321

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-14 05:03:31 +08:00
Raphael 3ea124a8d9
fix(float): improve error message when reconfig failed (#25076)
Problem: The current error message isn't very accurate.
Solution: Improve the error message.
2024-04-13 14:36:17 +08:00
Joey Gouly f064e72b9b
fix(path): check return value of append_path() (#28309)
If the filename passed to vim_FullName() is a relative directory, and
does not exist, it is appended to the current working directory. Since
the return value of append_path() was ignored, and if the buffer length
was too small to fit getcwd() + dirname(filename), it would still try to
append the basename(filename).

This was manifesting as a failure in test/unit/path_spec.lua in:
    itp('fails and uses filename if given filename contains non-existing directory', ..

This failure occurs when running the tests from directory with a short
path such as: /work/src/nv

    test/unit/path_spec.lua:420: Expected objects to be the same.
    Passed in:
    (string) '/work/src/nv/test.file'
    Expected:
    (string) 'non_existing_dir/test.file'

This return value for the second call to append_path() to append
basename(filename) was checked, and this is where it would fail for
normal / longer getcwd()s.
2024-04-13 11:25:55 +08:00
zeertzjq 780509aedf
fix(move): fix using the wrong window (#28312) 2024-04-13 10:32:49 +08:00
zeertzjq 4f3d018d15
vim-patch:9.0.2180: POSIX function name in exarg causes issues (#28308)
Problem:  POSIX function name in exarg struct causes issues
          on OpenVMS
Solution: Rename getline member in exarg struct to ea_getline,
          remove isinf() workaround for VMS

There are compilers that do not treat well POSIX functions - like
getline - usage in the structs.

Older VMS compilers could digest this... but the newer OpenVMS compilers
( like VSI C x86-64 X7.4-843 (GEM 50XB9) ) cannot deal with these
structs. This could be limited to getline() that is defined via
getdelim() and might not affect all POSIX functions in general - but
avoiding POSIX function names usage in the structs is a "safe side"
practice without compromising the functionality or the code readability.

The previous OpenVMS X86 port used a workaround limiting the compiler
capabilities using __CRTL_VER_OVERRIDE=80400000
In order to make the OpenVMS port future proof, this pull request
proposes a possible solution.

closes: vim/vim#13704

6fdb628082

Co-authored-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
2024-04-13 06:39:30 +08:00
zeertzjq 64aa0f7d0b
fix(move): check for filler lines properly (#28307)
vim-patch:9.1.0310: Filler lines not checked properly in get_scroll_overlap()
2024-04-13 06:18:45 +08:00
bfredl 8697f3274b
Merge pull request #26774 from glepnir/24129
fix(float): don't relative float win itself
2024-04-12 14:31:42 +02:00
zeertzjq 7aa56370f3
vim-patch:9.0.2114: overflow detection not accurate when adding digits (#28271)
Problem:  overflow detection not accurate when adding digits
Solution: Use a helper function

Use a helper function to better detect overflows before adding integer
digits to a long or an integer variable respectively. Signal the
overflow to the caller function.

closes: vim/vim#13539

22cbc8a4e1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-11 09:34:43 +08:00
zeertzjq d0afb2dc4e
vim-patch:9.1.0297: Patch 9.1.0296 causes too many issues (#28263)
Problem:  Patch 9.1.0296 causes too many issues
          (Tony Mechelynck, chdiza, CI)
Solution: Back out the change for now

Revert "patch 9.1.0296: regexp: engines do not handle case-folding well"

This reverts commit 7a27c108e0509f3255ebdcb6558e896c223e4d23 it causes
issues with syntax highlighting and breaks the FreeBSD and MacOS CI. It
needs more work.

fixes: vim/vim#14487

c97f4d61cd

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-11 07:40:16 +08:00
zeertzjq f504e799a3
vim-patch:9.1.0301: Vim9: heredoc start may be recognized in string (#28266)
Problem:  Vim9: heredoc start may be recognized in string.
Solution: Don't skip to closing bracket for invalid list assignment.
          (zeertzjq)

closes: vim/vim#14472

1817ccdb10
2024-04-11 07:39:10 +08:00
Jaehwang Jung 889f81c65f
fix(drawline): don't invoke on_line for filler line (#28219)
Problem:
Decoration provider `on_line` handler is invoked for diff filler line
below the last buffer line. This does not match the documentation:
"called for each buffer line".

Solution:
Check `end_fill`.
2024-04-10 20:18:14 +08:00
glepnir 898371fc9f fix(float): don't relative flaot win itself
Problem: when reconfig current float win without win key in nvim_win_set_config will cause float win position changed when move.

Solution: don't relative itself.
2024-04-10 15:10:37 +08:00
zeertzjq 49983387ff
fix(prompt): emit change event for prompt newline (#28260)
Co-authored-by: Ilia Choly <ilia.choly@gmail.com>
2024-04-10 08:50:36 +08:00
zeertzjq f49408454d
vim-patch:9.1.0296: regexp: engines do not handle case-folding well (#28259)
Problem:  Regex engines do not handle case-folding well
Solution: Correctly calculate byte length of characters to skip

When the regexp engine compares two utf-8 codepoints case insensitively
it may match an adjacent character, because it assumes it can step over
as many bytes as the pattern contains.

This however is not necessarily true because of case-folding, a
multi-byte UTF-8 character can be considered equal to some single-byte
value.

Let's consider the pattern 'ſ' and the string 's'. When comparing and
ignoring case, the single character 's' matches, and since it matches
Vim will try to step over the match (by the amount of bytes of the
pattern), assuming that since it matches, the length of both strings is
the same.

However in that case, it should only step over the single byte
value 's' so by 1 byte and try to start matching after it again. So for the
backtracking engine we need to ensure:
- we try to match the correct length for the pattern and the text
- in case of a match, we step over it correctly

The same thing can happen for the NFA engine, when skipping to the next
character to test for a match. We are skipping over the regstart
pointer, however we do not consider the case that because of
case-folding we may need to adjust the number of bytes to skip over. So
this needs to be adjusted in find_match_text() as well.

A related issue turned out, when prog->match_text is actually empty. In
that case we should try to find the next match and skip this condition.

fixes: vim/vim#14294
closes: vim/vim#14433

7a27c108e0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-10 07:08:49 +08:00
zeertzjq efb6640b29
vim-patch:9.1.0287: Vim9: comment may be treated as heredoc start (#28257)
Problem:  Vim9: comment may be treated as heredoc start.
          (Ernie Rael)
Solution: Use skip_var_list() instead of find_name_end().
          (zeertzjq)

fixes: vim/vim#14444
closes: vim/vim#14446

9a91d2b72c
2024-04-10 06:07:29 +08:00
Luuk van Baal d4956e16d9 vim-patch:9.1.0294: Text height function does not respect it's argument
Problem:  plines_m_win() does not take into account it's "limit_winheight"
          argument for filler lines below the last line of the buffer.
          (after v9.1.0280)
Solution: Check window height when "limit_winheight" is TRUE.
          (Luuk van Baal)

08b0f632c1
2024-04-09 23:43:42 +02:00
Luuk van Baal 832857ae09 vim-patch:9.1.0285: Still problems with cursor position for CTRL-D/U
Problem:  Problems with cursor position when scrolling half a page.
Solution: Rework the cursor logic. (Luuk van Baal)

78c51500f1
2024-04-09 21:44:42 +02:00
Sam 168e69ae01
fix(tui): don't set cursor color when there is none (#28236) 2024-04-09 16:05:15 +08:00
zeertzjq c695caa7ee
vim-patch:8.2.4395: some code lines not covered by tests (#28248)
Problem:    Some code lines not covered by tests.
Solution:   Add a few more test cases.  Fix getting more than one error for
            invalid assignment.

8b716f5f22

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-09 11:06:02 +08:00
zeertzjq 869d303043
vim-patch:8.2.0981: Vim9: cannot compile "[var, var] = list" (#28247)
Problem:    Vim9: cannot compile "[var, var] = list".
Solution:   Implement list assignment.

47a519a933

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-09 10:10:47 +08:00
zeertzjq 2528093bbe
vim-patch:9.1.0277: Cannot highlight the Command-line (#28244)
Problem:  Cannot highlight the Command-line
Solution: Add the MsgArea highlighting group
          (Shougo Matsushita)

closes: vim/vim#14327

be2b03c6ee

Cherry-pick Test_highlight_User() from patch 8.2.1077.

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-04-09 07:20:49 +08:00
Luuk van Baal 8f5fd0884b vim-patch:9.1.0280: several issues with 'smoothscroll' support
Problem:  Logic to make sure cursor is in visible part of the screen after
          scrolling the text with 'smoothscroll' is scattered, asymmetric
          and contains bugs.
Solution: Adjust and create helper function for 'smoothscroll' cursor logic.
          (Luuk van Baal)

9148ba8a46
2024-04-09 00:51:06 +02:00
Luuk van Baal e21423bb35 vim-patch:9.1.0260: Problems with "zb" and scrolling to new topline with 'smoothscroll'
Problem: "zb" does not reveal filler lines at the start of a buffer.
          Scrolled cursor position with 'smoothscroll' is unpredictable,
          and may reset skipcol later if it is not visible (after v9.1.258)
Solution: Replace confusing for loop that reaches final control value too
          early with while loop. Set "w_curswant" accordingly so cursor
          will be placed in visible part of topline.
          (Luuk van Baal)

bd28cae1f1
2024-04-08 23:15:43 +02:00
Luuk van Baal e6cfa22c4c vim-patch:9.1.0258: half-page scrolling broke backward compatibility
Problem:  Support for 'smoothscroll' in (half-)page scrolling
          broke backward compatibility and can be made to work better.
          (after v9.1.215)
Solution: Restore the previous cursor and end-of-buffer behavior for
          half-page scrolling and improve 'smoothscroll' support.
          (Luuk van Baal)

cb204e688e
2024-04-08 23:15:43 +02:00
zeertzjq 978962f9a0
build(release.sh): regenerate docs after changing NVIM_API_PRERELEASE (#28229)
After #25574, the value of NVIM_API_PRERELEASE can affect docs, so docs
need to be regenerated after changing NVIM_API_PRERELEASE.
2024-04-08 17:46:41 +08:00
dundargoc 624de849de build: add function add_target
It's a combination of add_custom_target and add_custom_command that does
what most users probably expect should happen.

This also fixes `make clean` removing files tracked by git.
2024-04-08 10:52:53 +02:00
zeertzjq d188b929d4
vim-patch:9.1.0272: autocmd may change cwd after :tcd and :lcd (#28223)
Problem:  Autocommand may change currect directory after :tcd and :lcd.
Solution: Also clear tp_localdir and w_localdir when using aucmd_win.
          (zeertzjq)

closes: vim/vim#14435

9d956ee8ea
2024-04-08 06:25:22 +08:00
zeertzjq d32cbef595
vim-patch:9cd9e759ab1e (#28224)
runtime(doc): Normalise builtin-function optional parameter formatting

These should generally be formatted as func([{arg}]) and referenced as
{arg} in the description.

closes: vim/vim#14438

9cd9e759ab

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-04-08 06:11:31 +08:00
dundargoc 0443f06b71 docs: don't mention executable() can return -1
This cannot happen for neovim.
2024-04-06 12:47:28 +02:00
zeertzjq f4df49a959
revert: "vim-patch:9.1.0055: formatting long lines is slow"
Revert "vim-patch:9.1.0055: formatting long lines is slow (#27199)"

This reverts commit 89a9745a1a.

Fix #28197
2024-04-06 12:04:24 +08:00
zeertzjq ae28ef327e
fix: adjust error message for error in UI event callback (#28200)
Also close Nvim instance before removing log file, otherwise the Nvim
instance will still write to the log file.

Also adjust log level in libuv_process_spawn(). Ref #27660
2024-04-06 11:18:43 +08:00
github-actions[bot] ddbd2b4e40
version.c: update [skip ci] (#28201)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2024-04-06 11:15:08 +08:00
luukvbaal 97122eaa1c
fix(column): ignore empty signcols range (#28177)
Problem:  Invalid assert for empty signcols range. The empty range
          should already be removed from "b_signcols" at this point.
          The "clear" == kTrue call before the splice that made the
          range empty will have removed it, and the "clear" == kNone
          call after the splice already ignores the empty range.
Solution: Return early when "row2" < "row1".
2024-04-06 09:32:07 +08:00
zeertzjq dcf4c5744a vim-patch:9.1.0267: File name entered in GUI dialog is ignored
Problem:  File name entered in GUI dialog is ignored (after v9.1.0265)
Solution: Only set file name to "Untitled" if GUI dialog didn't set it.
          (zeertzjq)

closes: vim/vim#14417

c20bdf1107
2024-04-06 05:58:21 +08:00
zeertzjq 6ecb5d2d0c
vim-patch:9.1.0265: console dialog cannot save unnamed buffers (#28185)
Problem:  console dialog cannot save unnamed buffers
Solution: set bufname before save (glepnir). Define dialog_con_gui
          to test for GUI+Console dialog support, use it to skip
          the test when the GUI feature has been defined.

Note: The dialog_changed() function will also try to call the
browse_save_fname() function, when FEAT_BROWSE is defined (which is only
defined in a GUI build of Vim). This will eventually lead to a call of
do_browse(), which causes an error message if a GUI is not currently
running (see the TODO: in do_browse()) and will then lead to a failure
in Test_goto_buf_with_onfirm().

Therefore, we must disable the Test_goto_buf_with_onfirm(), when the
dialog_con_gui feature is enabled (which basically means dialog feature
for GUI and Console builds, in contrast to the dialog_con and dialog_gui
feature).

(Previously this wasn't a problem, because the test aborted in the YES
case for the :confirm :b XgotoConf case and did therefore not run into
the browse function call)

closes: vim/vim#14398

df46115fc8

Co-authored-by: glepnir <glephunter@gmail.com>
2024-04-05 18:32:04 +08:00
zeertzjq a500c5f808
vim-patch:8.1.0815: dialog for file changed outside of Vim not tested (#28184)
Problem:    Dialog for file changed outside of Vim not tested.
Solution:   Add a test.  Move FileChangedShell test.  Add 'L' flag to
            feedkeys().

5e66b42aae

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-05 18:04:45 +08:00
Famiu Haque 75b80516d5
build: fix link error for `_BitScanForward64` (#28173)
Problem: The usage of `_BitScanForward64` causes linking to fail on some systems.
Solution: Correctly check if it exists using `check_c_source_compiles`.
2024-04-05 09:56:35 +08:00
zeertzjq a469745338
vim-patch:9.1.0259: Normal mode TextChanged isn't tested properly (#28167)
Problem:  Normal mode TextChanged isn't tested properly.
Solution: Combine Test_Changed_ChangedI() and Test_Changed_ChangedI_2()
          and also run it on Windows. Fix a typo in main.c.
          (zeertzjq)

closes: vim/vim#14396

c422662933
2024-04-04 06:11:17 +08:00
Raphael dbc0fa9bd6
fix(stdpath): remove duplicate directories (#26653) 2024-04-03 18:44:57 +08:00
bfredl ab0d3c4098
Merge pull request #28157 from fredizzimo/fsundvik/fix-io
fix: prevent child processes from inheriting ui channel file descriptors
2024-04-03 12:35:57 +02:00
zeertzjq 99b3a068de
vim-patch:8.2.4098: typing "interrupt" at debug prompt may keep exception around (#28161)
Problem:    Typing "interrupt" at debug prompt may keep exception around,
            causing function calls to fail.
Solution:   Discard any exception at the toplevel. (closes vim/vim#9532)

069613c9e8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-03 10:43:03 +08:00
zeertzjq aeabd8e245 vim-patch:9.1.0254: [security]: Heap buffer overflow when calling complete_add() in 'cfu'
Problem:  [security]: Heap buffer overflow when calling complete_add()
          in the first call of 'completefunc'
Solution: Call check_cursor() after calling 'completefunc' (zeertzjq)

closes: vim/vim#14391

0a419e07a7
2024-04-03 05:55:50 +08:00
zeertzjq a941207523 vim-patch:9.0.0581: adding a character for incsearch fails at end of line
Problem:    Adding a character for incsearch fails at end of line.
Solution:   Only check cursor line number.

d4566c14e7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-03 05:55:50 +08:00
Fred Sundvik b400b947f3 fix: prevent child processes from inheriting ui channel file descriptors 2024-04-02 22:15:34 +03:00
dundargoc ffe3002568 test: silence expected errors
This will remove unrelated errors in .nvimlog at the end of test output.
2024-04-02 17:07:44 +02:00
Will Hopkins b3f9da9524
refactor: informative error msg for 'noautocmd' (#28147)
Problem: Attempting to set 'noautocmd' for an existing window throws an error
that just says "Invalid key: 'noautocmd'" which is not very helpful.
Solution: Explain that 'noautocmd' can't be used with existing windows.
2024-04-02 12:48:21 +08:00
zeertzjq 4a6b4b00cb
vim-patch:9.1.0251: Filetype test fails (#28142)
Problem:  Filetype test fails.
Solution: Move detection by name before detection by extension.
          Improve TextChanged test and remove wrong test and fix
          a typo in a comment (zeertzjq).

closes: vim/vim#14373

8eb7523802

The changes to filetype.vim are N/A since Nvim always prefers filename
matches to extension matches.
2024-04-01 21:49:44 +08:00
zeertzjq b8858dddbf
Merge pull request #28080 from echasnovski/intro-buf-change
fix(intro): link showing intro to state at start
2024-04-01 08:02:42 +08:00
zeertzjq b08667d4f0
vim-patch:9.1.0231: Filetype may be undetected when SwapExists sets ft in other buf (#28136)
Problem:  Filetype may be undetected when a SwapExists autocommand sets
          filetype in another buffer.
Solution: Make filetype detection state buffer-specific.  Also fix a
          similar problem for 'modified' (zeertzjq).

closes: vim/vim#14344

5bf6c2117f
2024-04-01 06:12:11 +08:00
zeertzjq e005b8d2eb
vim-patch:9.1.0230: TextChanged autocommand not triggered under some circumstances (#28135)
Problem:  TextChanged autocommand not triggered under some circumstances
          (Sergey Vlasov)
Solution: Trigger TextChanged when TextChangedI has not been triggered

fixes: vim/vim#14332
closes: vim/vim#14339

8603270293

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-01 05:39:52 +08:00
zeertzjq b25753381c
fix(api): set script context when using nvim_set_hl (#28123) 2024-03-31 20:21:47 +08:00
zeertzjq e1ff2c51ca
feat(lua): pass keys before mapping to vim.on_key() callback (#28098)
Keys before mapping (i.e. typed keys) are passed as the second argument.
2024-03-31 11:20:05 +08:00
zeertzjq 12240600f5
Merge pull request #28114 from echasnovski/builtin-hl-grey-gray
fix(highlight): add `Nvim{Light,Dark}Gray{1,2,3,4}` colors
2024-03-30 21:41:08 +08:00
Evgeni Chasnovski 66925f14de
fix(highlight): consistently spell "Goldenrod" 2024-03-30 15:18:35 +02:00
Evgeni Chasnovski 837f268093
fix(highlight): add `Nvim{Light,Dark}Gray{1,2,3,4}` colors 2024-03-30 14:31:46 +02:00
dundargoc 77d3526a3d fix: explain that user should run nvim with -V1 to see more information
It's not obvious for users how to figure out where a mapping is set from
only "Last set from Lua".
2024-03-30 12:32:47 +01:00
zeertzjq 35239e977f
test: use matches(...) instead of ok(string.find(...)) (#28111) 2024-03-30 09:29:21 +08:00
zeertzjq 19d63563e1
fix(extmarks): splice earlier when opening new line (#28108)
Related #26364 #26499 #26501
Fix #28107
2024-03-30 08:05:36 +08:00
zeertzjq 74776dfb2a
fix(terminal): fix duplicate recording with mouse click (#28103) 2024-03-29 22:29:10 +08:00
zeertzjq f29c41d665
test: add a bit more testing for vim.on_key() (#28095)
Also:
- Don't use NUMBUFLEN as buffer length as its unrelated.
- Restore accidentally removed comment from last commit.
2024-03-29 18:37:07 +08:00
zeertzjq fc19ee01ac
vim-patch:9.1.0227: Recording may still be wrong in Select mode (#28092)
Problem:  Recording may still be wrong in Select mode (after 8.2.3993).
Solution: Make sure a character isn't split between two buffer blocks.
          (zeertzjq)

closes: vim/vim#14326

ea95f1a5ad
2024-03-29 17:50:55 +08:00
zeertzjq d223a7cbd2
vim-patch:9.1.0228: Two unrelated things are tested by a single test (#28093)
Problem:  Two unrelated things are tested by a single test.
Solution: Split it into two, restoring the old Test_brace_single_line().
          Add missing cleanup to some tests.
          (zeertzjq)

closes: vim/vim#14323

ad493ef3ea
2024-03-29 17:49:25 +08:00
Evgeni Chasnovski b61575ba70
fix(intro): clear intro if new buffer is shown in focused float 2024-03-29 11:44:49 +02:00
Evgeni Chasnovski 9530a23016
fix(intro): link showing intro to state at start
Problem: Current behavior of stateful intro message is too persistent.
  For example, it is still drawn if new empty buffer is shown in current
  window (either by explicitly setting it or after `tabnew`). Although
  the buffer is empty, the act of it being shown should be made visible.

Solution: Make intro message persist if all is true:
    - Current buffer is the same as it was just after start, i.e. empty
      nameless with initial handle (i.e. 1).
    - Current window is the same as it was just after start, i.e. single
      non-floating with initial handle.
2024-03-29 11:44:49 +02:00
bfredl 2e4e12756a feat(ui): indicate margins for the area used by win_viewport
Problem: using win_viewport for implementing smooth scrolling in an external
UI might run into problems when winbar or borders is used, as there is
no indication that the entire grid is not used for scrolled buffer text.

Solution: add `win_viewport_margins` event.
2024-03-29 08:15:28 +01:00
zeertzjq 4e56f7f0be
test: skip another flaky test on macOS (#28087) 2024-03-29 06:26:01 +08:00
zeertzjq 00b7428b3b
fix(tui): don't use DECRQSS in screen or tmux (#28086)
They behave strangely when receiving that.
2024-03-29 05:55:25 +08:00
zeertzjq dde2cc65fd
Merge pull request #28044 from luukvbaal/vim-9.1.0211
vim-patch:9.1.{0211,0215}
2024-03-28 19:47:40 +08:00
zeertzjq 346a639028
vim-patch:9.1.0220: Few typos in source and test files (#28076)
Problem:  Typos in code and tests.
Solution: Fix typos (zeertzjq).

closes: vim/vim#14321

c029c131ea
2024-03-28 19:03:27 +08:00
Luuk van Baal 2f638c0ac6 vim-patch:9.1.0215: Half-page scrolling does not support smooth-scrolling
Problem:  Page-wise scrolling with Ctrl-D/Ctrl-U implements
          it's own logic to change the topline and cursor.
          More logic than necessary for scrolling with Ctrl-F/Ctrl-B
          was removed in patch 9.1.0211.
Solution: Re-use the logic from Ctrl-E/Ctrl-Y/Ctrl-F/Ctrl-B while
          staying backward compatible as much as possible.
          Restore some of the logic that determined how many lines will
          be scrolled (Luuk van Baal)

5a2e3ec9ac
2024-03-28 11:39:34 +01:00
zeertzjq 08b8ccd733
vim-patch:9.1.0218: Unnecessary multiplications in backspace code (#28075)
Problem:  Unnecessary multiplications in backspace code, as
          "col / ts * ts" is the same as "col - col % ts".
Solution: Change "col / ts * ts" to "col - col % ts".  Adjust the loop
          and the comments ins_bs() to be easier to understand.  Update
          tests to reset 'smarttab' properly.
          (zeertzjq)

closes: vim/vim#14308

8ede7a0694
2024-03-28 18:20:38 +08:00
zeertzjq 6364fc617d
vim-patch:9.1.0217: regexp: verymagic cannot match before/after a mark (#28074)
Problem:  regexp: verymagic cannot match before/after a mark
Solution: Correctly check for the very magic check (Julio B)

Fix regexp parser for \v%>'m and \v%<'m
Currently \v%'m works fine, but it is unable to match before or after
the position of mark m.

closes: vim/vim#14309

46fa3c7e27

Co-authored-by: Julio B <julio.bacel@gmail.com>
2024-03-28 18:15:41 +08:00
zeertzjq b499ccb2fa
vim-patch:9.1.0214: Duplicate condition in win_lbr_chartabsize() (#28072)
Problem:  Duplicate condition in win_lbr_chartabsize().
Solution: Remove the duplicate condition, as it's already checked above.
          (zeertzjq)

closes: vim/vim#14320

5532d3b3f0
2024-03-28 18:00:14 +08:00
zeertzjq 67596c42eb
vim-patch:9.1.0216: Error on exit with EXITFREE and 'winfixbuf' (#28070)
Problem:  Error on exit with EXITFREE and 'winfixbuf'.
Solution: Handle DT_FREE before checking for 'winfixbuf'.
          (zeertzjq)

closes: vim/vim#14314

620e85265c
2024-03-28 17:52:06 +08:00
Luuk van Baal 4147302f4b vim-patch:9.1.0211: page-wise scrolling does not support smooth-scrolling
Problem:  Page-wise scrolling with Ctrl-F/Ctrl-B implements
          it's own logic to change the topline and cursor.
          In doing so, skipcol is not handled properly for
          'smoothscroll', and virtual lines.
Solution: Re-use the logic from Ctrl-E/Ctrl-Y while staying
          backward compatible as much as possible.

b9f5b95b7b
2024-03-28 10:18:09 +01:00
zeertzjq a0cbf1d8d5
fix(plines): cursor position with 'showbreak' and resized grid (#28067) 2024-03-28 14:12:54 +08:00
zeertzjq 981301d11f
build(terminfo): include user capabilities in comments (#28066)
Add -x flag to infocmp, so that comments match the content.
2024-03-28 10:23:07 +08:00
dundargoc a89ce89742
docs: fix typos (#27868)
Co-authored-by: ite-usagi <77563904+ite-usagi@users.noreply.github.com>
Co-authored-by: v-sim <56476039+v-sim@users.noreply.github.com>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Quico Augustijn <quico.public@gmail.com>
Co-authored-by: nhld <nahnera@gmail.com>
Co-authored-by: francisco souza <108725+fsouza@users.noreply.github.com>
2024-03-28 09:32:32 +08:00
zeertzjq 4ee9e58056
feat(tui): query extended underline support using DECRQSS (#28052) 2024-03-28 07:39:36 +08:00
zeertzjq 7168000b53
refactor(options): require `enable_if = false` iff no variable (#28050)
This makes grepping for unsupported options easier.
2024-03-28 06:02:49 +08:00
bfredl c4e1930851
Merge pull request #28025 from luukvbaal/introfloat
fix(intro): still show intro message with floating window
2024-03-27 11:10:13 +01:00