Add new "splice" interface for tracking buffer changes at the byte
level. This will later be reused for byte-resolution buffer updates.
(Implementation has been started, but using undocumented "_on_bytes"
option now as interface hasn't been finalized).
Use this interface to improve many edge cases of extmark adjustment.
Changed tests indicate previously incorrect behavior. Adding tests for
more edge cases will be follow-up work (overlaps on_bytes tests)
Don't consider creation/deletion of marks an undoable event by itself.
This behavior was never documented, and imposes complexity for little gain.
Add nvim__buf_add_decoration temporary API for direct access to the new
implementation. This should be refactored into a proper API for
decorations, probably involving a huge dict.
fixes#11598
Problem: When Normal highlight group defines ctermfg/bg, but other
highlight group lacks ctermfg/bg, nvim_get_hl_by_id(hl_id,
v:false) returns -1 for the missing ctermfg/bg instead of just
omitting it.
Solution: checking for -1 in hlattrs2dict()
fix#11680
- We already find ourselves renaming nvim_execute_lua in tests and
scripts, which suggests "exec" is the verb we actually want.
- Add "exec" verb to `:help dev-api`.
This covers all "small" inserts and deletes in insert mode, as well
as a few more cases like small normal mode deletes
vim-patch:8.1.0678: text properties as not adjusted for inserted text
It is perfectly fine and expected to detach from the screen just by
the UI disconnecting from nvim or exiting nvim. Just keep detach() in
screen_basic_spec, to get some coverage of the detach method itself.
This avoids hang on failure in many situations (though one could argue
that detach() should be "fast", or at least "as fast as resize",
which works in press-return already).
Never use detach() just to change the size of the screen, try_resize()
method exists for that specifically.
Before this, --embed UIs (without --headless) would not trigger UIEnter.
For TUI, maybe UIEnter isn't useful, but:
- It is less "surprising"/special.
- Makes documentation simpler.
- When TUI becomes a coprocess, it will happen anyway.
- Rename `meth_pcall`.
- Make `pcall_err` raise an error if the function does not fail.
- Add `vim.pesc()` to treat a string as literal where a Lua pattern is
expected.
- Always load files when cleaning up jumplist.
- For Shada: avoids writing duplicate entries, which happens when you read
from a shada file with duplicate entries (merging the jumplist while
writing sometimes produces duplicate entries, bug?) and then write right
away (i.e.: without any `:jumps`, `getjumplist()`, or any jump movement,
that is: nothing that calls `cleanup_jumplist` with `loadfiles == true`).
- For Context: avoids non-idempotent behavior for the same reason (i.e.:
first call to `shada_encode_jumps` does not remove duplicate entries).
- Do not set pcmark when dumping jumplist for Context.
- Retrieving current Context shouldn't add an entry to the jumplist
(which will be removed by a subsequent `cleanup_jumplist` anyway, i.e.:
tail entry matching current position), just act like `getjumplist` for
instance.
luassert uses 3 by default, which is often not enough.
Instead of documenting how to increase it, let's use a more fitting
(sane) default of 100 levels.
NB: the `!(flags & SOPT_GLOBAL)` exception is for 'statusline'.
Because `:set statusline=...` sets the global value for _all_ windows,
`:setlocal` is the best we can do there. This is a one-of-a-kind option
that doesn't work like any other option.
- All "chunks" in a paste-stream should form a single undo-block. Side
effect of 7a85792884 was to create an undo-block for each chunk.
- Also: remove old :redraw force logic, irrelevant after 7a85792884.