Commit Graph

4386 Commits

Author SHA1 Message Date
zeertzjq
82d128405a feat(pum): pretend 'mousemoveevent' is set when showing right-click menu 2022-09-04 21:18:23 +08:00
zeertzjq
ceb09701f2 feat(api): add "move" to nvim_input_mouse 2022-09-04 21:18:23 +08:00
zeertzjq
04bd700ac3 feat(tui): support 'mousemoveevent' 2022-09-04 21:18:22 +08:00
zeertzjq
a5fe7940c8 feat(ui-ext): make 'mousemoveevent' a ui_option 2022-09-04 21:18:22 +08:00
zeertzjq
1ef7720567 fix(api)!: correctly deal with number before :tab
Now nvim_parse_cmd and nvim_create_user_command use a "tab" value which
is the same as the number passed before :tab modifier instead of the
number plus 1, and "tab" value is -1 if :tab modifier is not used.
2022-09-02 22:28:57 +08:00
Lewis Russell
2afcdbd63a
feat(Man): port to Lua (#19912)
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-02 15:20:29 +01:00
zeertzjq
689f5d604e feat(api): add support for :horizontal modifier 2022-09-01 20:53:43 +08:00
zeertzjq
db2e5f46f5
fix(lua): make ui_attach()/ui_detach() take effect immediately (#20037) 2022-09-01 16:37:29 +08:00
zeertzjq
0c6b39894f
feat(mapset): support restoring Lua callback (#20024)
vim-patch:9.0.0341: mapset() does not restore <Nop> mapping properly

Problem:    mapset() does not restore <Nop> mapping properly.
Solution:   Use an empty string for <Nop>. (closes vim/vim#11022)
92a3d20682
2022-09-01 06:19:49 +08:00
bfredl
c0050b71e5
Merge pull request #16396 from bfredl/luaevent
feat(lua): vim.ui_attach to get ui events from lua
2022-08-31 22:03:56 +02:00
bfredl
f31db30975 feat(lua): vim.ui_attach to get ui events from lua
Co-authored-by: Famiu Haque <famiuhaque@protonmail.com>
2022-08-31 20:40:17 +02:00
zeertzjq
933c80e8f9
refactor(mappings)!: mapblock_fill_dict() use API Dictionary (#20020)
This introduces the following breaking changes:
- nvim_get_keymap now always returns a LuaRef object as "callback" for a
  Lua mapping regardless of how it is called. The LuaRef object can be
  called from Lua and Vim script, but is lost over RPC.
- maparg() now returns a Funcref instead of a ref number as "callback"
  for a Lua mapping. The Funcref can be called from Lua and Vim script,
  but is lost over RPC.

This may also make nvim_get_keymap faster, but make maparg() slower.
2022-08-31 21:14:14 +08:00
zeertzjq
fa747d004a
fix(api): nvim_set_hl bail out on invalid group name (#20021) 2022-08-31 19:47:10 +08:00
zeertzjq
f4274d0f62
vim-patch:8.2.3102: test for crash fix does not fail without the fix (#20018)
Problem:    Test for crash fix does not fail without the fix.
Solution:   Adjust the test sequence. (closes vim/vim#8506)
3777d6e32b

Cherry-pick CheckUnix from patch 8.2.1432.
2022-08-31 09:41:00 +08:00
Sean Dewar
813476bf72
fix(exceptions): restore did_throw (#20000)
`!did_throw` doesn't exactly imply `!current_exception`, as `did_throw = false`
is sometimes used to defer exception handling for later (without forgetting the
exception). E.g: uncaught exception handling in `do_cmdline()` may be deferred
to a different call (e.g: when `try_level > 0`).

In #7881, `current_exception = NULL` in `do_cmdline()` is used as an analogue of
`did_throw = false`, but also causes the pending exception to be lost, which
also leaks as `discard_exception()` wasn't used.

It may be possible to fix this by saving/restoring `current_exception`, but
handling all of `did_throw`'s edge cases seems messier. Maybe not worth
diverging over.

This fix also uncovers a `man_spec.lua` bug on Windows: exceptions are thrown
due to Windows missing `man`, but they're lost; skip these tests if `man` isn't
executable.
2022-08-30 23:13:52 +01:00
bfredl
6ab2bf6819 fix(highlight): set the window namespace when redrawing statusline 2022-08-30 10:28:11 +02:00
zeertzjq
568737d5b3
feat(tui): recognize sidescroll events (#19992)
Ref https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Other-buttons
This works in xterm and kitty.
CSI < 66 ; x ; y M sequence is for ScrollWheelLeft.
CSI < 67 ; x ; y M sequence is for ScrollWheelRight.
2022-08-30 10:55:00 +08:00
bfredl
8fd66ff5c5 fix(redraw): handle switching to a tabpage with larger p_ch value 2022-08-29 21:58:07 +02:00
Raphael
efacb6e974
fix(lsp): clean the diagnostic cache when buffer delete (#19449)
Co-authored-by: Gregory Anders <greg@gpanders.com>
2022-08-29 19:09:14 +02:00
Mathias Fußenegger
126fe7fbc9
Merge pull request #19916 from mfussenegger/lsp-tcp
Adds TCP support for lsp.
Usage example:

```
vim.lsp.start({ name = 'godot', cmd = vim.lsp.rpc.connect('127.0.0.1', 6008) })
```
2022-08-29 18:26:14 +02:00
zeertzjq
1dcaa75a65
fix(events): triggered WinScrolled when only skipcol changed (#19972)
fix(events): trigger WinScrolled when only skipcol changed

vim-patch:9.0.0304: WinScrolled is not triggered when only skipcol changes

Problem:    WinScrolled is not triggered when only skipcol changes.
Solution:   Add w_last_skipcol and use it. (closes vim/vim#10998)
670ab0334b
2022-08-29 06:16:20 +08:00
zeertzjq
b21980bd60
fix(keywordprg): default to :help if set to empty string (#19983) 2022-08-29 05:58:32 +08:00
Mathias Fussenegger
60ec6e34d5 feat(lsp): add tcp support 2022-08-28 14:07:53 +02:00
bfredl
b04ef7f6b9 fix(treesitter): make it get_captures_at_position 2022-08-26 13:57:31 +02:00
bfredl
030b422d1e feat(treesitter)!: use @foo.bar style highlight groups
This removes the support for defining links via
vim.treesitter.highlighter.hl_map (never documented, but plugins did
anyway), or the uppercase-only `@FooGroup.Bar` to `FooGroup` rule.

The fallback is now strictly `@foo.bar.lang` to `@foo.bar` to `@foo`,
and casing is irrelevant (as it already was outside of treesitter)

For compatibility, define default links to builting syntax groups
as defined by pre-existing color schemes
2022-08-26 13:57:31 +02:00
bfredl
73ee2b35d1 fix(tests): use pending_c_parser when needed 2022-08-25 20:49:27 +02:00
Quentin Rasmont
f57341a4b6 feat(treesitter): upstream node_length() as a node method
Util from the nvim-treesitter project.
2022-08-25 18:01:14 +02:00
Quentin Rasmont
baba43681e feat(treesitter): upstream get_root_for_node() as a node method
Util from the nvim-treesitter project.
2022-08-25 18:01:14 +02:00
Quentin Rasmont
a577fb778a feat(treesitter): upstream get_named_children() as a node method
Util from the nvim-treesitter project.
2022-08-25 18:01:14 +02:00
Quentin Rasmont
6b2d42eb03 feat(treesitter): add ability to retreive a tree/node given a range 2022-08-25 18:01:14 +02:00
Quentin Rasmont
3aba4ba378 feat(treesitter): upstream is_parent()
Util from the nvim-treesitter project.
Renamed is_parent to is_ancestor for clarity.
2022-08-25 18:01:14 +02:00
zeertzjq
4ecea0e001 vim-patch:8.2.0911: crash when opening a buffer for the cmdline window fails
Problem:    Crash when opening a buffer for the cmdline window fails. (Chris
            Barber)
Solution:   Check do_ecmd() succeeds.  Reset got_int if "q" was used at the
            more prompt. (closes vim/vim#6211)
9b7cce28d5

Make code match latest Vim instead.
2022-08-25 21:38:11 +08:00
zeertzjq
274e1122ad
fix(usercmd): also check for whitespace after escaped character (#19942) 2022-08-25 17:57:32 +08:00
Thomas Vigouroux
26ebf67c39
test(treesitter): make internal lang test pending when necessary 2022-08-24 16:59:13 +02:00
Lewis Russell
b1eaa2b9a3
feat(lua): add vim.iconv (#18286)
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-08-24 14:41:31 +01:00
Thomas Vigouroux
9be4bfc5f4
Merge pull request #19496 from vigoux/ts_internal_lang
feat(treesitter): allow customizing language symbol name
2022-08-24 15:36:58 +02:00
zeertzjq
f91b1885dd
feat(eval)!: make Vim functions return inner window width and height (#19743)
In non-multigrid UI the only change is that the returned height now
excludes winbar, and this is compatible with Vim.

In multigrid UI this means the return value of these functions now
reflect the space available for buffer lines in a window.

No change in nvim_win_get_height() and nvim_win_get_width().
2022-08-24 21:02:45 +08:00
zeertzjq
9a100ee169
fix(cmdline): do not trigger completion at wrong time (#19920)
Cherry-picked from Vim patches 8.2.4339, 9.0.0238.
2022-08-24 10:28:32 +08:00
zeertzjq
6cc6e11929
vim-patch:9.0.0206: redraw flags are not named specifically (#19913)
Problem:    Redraw flags are not named specifically.
Solution:   Prefix "UPD_" to the flags, for UPDate_screen().
a4d158b3c8
2022-08-23 22:00:19 +08:00
zeertzjq
ffa1335047 vim-patch:8.2.4726: cannot use expand() to get the script name
Problem:    Cannot use expand() to get the script name.
Solution:   Support expand('<script>'). (closes vim/vim#10121)
6013d0045d

Use `.sn_name` instead of `->sn_name` as v8.2.0154 hasn't been ported.
Cherry-pick builtin.txt expand() doc from latest Vim.
2022-08-23 17:47:46 +08:00
zeertzjq
42e9fe7d95
test: add test for using :normal to stop Visual mode in cmdwin (#19904) 2022-08-23 11:39:25 +08:00
zeertzjq
63df91c10a
vim-patch:8.2.1046: insufficient tests for src/buffer.c (#19903)
Problem:    Insufficient tests for src/buffer.c.
Solution:   Add more tests.  Move comments related tests to a separate file.
            (Yegappan Lakshmanan, closes vim/vim#6325)
b7e2483655
2022-08-23 11:24:46 +08:00
zeertzjq
d5328ea408
vim-patch:8.2.0522: several errors are not tested for (#19901)
Problem:    Several errors are not tested for.
Solution:   Add tests. (Yegappan Lakshmanan, closes vim/vim#5892)
ee4e0c1e9a

Omit Test_range() change: reverted in patch 8.2.0615.
Cherry-pick Test_z_no_space_before_xxx() from patch 8.2.0195.
Cherry-pick Test_reverse_sort_uniq() change from patch 8.2.0183.
Make uniq() error behavior consistent with sort().
Cherry-pick Test_set_ttytype() change from patch 8.1.1826.
Cherry-pick quickfix checks from patch 8.1.2373 to test_preview.vim.
Test_viminfo_error() is applicable.
Cherry-pick E1058 from patch 8.2.0149 and port Test_deep_nest() to Lua.
2022-08-23 10:38:53 +08:00
zeertzjq
2fd25fb909
vim-patch:8.1.0832: confirm() is not tested (#19896)
Problem:    confirm() is not tested.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#3868)
2e05009218
2022-08-23 07:20:23 +08:00
Thomas Vigouroux
3c1d70f20b
feat(treesitter): allow customizing language symbol name 2022-08-22 15:34:10 +02:00
zeertzjq
15a768eeb0
fix(api): avoid side effects with nvim_parse_cmd (#19890)
Save and restore the cursor and last search pattern and do not change
search history.
2022-08-22 18:06:18 +08:00
Axel Forsman
d4d27c41b3
fix(edit.c): indentkeys double indent after "!" #12894
which is both unexpected and different from the Vim behaviour.

Indent was triggered once by the '!' check in insert_execute(), and
inserting the char was correctly skipped, but then triggered again in
insert_check() (provided that cindent was not being ignored after manual
indentation, i.e. `can_cindent == true`).

While this is the smallest fix, another solution would be to remove
VimState#check and instead move that to *_enter()/-_execute(), since the
control flow is pretty unnecessarily convoluted as is. That would also
have the benefit of differing less from the Vim source code.
2022-08-21 21:48:18 -07:00
zeertzjq
06a53ab2cb vim-patch:8.2.4334: command line popup menu not positioned correctly
Problem:    Command line popup menu not positioned correctly.
Solution:   Also use vim_strsize() on the existing text. (Naruhiko Nishino,
            closes vim/vim#9727)
68cc2b8a37
2022-08-22 09:08:47 +08:00
zeertzjq
99bd895956 vim-patch:8.2.4328: command line complete matches cleard when typing character
Problem:    Command line complete matches cleard when typing character.
            (Dominique Pellé)
Solution:   Only remove a popup menu if there is one.
73a16c22a4
2022-08-22 08:55:54 +08:00
zeertzjq
e3eb6967bc
vim-patch:8.2.4325: 'wildmenu' only shows few matches (#19876)
Problem:    'wildmenu' only shows few matches.
Solution:   Add the "pum" option: use a popup menu to show the matches.
            (Yegappan Lakshmanan et al., closes vim/vim#9707)
3908ef5017

Omit p_wmnu check in cmdline_pum_active() as it can cause problems.
Omit vim_strchr() flags as that isn't really better than bitmasks.
Omit key translations and document it in vim_diff.txt.
2022-08-21 21:31:25 +08:00
Javier Lopez
dde90f0ca4
fix(api/command): fargs behavior when no arguments are passed (#19862)
Problem: A command defined with `nargs="?"` returns `fargs={""}` to
a Lua callback when executed with no arguments, which is inconsistent
with how`nargs="*"` behaves.

Solution: Pass `fargs={}` for no argument with `nargs="?"` as well.
2022-08-21 15:19:29 +02:00
zeertzjq
bffaf1e27e
fix(eval): check for v:lua when calling callback (#19855)
This makes callback_call() match call_vim_function() when calling a function.
2022-08-20 15:52:35 +08:00
bfredl
3c545b9c62
Merge pull request #19360 from famiu/feat/multibuffer-inccommand
feat: multibuffer preview support for inccommand
2022-08-19 17:21:18 +02:00
zeertzjq
b7c86e24f7 vim-patch:8.2.0982: insufficient testing for reading/writing files
Problem:    Insufficient testing for reading/writing files.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#6257)
            Add "ui_delay" to test_override() and use it for the CTRL-O test.
b340baed9f

Omit test_override().
Reorder test_writefile.vim to match Vim.
2022-08-19 22:05:26 +08:00
Famiu Haque
c2f7a2a18d feat: multibuffer preview support for inccommand
Allows preview callbacks to modify multiple buffers in order to show the
preview. Previously, if multiple buffers were modified, only the current
buffer would have its state restored. After this change, all buffers
have their state restored after preview.

Closes #19103.
2022-08-19 09:27:52 +06:00
zeertzjq
36f0b508c5
revert: "jobstart(): Fix hang on non-executable cwd #9204" (#19826)
This reverts commit c4c74c3883.

LibUV already gives an error for this, so this isn't needed.
2022-08-18 22:09:50 +08:00
bfredl
700a6fb9d4
Merge pull request #19822 from bfredl/hldef
fix(api): make nvim_set_hl(ns=0, ...) redraw screen properly
2022-08-18 12:16:27 +02:00
bfredl
e29156356b fix(api): make nvim_set_hl(ns=0, ...) redraw screen properly
fixes #18160
2022-08-18 10:57:46 +02:00
bfredl
21b2906c9c fix(winhl): do not crash when unsetting winhl in just opened window
fixes #19823
2022-08-18 09:43:07 +02:00
bfredl
068a998e60 fix(tests): remove irrelevant usage of display-=msgsep
These were just added to avoid churn when changing the default
of 'display'. To simplify message handling logic, we might want
to remove support for printing messages in default_grid later on.
This would allow things like printing error messages safely in the
middle of redraw, or a future graduation of the 'multigrid' feature.
2022-08-17 23:44:49 +02:00
bfredl
d879331b0d feat(ui): allow to set the highlight namespace per window
- reimplement 'winhl' in terms of highlight namespaces
- check for EOF in screen tests (to indicate a likely crash)
2022-08-17 16:20:39 +02:00
Famiu Haque
f5588ee896
feat: allow :wincmd to accept a count (#19815)
Let :wincmd command accept a count like what its documentation suggests.
Previously it could only accept a range, which led to some ambiguity on
which attribute should be used when executing :wincmd using nvim_cmd.

Closes #19662.

Also fix a typo in a related Vim test:

vim-patch:9.0.0223: typo in diffmode test

Problem:    Typo in diffmode test.
Solution:   Fix the typo. (closes vim/vim#10932)
5fd6ab820b
2022-08-17 19:50:40 +08:00
Shougo Matsushita
5977a96b3f vim-patch:9.0.0190: the way 'cmdheight' can be made zero is inconsistent
Problem:    The way 'cmdheight' can be made zero is inconsistent.
Solution:   Only make 'cmdheight' zero when setting it explicitly, not when
            resizing windows. (closes vim/vim#10890)
f797e309ca
2022-08-17 09:34:13 +08:00
zeertzjq
03fddfd928
fix(api): nvim_exec and nvim_cmd restore msg_col when capturing output (#19789)
This matches the code in execute_common(), preventing messages after the
API call from being printed at the wrong column.
2022-08-16 17:30:39 +08:00
zeertzjq
cf3b871fa9
test: use poke_eventloop() instead of sleep(10) where possible (#19794)
Using sleep(10) to wait for typeahead to finish is flaky, especially on
macOS, where legacy/global_spec.lua has failed several times.
2022-08-16 15:21:46 +08:00
zeertzjq
d1464d16d6 fix(source): fix expand('<sfile>') no longer works for Lua 2022-08-16 05:39:44 +08:00
zeertzjq
76b4b1977b vim-patch:8.2.1799: some Normal mode commands not fully tested
Problem:    Some Normal mode commands not fully tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#7073)
d1ad99b654

Cherry-pick test_registers.vim change from patch 8.2.0644.
2022-08-15 20:24:43 +08:00
zeertzjq
55da52963b vim-patch:8.2.5109: mode not updated after CTRL-O CTRL-C in Insert mode
Problem:    Mode not updated after CTRL-O CTRL-C in Insert mode.
Solution:   Set redraw_mode and use it. (closes vim/vim#10581)
7a1d32809b
2022-08-15 17:58:35 +08:00
zeertzjq
93ba821831 vim-patch:8.1.1192: mode is not cleared when leaving Insert mode with mapped Esc
Problem:    Mode is not cleared when leaving Insert mode with mapped Esc.
Solution:   Clear the mode when redraw_cmdline is set. (closes vim/vim#4269)
4c25bd785a
2022-08-15 17:58:35 +08:00
zeertzjq
53b0688ac0 vim-patch:8.1.1189: mode is not cleared when leaving Insert mode
Problem:    Mode is not cleared when leaving Insert mode.
Solution:   Clear the mode when got_int is set. (Ozaki Kiichi, closes vim/vim#4270)
abc7c7fc5a
2022-08-15 17:58:35 +08:00
zeertzjq
b47f313151 fix(getchar): flush screen before doing a blocking wait 2022-08-15 17:58:35 +08:00
zeertzjq
95b8e2c55f vim-patch:partial:8.1.0822: peeking and flushing output slows down execution
Problem:    Peeking and flushing output slows down execution.
Solution:   Do not update the mode message when global_busy is set.  Do not
            flush when only peeking for a character. (Ken Takata)
cb574f4154

Omit inchar() change: it breaks too many tests.

N/A patches for version.c:

vim-patch:8.2.5170: tiny issues

Problem:    Tiny issues.
Solution:   Tiny improvements.
944cc9ceba
2022-08-15 17:58:35 +08:00
zeertzjq
9ab9eb1220 fix(source): make changing 'shellslash' change expand() result 2022-08-15 10:14:53 +08:00
zeertzjq
02a4974418
vim-patch:7.4.1168 (#19645)
Problem:    This doesn't give the right result: eval(string(v:true)). (Nikolay
            Pavlov)
Solution:   Make the string "v:true" instead of "true".
f48aa160fd
2022-08-13 21:31:00 +08:00
bfredl
33f4ba7379 fix(winbar): do not always assume cursor is valid. fixes #19458 2022-08-13 10:45:21 +02:00
zeertzjq
0d9e09bf67
test: make Ex mode exit test test what it wants to test (#19728) 2022-08-12 09:04:08 +08:00
Lewis Russell
a27756cc24
fix(signs): priority of extmark signs (#19718) 2022-08-11 17:26:17 +01:00
Famiu Haque
78658ef383
fix(api): vim.cmd.make crashes when argument count isn't 1 (#19701)
Closes #19696
2022-08-10 18:37:59 +08:00
zeertzjq
3030b4d653
feat(tui): allow grid and host to disagree on ambiguous-width chars (#19686)
Note: This only applies to ambiguous-width characters.
2022-08-09 21:08:46 +08:00
zeertzjq
d31ee6664d
test: increse expect_exit() timeouts (#19680)
A timeout of 100 milliseconds is sometimes still too short for macOS.
Change it to 1000 milliseconds.
2022-08-08 22:04:21 +08:00
zeertzjq
603f7bd253 fix(fillchars): change fallback after setcellwidths() 2022-08-08 20:03:40 +08:00
zeertzjq
18766e742b
fix(folds): fix fold remains when :delete makes buffer empty (#19673) 2022-08-08 06:07:59 +08:00
zeertzjq
629169462a
fix(terminal): skip aucmd_win when checking terminal size (#19668) 2022-08-07 19:43:29 +08:00
zeertzjq
48051ed62c vim-patch:8.2.1281: the "trailing characters" error can be hard to understand
Problem:    The "trailing characters" error can be hard to understand.
Solution:   Add the trailing characters to the message.
2d06bfde29
2022-08-07 14:39:19 +08:00
zeertzjq
d0686540f5 vim-patch:8.2.1280: Ex command error cannot contain an argument
Problem:    Ex command error cannot contain an argument.
Solution:   Add ex_errmsg() and translate earlier.  Use e_trailing_arg where
            possible.
8930caaa1a

Remove duplicate test file 062_tab_pages_spec.lua
2022-08-07 14:38:57 +08:00
Lewis Russell
0fdf59ac9d
fix(api): nvim_cmd handle 0 range (#19655)
Fixes #19608
2022-08-06 13:53:37 +01:00
zeertzjq
a308f53525
fix(api): fix nvim_buf_set_text heap-use-after-free (#19644)
The line returned but ml_get_buf() may be freed by another call to
ml_get_buf(), so it is necessary to make a copy.
2022-08-06 06:22:01 +08:00
zeertzjq
a78606ec53
test(let_spec): increase expect_exit() timeout
Test ":unlet self-referencing node in a List graph #6070" feeds many characters into typeahead, so a timeout of only 100 milliseconds sometimes fails. Change that timeout to 1000 milliseconds.
2022-08-05 08:32:54 +08:00
zeertzjq
0a29267514
fix(completion): remove wrong FUNC_ATTR_NONNULL_ALL (#19627) 2022-08-03 21:50:14 +08:00
ii14
3df8d9b8c5
feat(lua): print source locations of lua callbacks (#19597)
Co-authored-by: ii14 <ii14@users.noreply.github.com>
2022-08-03 13:41:17 +01:00
zeertzjq
c57e133e50
fix(ui): set redraw_cmdline when setting window height (#19630) 2022-08-03 19:25:03 +08:00
bfredl
0806c882cd
Merge pull request #19584 from bfredl/terminal_c_BSL_c_O
implement <c-\><c-o> key for terminal mode
2022-08-02 14:53:20 +02:00
zeertzjq
def0ced4c7
fix(tabpage): check if ROWS_AVAIL changed for resize (#19620)
N/A patches for version.c:

vim-patch:9.0.0135: comment about tabpage line above the wrong code

Problem:    Comment about tabpage line above the wrong code.
Solution:   Move the comment. (closes vim/vim#10836)
0b0ccbbfb0
2022-08-02 20:48:41 +08:00
bfredl
9092540315 feat(terminal): implement <c-\><c-o> for terminal mode
this works similar to <c-o> or <c-\><c-o> in insert mode
2022-08-02 13:54:41 +02:00
zeertzjq
0a049c322f
test: improve mapping tests and docs (#19619) 2022-08-02 11:13:22 +08:00
Mathias Fußenegger
e99de3f12f
fix(lsp): send didOpen if name changes on write (#19583)
`:saveas newName` changes the name of an existing buffer.
Due to the buffer re-use it skips the lsp attach phase and immediately
sends a `didSave` notification to the server.
Servers get confused about this, because they expect a `didOpen`
notification first.

Closes https://github.com/neovim/neovim/issues/18688
2022-08-01 22:32:53 +02:00
zeertzjq
d954e8da62 feat(mapset): support restoring "replace_keycodes" and "desc" 2022-08-01 21:54:18 +08:00
zeertzjq
cabb23ea4d test: fix api/keymap_spec.lua tests 2022-08-01 21:54:18 +08:00
zeertzjq
6963c2bdcd vim-patch:8.2.0815: maparg() does not provide enough information for mapset()
Problem:    maparg() does not provide enough information for mapset().
Solution:   Add "lhsraw" and "lhsrawalt" items.  Drop "simplified"
9c65253fe7

vim-patch:9.0.0127: unused variable

Problem:    Unused variable.
Solution:   Remove the variable. (closes vim/vim#10829)
e95f22f63a
2022-08-01 21:54:18 +08:00
ii14
db6e93c48d
feat(api): add replace_keycodes to nvim_set_keymap (#19598) 2022-08-01 21:35:08 +08:00
Gustavo Sampaio
ece0850b73
fix(session): respect sessionoptions=terminal #19497
fixes #13078

Co-authored-by: Yuta Katayama <8683947+yutkat@users.noreply.github.com>
2022-08-01 05:13:46 -07:00
Munif Tanjim
86110ec933
fix(highlight): add missing 'nocombine' to nvim_get_hl_* apis (#19586) 2022-07-31 13:38:00 +02:00
Shougo
c1652bdcb5
cmdheight=0: fix bugs part2 (#19185) 2022-07-31 13:13:19 +08:00
zeertzjq
0ae94a128f test: rewrite Test_missing_attr() in Lua 2022-07-31 08:51:20 +08:00
zeertzjq
d36d9be8ff
fix(terminal): avoid reading over the end of cell.chars (#19580) 2022-07-30 21:40:30 +08:00
zeertzjq
e59bc078de
fix(screen): check for col instead of vcol when drawing fold (#19572) 2022-07-29 21:47:21 +08:00
zeertzjq
f254fc67a5
vim-patch:9.0.0099: scrollback can be wrong after redrawing the command line (#19562)
Problem:    Scrollback can be wrong after redrawing the command line.
Solution:   Clear unfinished scrollback when redrawing. (closes vim/vim#10807)
46af7bc08d
2022-07-28 20:07:32 +08:00
zeertzjq
f57432af4d
vim-patch:9.0.0090: no error when assigning bool to a string option (#19539)
Problem:    No error when assigning bool to a string option with setwinvar().
Solution:   Give an error (closes vim/vim#10766)
28f84e17b0
2022-07-27 20:59:43 +08:00
zeertzjq
79872f3770
fix(options): properly free string options (#19510) 2022-07-27 07:26:32 +08:00
zeertzjq
fc55f8263c vim-patch:9.0.0086: tabline is not redrawn when entering command line
Problem:    Tabline is not redrawn when entering command line.
Solution:   Set "redraw_tabline". (closes vim/vim#10771)
6791adca53
2022-07-27 06:32:40 +08:00
zeertzjq
9f1dc1466e vim-patch:9.0.0082: cannot interrupt global command from command line
Problem:    Cannot interrupt global command from command line.
Solution:   Reset got_int in another place. (closes vim/vim#10739)
3cfae39b08
2022-07-27 06:19:43 +08:00
zeertzjq
45e2bbae83 vim-patch:9.0.0051: using CTRL-C wih :append may hang Vim
Problem:    Using CTRL-C wih :append may hang Vim.
Solution:   Reset got_int. (closes vim/vim#10729, closes vim/vim#10728)
f754fe6a3d
2022-07-27 06:19:43 +08:00
zeertzjq
147cce29a6
fix(cmdline): trigger CmdlineEnter and ModeChanged earlier (#19474)
Match Vim's ordering in code.
These tests are unrelated to ext_cmdline. Move them out of that block.
2022-07-26 10:21:30 +08:00
zeertzjq
fe159d23fd
vim-patch:9.0.0071: command overlaps with printed text in scrollback (#19505)
Problem:    Command overlaps with printed text in scrollback.
Solution:   Clear until end-of-line and use correct message chunk.
            (closes vim/vim#10765, closes vim/vim#10764)
ecdc82e74e

N/A patches for version.c:

vim-patch:9.0.0070: using utfc_ptr2char_len() when length is negative

Problem:    Using utfc_ptr2char_len() when length is negative.
Solution:   Check value of length. (closes vim/vim#10760)
4dc513a22c
2022-07-26 07:30:33 +08:00
zeertzjq
611b43369e vim-patch:8.2.5155: in diff mode windows may get out of sync
Problem:    In diff mode windows may get out of sync. (Gary Johnson)
Solution:   Avoid that the other window scrolls for 'cursorbind'.
a315ce1f32
2022-07-25 20:30:35 +08:00
zeertzjq
0cc41a61d1 test: improve some input tests 2022-07-25 09:47:28 +08:00
zeertzjq
eb77122823 fix(input): do no reinterpret mouse keys with ALT modifiers
Remove check for MOD_MASK_META as it is for <T- which never appears in TUI.
Make small changes to docs.
2022-07-25 09:47:28 +08:00
notomo
46e3e1c728
fix(api): make nvim_cmd mods.silent work correctly (#19489) 2022-07-25 09:43:39 +08:00
zeertzjq
ea13dce3bf
fix(mouse): fix using uninitialized memory with K_MOUSEMOVE (#19480)
Fix a mistake in the porting of Vim patch 8.0.1309.
2022-07-24 09:29:28 +08:00
zeertzjq
bb7853a62d
test(mksession_spec): use %bwipeout! instead of qall! to close terminal (#19465)
Avoid expect_exit, session will be closed when a new one is spawned.
2022-07-22 12:59:34 +08:00
zeertzjq
8af3d641da
fix(grid): don't use utfc_ptr2char_len() when printing until NUL (#19456) 2022-07-22 06:41:51 +08:00
zeertzjq
c15e9d3746
fix(mark): give correct error message when mark is in another buffer (#19454) 2022-07-21 17:42:17 +08:00
bfredl
598cbcae4a
Merge pull request #19445 from famiu/fix/local_winbar_tabs
fix: local winbar with tabs
2022-07-20 16:57:38 +02:00
Famiu Haque
9879fd5d08 fix: local winbar with tabs
Closes #19396
2022-07-20 20:32:22 +06:00
Lewis Russell
559ef3e903
feat(lua): allow vim.cmd to be indexed (#19238) 2022-07-20 12:29:24 +01:00
zeertzjq
72dfd57e5f test: deal with RPC call causing Nvim to exit later 2022-07-19 19:41:07 +08:00
zeertzjq
366e90cdc8 test: avoid timing-sensitive undo message 2022-07-19 19:41:07 +08:00
bfredl
101fd04ee2
Merge pull request #19409 from bfredl/uiunpack
perf(ui): some ui_client fixes/optimizations before externalized TUI
2022-07-19 13:08:11 +02:00
zeertzjq
7b835ba796
vim-patch:8.2.1147 (#19425)
vim-patch:8.2.1147: :confirm may happen in cooked mode

Problem:    :confirm may happen in cooked mode. (Jason Franklin)
Solution:   Switch to raw mode before prompting. (Brandon Pfeifer)
27321dbeed

Code is N/A, but this improves tests. Port the improved tests to Lua.
2022-07-19 13:00:22 +08:00
JP
1a655b71a8
fix(lua): make it possible to cancel vim.wait() with Ctrl-C (#19217) 2022-07-19 09:11:13 +08:00
Munif Tanjim
a80d447b47
fix(mouse): click on global statusline with splits (#19390) 2022-07-19 06:35:04 +08:00
Enan Ajmain
3340728c72
fix(powershell): filter ":!" commands with args #19268
Problem:
Since 0b9664f524 powershell filtered
:[range]! commands with args causes error:
"Start-Process: A positional parameter cannot be found that accepts argument ..."

Solution:
Pass args to Start-Process via `-ArgumentList`.
closes #19250
2022-07-18 13:26:09 -07:00
bfredl
be3d2f5125 perf(ui): avoid ui_flush() work in headless mode 2022-07-18 14:08:44 +02:00
bfredl
45bee1dafd perf(ui): eliminate spurious memory allocations for hl_attr_define event 2022-07-18 14:08:44 +02:00
Enan Ajmain
1b462705d0
fix(windows):exepath, stdpath return wrong slashes #19111
exepath and stdpath should respect shellslash and return path with
proper file separator.
Closes #13787
2022-07-17 17:00:08 -07:00
ii14
13abe20b5f
refactor(lsp): use autocmd api (#19407)
* refactor(lsp): use autocmd api

* refactor(lsp): inline BufWritePost and VimLeavePre callbacks
2022-07-17 19:13:33 +02:00
matveyt
eb9b93b5e0
feat(defaults): mouse=nvi #19290
Problem:
Since right-click can now show a popup menu, we can provide messaging to
guide users who expect 'mouse' to be disabled by default. So 'mouse' can
now be enabled by default.

Solution:
Do it.
Closes #15521
2022-07-17 04:14:04 -07:00
zeertzjq
9f837a5dcf
fix(api): fix nvim_parse_cmd interfere with printing line in Ex mode (#19400) 2022-07-17 09:59:32 +08:00
James McCoy
08a50f6690
Merge pull request #19395 from jamessan/flaky-job-test
test(job_spec): accept alternate messages for "append environment" tests
2022-07-16 21:24:06 -04:00
James McCoy
bcb5b7b3f6
test(job_spec): accept alternate messages for "append environment" tests
These tests commonly fail in Debian with

    [  ERROR   ] test/functional/core/job_spec.lua @ 81: jobs append environment with pty #env
    test/functional/helpers.lua:198:
    ==============================================================================
    test/helpers.lua:73: Expected objects to be the same.
    Passed in:
    (table: 0x2aa4bcc1040) {
     *[1] = {
        [1] = 'notification'
        [2] = 'stdout'
       *[3] = {
          [1] = 0
         *[2] = {
            [1] = 'hello world abc' } } } }
    Expected:
    (table: 0x2aa4bcc0d70) {
     *[1] = {
        [1] = 'notification'
        [2] = 'stdout'
       *[3] = {
          [1] = 0
         *[2] = {
            [1] = 'hello world abc'
           *[2] = '' } } } }

Since the test is validating the "hello world abc" message, not the
newlines, accept either set of message sequences.
2022-07-16 14:08:27 -04:00
zeertzjq
0cfd4fa8f3 vim-patch:8.2.2643: various code not covered by tests
Problem:    Various code not covered by tests.
Solution:   Add a few more test. (Yegappan Lakshmanan, closes vim/vim#7995)
1f448d906b

Cherry-pick some test_edit.vim changes from patches 8.2.{1022,1432}.
Reorder test_undo.vim to match upstream.
2022-07-16 22:46:54 +08:00
zeertzjq
780edfc0eb vim-patch:8.2.2608: character input not fully tested
Problem:    Character input not fully tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#7963)
f4fcedc59d

Cherry-pick related changes from patches 8.2.{0433,0866}.
2022-07-16 21:55:27 +08:00
zeertzjq
bc73795a58 vim-patch:8.2.0198: no tests for y/n prompt
Problem:    No tests for y/n prompt.
Solution:   Add tests. (Dominique Pelle, closes vim/vim#5564)
43c60eda2a
2022-07-16 21:32:25 +08:00
zeertzjq
f7c6676199 vim-patch:8.2.0052: more-prompt not properly tested
Problem:    More-prompt not properly tested.
Solution:   Add a test case. (Dominique Pelle, closes vim/vim#5404)
c6d539b671
2022-07-16 21:32:25 +08:00
zeertzjq
711a6a9157
fix(ex_cmds): correct flags for :const (#19387) 2022-07-16 14:54:31 +08:00
zeertzjq
73526abbbd
fix(api): do not switch win/buf if getting option in current win/buf (#19383) 2022-07-16 09:31:05 +08:00
zeertzjq
33da7d83e8
fix(pum): make right drag in anchor grid to select work in multigrid UI (#19382) 2022-07-16 08:26:40 +08:00
Natasha England-Elbro
86f0da922f
fix: remote UI may get invalid 'pumblend' value #19379
fixes: https://github.com/neovim/neovim/issues/19340
2022-07-15 10:42:01 -07:00
Famiu Haque
6645f59832
fix: right-click in clickable statusline #19252
Problem:
1. Right-click does not work in statusline unless you left-click first (to focus
   the statusline).
2. Modifier (e.g. shift+rightclick) does not work in statusline.

Solution:
Make clickable statusline sections receive right-clicks regardless of whether
the statusline is focused.

Closes #18994
2022-07-15 09:15:02 -07:00
zeertzjq
827906136d test: improve searchhl tests 2022-07-15 19:38:13 +08:00