aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/buffer_updates_spec.lua
Commit message (Collapse)AuthorAge
* fix(tests): needing two calls to setup a screen is cringebfredl2024-11-14
| | | | | | | | | | 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.
* test: support upvalues in exec_luaLewis Russell2024-09-21
|
* test: allow exec_lua to handle functionsLewis Russell2024-08-02
| | | | | | | | | | | Problem: Tests have lots of exec_lua calls which input blocks of code provided as unformatted strings. Solution: Teach exec_lua how to handle functions.
* test: add a test for #29119zeertzjq2024-06-02
|
* test: improve test conventionsdundargoc2024-04-23
| | | | | | | | | Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004.
* refactor(test): inject after_each differentlyLewis Russell2024-04-10
|
* fix(prompt): emit change event for prompt newline (#28260)zeertzjq2024-04-10
| | | Co-authored-by: Ilia Choly <ilia.choly@gmail.com>
* test: improve test conventionsdundargoc2024-04-08
| | | | Work on https://github.com/neovim/neovim/issues/27004.
* fix(extmarks): splice earlier when opening new line (#28108)zeertzjq2024-03-30
| | | | Related #26364 #26499 #26501 Fix #28107
* vim-patch:8.2.4944: text properties are wrong after "cc" (#27821)zeertzjq2024-03-12
| | | | | | | | | Problem: Text properties are wrong after "cc". (Axel Forsman) Solution: Pass the deleted byte count to inserted_bytes(). (closes vim/vim#10412, closes vim/vim#7737, closes vim/vim#5763) https://github.com/vim/vim/commit/d0b1a09f44654bb5e29b09de1311845200f17d90 Co-authored-by: LemonBoy <thatlemon@gmail.com>
* test: correct order of arguments to eq() (#27816)zeertzjq2024-03-11
|
* Merge pull request #26734 from bfredl/splitaroobfredl2024-01-13
|\ | | | | fix(buffer_updates): correct buffer updates when splitting empty line
| * fix(buffer_updates): correct buffer updates when splitting empty linebfredl2024-01-13
| | | | | | | | fixes #11591
* | test: rename (meths, funcs) -> (api, fn)Lewis Russell2024-01-12
| |
* | test: typing for helpers.methsLewis Russell2024-01-12
| |
* | test: use vim.mpack and vim.uv directlyLewis Russell2024-01-12
|/
* refactor: format test/*Justin M. Keyes2024-01-03
|
* fix(change): update fold after on_bytes (#26364)Jaehwang Jung2023-12-05
| | | | | | | | | | | | | | | | | | | | | | | | 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`.
* fix: invoke changed_bytes when rewriting <Tab> char #25125Ilia Choly2023-09-15
| | | | | | | When tabstop and shiftwidth are not equal, tabs are inserted as individual spaces and then rewritten as tab characters in a second pass. That second pass did not call changed_bytes which resulted in events being omitted. Fixes #25092
* fix(spell): splice extmarks on :spellrepall (#23929)zeertzjq2023-06-06
|
* test: don't unnecessarily specify win/buf for `nvim_(get|set)_option_value`Famiu Haque2023-05-22
| | | | `nvim_(get|set)_option_value` pick the current buffer / window by default for buffer-local/window-local (but not global-local) options. So specifying `buf = 0` or `win = 0` in opts is unnecessary for those options. This PR removes those to reduce code clutter.
* refactor(options): deprecate nvim[_buf|_win]_[gs]et_optionLewis Russell2023-05-21
| | | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: famiu <famiuhaque@protonmail.com>
* test: replace lfs with luv and vim.fsdundargoc2023-04-04
| | | | | | test: replace lfs with luv luv already pretty much does everything lfs does, so this duplication of dependencies isn't needed.
* fix(diff): trigger on_bytes only once after diffget/diffputJaehwang Jung2023-03-11
| | | | | | | Problem: The fix from b50ee4a8dc4306e4be78ac33fb74b21dc6be5538 may adjust extmark twice, triggering on_bytes callback twice. Solution: Don't let mark_adjust adjust extmark.
* fix(buffer_updates): save and restore current window cursor (#16732)zeertzjq2023-03-09
| | | | | | | | When a buffer update callback is called, textlock is active so buffer text cannot be changed, but cursor can still be moved. This can cause problems when the buffer update is in the middle of an operator, like the one mentioned in #16729. The solution is to save cursor position and restore it afterwards, like how cursor is saved and restored when evaluating an <expr> mapping.
* docs: fix typos (#20394)dundargoc2022-09-30
| | | | | Co-authored-by: Raphael <glephunter@gmail.com> Co-authored-by: smjonas <jonas.strittmatter@gmx.de> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix!: make :undo! notify buffer update callbacks (#20344)zeertzjq2022-09-26
| | | | | | | | | When :undo! was introduced to Nvim the implementation of 'inccommand' preview callback hasn't been fully decided yet, so not notifying buffer update callbacks made sense for 'inccommand' preview callback in case it needs to undo the changes itself. Now it turns out that the undo-and-forget is done automatically for 'inccommand', so it doesn't make sense for :undo! to avoid notifying buffer update callbacks anymore.
* Merge pull request #18931 from zeertzjq/regexp-num-escapedzeertzjq2022-06-13
|\ | | | | fix(substitute): subtract number of backslashes later
| * fix(substitute): subtract number of backslashes laterzeertzjq2022-06-12
| |
* | fix(buffer): disable buffer-updates before removing from window #18933zeertzjq2022-06-12
|/ | | | | | | | There can be other places that access window buffer info (e.g. `tabpagebuflist()`), so checking `w_closing` in `win_findbuf()` doesn't solve the crash in all cases, and may also cause Nvim's behavior to diverge from Vim. Fix #14998
* fix(extmarks): splice extmarks on accepting spellTony Chen2022-04-02
|
* fix(buffer_updates): handle :sort of already sorted bufferBjörn Linse2021-10-08
|
* fix(buffer_updates): cleanup test behaviorBjörn Linse2021-10-07
|
* fix(buffer_updates): make `lockmarks` not affect extmarks and buffer ↵Anton Adamansky2021-10-07
| | | | | | updates. fixes #12861 Now mark_adjust() will trigger appropriate buf_updates_send_splice() called by extmark_adjust()
* fix(buffer_updates): handle :delete of the very last line in bufferBjörn Linse2021-10-07
|
* fix(extmarks): splice extmarks on nv_Undo #15920Tony Chen2021-10-06
|
* fix(bufupdates): send correct updates for visual pasteThomas Vigouroux2021-08-25
| | | | | | One step further towards stable tree-sitter. Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
* Manually zero out deleted_bytes2 when substituting and joining lineschentau2021-06-29
|
* add tests in buffer_updatesjbyuki2021-06-09
|
* fix(bufupdate): send events when inserting with virtualeditThomas Vigouroux2021-05-18
| | | | | Problem first raised https://github.com/nvim-treesitter/nvim-treesitter/issues/1304
* make get_region_bytecount end-exclusivechentau2021-05-09
|
* refactor nvim_buf_set_lines to use extmark_splicechentau2021-05-09
|
* splice extmarks on every line for block visual pastechentau2021-05-06
|
* Merge pull request #14385 from chentau/extmark_deleteBjörn Linse2021-04-17
|\ | | | | Extmarks: remove `curbuf->deleted_bytes2` from `op_delete`
| * extmarks: remove curbuf->deleted_bytes2 from op_deletechentau2021-04-16
| |
* | flush curbuf->deleted_bytes2 after calling do_movechentau2021-04-14
|/
* Merge pull request #14318 from chentau/extmark_luadoBjörn Linse2021-04-13
|\ | | | | extmark: splice extmarks on :luado
| * extmark: splice extmarks on :luadochentau2021-04-12
| |
* | Merge pull request #14317 from chentau/extmark_subBjörn Linse2021-04-10
|\ \ | | | | | | extmark: correct extmark_splice call with substitute and inccommand when replacing with escaped backslashes
| * | extmark: correct extmark_splice call with inccommandchentau2021-04-09
| |/