| Commit message (Collapse) | Author | Age |
|
|
| |
Follow-up to #27358.
|
|
|
|
|
|
|
| |
Problem:
nvim_get_autocmds cannot filter by id.
Solution:
Support it.
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: Combined highlighting was not applied to nvim_eval_statusline(),
and 'statuscolumn' sign segment/numhl highlights.
Solution: Add an additional `groups` element to the return value of
`nvim_eval_statusline()->highlights`. This is an array of stacked
highlight groups (highest priority last). Also resolve combined
highlights for the 'statuscolumn' sign segment/numhl highlights.
Expose/synchronize some drawline.c logic that is now mimicked in
three different places.
|
|\
| |
| | |
fix(wininfo): when freeing windows, free the lowest priority wininfo
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
On master (and also before #31539) closing a window could cause the
used wininfo for a buffer to change. This is due to always removing the
previous NULL wininfo when deleting a window, even if that wininfo had
higher priority than the the deleted window's own wininfo.
Instead delete the wininfo with lowest priority. This retains the memory
saving efect while not affecting the effective value of window options
and so on.
|
| |
| |
| |
| | |
Problem: Metadata may be revised for end mark of a revalidated pair.
Solution: Revise metadata for start mark of a revalidated pair.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem:
The `nvim_notify` API (note: unrelated to `vim.notify()` Lua API) was
not given any real motivation in https://github.com/neovim/neovim/pull/13843
There are, and were, idiomatic and ergonomic alternatives already.
Solution:
Deprecate `nvim_notify`.
|
| | |
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Problem: We want to deprecate `nvim_err_write(ln)()` but there is no
obvious replacement (from Lua). Meanwhile we already have
`nvim_echo()` with an `opts` argument.
Solution: Add `err` argument to `nvim_echo()` that directly maps to
`:echoerr`.
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem:
- `n.spawn()` is misleading because it also connects RPC, it's not just
"spawning" a process.
- It's confusing that `n.spawn()` and `n.spawn_argv()` are separate.
Solution:
- Replace `n.spawn()`/`n.spawn_argv()` with a single function `n.new_session()`.
This name aligns with the existing functions `n.set_session`/`n.get_session`.
- Note: removes direct handling of `prepend_argv`, but I doubt that was
important or intentional. If callers want to control use of `prepend_argv`
then we should add a new flag to `test.session.Opts`.
- Move `keep` to first parameter of `n.new_session()`.
- Add a `merge` flag to `test.session.Opts`
- Mark `_new_argv()` as private. Test should use clear/new_session/spawn_wait
instead.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem:
`nvim__redraw()` doesn't clamp the lines in the `range` parameter before truncating to int. The resulting range may be empty when the original range contained buffer lines and vice versa.
E.g. for a buffer with 4 lines, these are the redrawn lines:
```lua
{ 2, 2 ^ 31 } -> none (should be { 2, 3 })
{ 2, 2 ^ 32 } -> none (should be { 2, 3 })
{ 2 ^ 32 - 1, 2 } -> { 0, 1 } (should be none)
```
Solution:
Clamp `range` values before truncating to int.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem:
`termopen` has long been a superficial wrapper around `jobstart`, and
has no real purpose. Also, `vim.system` and `nvim_open_term` presumably
will replace all features of `jobstart` and `termopen`, so centralizing
the logic will help with that.
Solution:
- Introduce `eval/deprecated.c`, where all deprecated eval funcs will live.
- Introduce "term" flag of `jobstart`.
- Deprecate `termopen`.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When a terminal application running inside the terminal emulator sets
the cursor shape or blink status of the cursor, update the cursor in the
parent terminal to match.
This removes the "virtual cursor" that has been in use by the terminal
emulator since the beginning. The original rationale for using the
virtual cursor was to avoid having to support additional UI methods to
change the cursor color for other (non-TUI) UIs, instead relying on the
TermCursor and TermCursorNC highlight groups.
The TermCursor highlight group is now used in the default 'guicursor'
value, which has a new entry for Terminal mode. However, the
TermCursorNC highlight group is no longer supported: since terminal
windows now use the real cursor, when the window is not focused there is
no cursor displayed in the window at all, so there is nothing to
highlight. Users can still use the StatusLineTermNC highlight group to
differentiate non-focused terminal windows.
BREAKING CHANGE: The TermCursorNC highlight group is no longer supported.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem:
- API functions using `try_start` directly, do not surface the
underlying error message, and instead show generic messages.
- Error-handling code is duplicated in the API impl.
- Failure modes are not tested.
Solution:
- Use `TRY_WRAP`.
- Add tests.
|
|/
|
|
|
|
|
|
|
|
|
| |
Problem:
- API functions using `try_start` directly instead of `TRY_WRAP`, do not
surface the underlying error message, and instead show generic things
like "Failed to set buffer".
- Error handling code is duplicated in the API impl, instead of
delegating to the vim buffer/window handling logic.
Solution:
- Use `TRY_WRAP`.
|
|
|
|
|
|
|
|
| |
Problem:
Since e049c6e4c08a, most statusline-like UI elements can combine
highlight attrs, except for sign/statuscolumn.
Solution:
Implement for sign/statuscolumn.
|
|\
| |
| | |
fix(marks): check gravity at range bounds when deleting text
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Marks that are properly restored by the splice associated with
an undo edit, are unnecessarily pushed to the undo header. This
results in incorrect mark tracking in the "copy_only"
save/restore completion path.
Solution: Avoid pushing left gravity marks at the beginning of the range,
and right gravity marks at the end of the range to the undo
header.
|
|/
|
|
|
|
|
|
| |
Problem: In an autocommand Lua callback whether `args.file` is expanded
depends on whether `expand('<afile>')` has been called.
Solution: Always use the unexpanded file name for `args.file`.
Related to #31306 and vim/vim#16106. This doesn't provide `sfname`, but
at least makes `args.file` have a consistent value.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
- nvim_subscribe, nvim_unsubscribe were deprecated in
aec4938a21a02d279d13a9eb64ef3b7cc592c374 but this wasn't set in the
API metadata.
- The function annotations
```
FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY FUNC_API_DEPRECATED_SINCE(13)
```
cause this test to fail:
```
RUN T3 api metadata functions are compatible with old metadata or have new level: 3.00 ms ERR
test/functional/api/version_spec.lua:135: function vim_subscribe was removed but exists in level 0 which nvim should be compatible with
stack traceback:
test/functional/api/version_spec.lua:135: in function <test/functional/api/version_spec.lua:128>
```
Solution:
- Set the API metadata.
- Rearrange the annotations so that FUNC_API_DEPRECATED_SINCE is 2nd:
```
FUNC_API_SINCE(1) FUNC_API_DEPRECATED_SINCE(13) FUNC_API_REMOTE_ONLY
```
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
`validate_option_value_args()` returns `OK` even if option name is
invalid or if option doesn't have the supported scope, which leads to
Neovim still trying to erroneously get/set the option in those cases,
which can lead to an assertion failure when `option_has_scope()` is
invoked. This issue miraculously doesn't exist in release builds since
the assertion is skipped and `(get/set)_option_value_for` returns if
there is an error set, but that is not the intended location for that
error to be caught.
Solution:
Make `validate_option_value_args()` return `FAIL` if there is an error
set, which causes the API option functions to return early instead of
trying to get/set an invalid option.
|
| |
|
|
|
|
|
|
|
|
| |
Problem: Documentation for "hl_group" in nvim_buf_set_extmark() is
unclear. "hl_group" in nvim_echo() does not accept
highlight group id.
Solution: Move documentation for highlight group name/id to first
mention of hl_group. Update nvim_echo() to accept highlight
group id.
|
|
|
|
|
|
|
|
| |
Problem: Lua callbacks for "msg_show" events with vim.ui_attach() are
executed when it is not safe.
Solution: Disallow non-fast API calls for "msg_show" event callbacks.
Automatically detach callback after excessive errors.
Make sure fast APIs do not modify Nvim state.
|
|
|
|
|
|
|
|
|
|
| |
Before calling "attach" a screen object is just a dummy container for
(row, col) values whose purpose is to be sent as part of the "attach"
function call anyway.
Just create the screen in an attached state directly. Keep the complete
(row, col, options) config together. It is still completely valid to
later detach and re-attach as needed, including to another session.
|
| |
|
| |
|
| |
|
|
|
| |
Use poke_eventloop() to wait for Nvim to finish processing input.
|
|
|
|
|
|
|
|
|
| |
Problem: When using nvim_paste in a mapping during a macro recording,
both the mapping and the paste are recorded, causing the paste
to be performed twice when replaying the macro.
Solution: Only record a paste when it is from RPC.
Unfortunately this means there is no way for a script to make a recorded
paste. A way to enable that can be discussed later if there is need.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this PR, the behavior of nvim_paste is:
- When vim.paste() returns false, return false to the client, but treat
following chunks normally (i.e. rely on the client cancelling the
paste as expected).
- When vim.paste() throws an error, still return true to the client, but
drain the following chunks in the stream without calling vim.paste().
There are two problems with such behavior:
- When vim.paste() errors, the client is still supposed to send the
remaining chunks of the stream, even though they do nothing.
- Having different code paths for two uncommon but similar situations
complicates maintenance.
This PR makes both the cancel case and the error case return false to
the client and drain the remaining chunks of the stream, which, apart
from sharing the same code path, is beneficial whether the client checks
the return value of nvim_paste or not:
- If the client checks the return value, it can avoid sending the
following chunks needlessly after an error.
- If the client doesn't check the return value, chunks following a
cancelled chunk won't be pasted on the server regardless, which leads
to less confusing behavior.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the api_info() output:
:new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val')
...
{'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1}
The `ArrayOf(Integer, 2)` return type didn't break clients when we added
it, which is evidence that clients don't use the `return_type` field,
thus renaming Dictionary => Dict in api_info() is not a breaking change.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the api_info() output:
:new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val')
...
{'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1}
The `ArrayOf(Integer, 2)` return type didn't break clients when we added
it, which is evidence that clients don't use the `return_type` field,
thus renaming Dictionary => Dict in api_info() is not (in practice)
a breaking change.
|
| |
|
|
|
|
|
|
|
| |
- Fixes 'autoindent' being applied during redo.
- Makes redoing a large paste significantly faster.
- Stores pasted text in the register being recorded.
Fix #28561
|
|
|
|
|
|
|
| |
- `alter_slashes` belongs in `testutil.lua`, not `testnvim.lua`.
- `alter_slashes` is an unusual name. Rename it to `fix_slashes`.
- invert its behavior, to emphasize that `/` slashes are the preferred,
pervasive convention, not `\` slashes.
|
|
|
|
|
|
|
|
|
|
| |
Problem:
crash when calling nvim_buf_get_text() with a large negative start_col:
call nvim_buf_get_text(0, 0, -123456789, 0, 0, {})
Solution:
clamp start_col after subtracting it from the line length.
|
|
|
|
|
|
|
|
|
| |
Use the grapheme break algorithm from utf8proc to support grapheme
clusters from recent unicode versions.
Handle variant selector VS16 turning some codepoints into double-width
emoji. This means we need to use ptr2cells rather than char2cells when
possible.
|
| |
|
|\
| |
| | |
fix: assert failure in VimL expression parser
|
| | |
|
|\ \
| | |
| | | |
fix(api): alloc and draw cursor window in nvim__redraw
|
| |/
| |
| |
| |
| |
| | |
Problem: Unable to move cursor to recently opened window.
Solution: Make sure uninitialized window is drawn before trying to move
the cursor to it.
|
|/
|
|
|
|
|
|
| |
Problem: Marks whose position did not change with the action that
invalidated them (right_gravity = false) are not revalidated
upon undo.
Solution: Remove early return when restoring a marks saved position so
that it is still revalidated. Add "move" guards instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Empty dictionaries are converted into typed tables of the form `{ [true]
= 6}` instead of an empty dictionary representation `{}`. This leads to
incorrect table representation, along with failure in JSON encoding of
such tables as currently tables with only string and number type keys
can be encoded.
Solution:
The typed table logic has been removed from `nlua_push_Dictionary`. The
typed table logic is required only for float value conversions which is
already handled in `nlua_push_Float`. So, it is(was) no longer required
here.
Fixes neovim/neovim#29218
|
|
|
|
|
| |
This mostly means replacing `nvim_buf_call` and `nvim_win_call` with
`vim._with`.
|