neovim/test/functional
Jaehwang Jung 3159a2c28f
fix(change): update fold after on_bytes (#26364)
Problem:
With vim.treesitter.foldexpr, `o`-ing two lines above a folded region
opens the fold. This does not happen with legacy foldexprs. For example,
make a markdown file with the following text (without indentation),
enable treesitter fold, and follow the instruction in the text.

    put cursor on this line and type zoo<Esc>
    initially folded, revealed by zo
    # then this fold will be opened
    initially folded, revealed by o<Esc>

Analysis:
* `o` updates folds first (done in `changed_lines`), evaluating
  foldexpr, and then invokes `on_bytes` (done in `extmark_splice`).
* Treesitter fold allocates the foldinfo for added lines (`add_range`)
  on `on_bytes`.
* Therefore, when treesitter foldexpr is invoked while running `o`, it
  sees outdated foldinfo.

Solution:
`extmark_splice`, and then `changed_lines`. This seems to be the
standard order in other places, e.g., `nvim_buf_set_lines`.
2023-12-05 08:40:48 +08:00
..
api feat(highlight): update default color scheme 2023-12-02 18:53:19 +02:00
autocmd feat(highlight): update default color scheme 2023-12-02 18:53:19 +02:00
core feat(highlight): update default color scheme 2023-12-02 18:53:19 +02:00
editor fix(extmark): restore extmarks when completing original text 2023-11-29 23:38:27 +01:00
ex_cmds docs: small fixes 2023-10-10 19:20:32 +02:00
fixtures build: remove PVS 2023-11-12 21:26:39 +01:00
legacy vim-patch:9.0.2145: wrong scrolling in insert mode with smoothscroll (#26375) 2023-12-04 06:42:47 +08:00
lua fix(change): update fold after on_bytes (#26364) 2023-12-05 08:40:48 +08:00
options vim-patch:9.0.2035: [security] use-after-free with wildmenu (#25687) 2023-10-17 22:43:42 +08:00
plugin test: skip failing watch file tests on freebsd (#26110) 2023-11-19 18:37:49 +01:00
provider fix(messages): use "Vimscript" instead of "VimL" #24111 2023-06-22 04:09:14 -07:00
shada fix(shada): update marks when using delmarks! (#24978) 2023-09-03 10:34:09 +08:00
terminal feat(highlight): update default color scheme 2023-12-02 18:53:19 +02:00
treesitter fix(treesitter): allow passing lang to vim.treesitter.get_node() now correctly takes opts.lang (#26360) 2023-12-04 10:00:49 +01:00
ui feat(highlight): update default color scheme 2023-12-02 18:53:19 +02:00
vimscript revert: "memory: Free buffers after freeing variables" (#26356) 2023-12-02 09:55:11 +08:00
example_spec.lua
helpers.lua feat(highlight): update default color scheme 2023-12-02 18:53:19 +02:00
preload.lua test: remove unused variable (#21552) 2022-12-29 07:20:42 +08:00