Commit Graph
56 Commits
Author SHA1 Message Date
Tony Chen ea71c26ec9 fix(extmarks): splice extmarks on accepting spell 2022-04-02 12:35:33 -04:00
Björn Linse ef687d3218 fix(buffer_updates): handle :sort of already sorted buffer 2021-10-08 16:15:35 +02:00
Björn Linse 54b2c6800e fix(buffer_updates): cleanup test behavior 2021-10-07 20:22:10 +02:00
Anton Adamansky 7d171b1c48 fix(buffer_updates): make lockmarks not affect extmarks and buffer updates. fixes #12861
Now mark_adjust() will trigger appropriate buf_updates_send_splice() called by extmark_adjust()
2021-10-07 20:21:23 +02:00
Björn Linse 8335e26b2d fix(buffer_updates): handle :delete of the very last line in buffer 2021-10-07 19:35:49 +02:00
Tony Chen e06936125a fix(extmarks): splice extmarks on nv_Undo #15920 2021-10-06 09:35:44 -07:00
Thomas VigourouxandBjörn Linse 14231463a4 fix(bufupdates): send correct updates for visual paste
One step further towards stable tree-sitter.

Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
2021-08-25 15:11:39 +02:00
chentau 1c962401a1 Manually zero out deleted_bytes2 when substituting and joining lines 2021-06-29 00:48:24 -07:00
jbyuki a15c2cbab6 add tests in buffer_updates 2021-06-09 12:20:13 -07:00
Thomas Vigouroux 237175cf20 fix(bufupdate): send events when inserting with virtualedit
Problem first raised
https://github.com/nvim-treesitter/nvim-treesitter/issues/1304
2021-05-18 19:31:56 +02:00
chentau 13a9bd006f make get_region_bytecount end-exclusive 2021-05-09 16:23:01 -07:00
chentau a847abc21b refactor nvim_buf_set_lines to use extmark_splice 2021-05-09 16:22:20 -07:00
chentau 37c8067226 splice extmarks on every line for block visual paste 2021-05-06 20:40:26 -07:00
Björn Linse 63b64ebab0 Merge pull request #14385 from chentau/extmark_delete
Extmarks: remove `curbuf->deleted_bytes2` from `op_delete`
2021-04-17 09:25:44 +02:00
chentau e32eaf6538 extmarks: remove curbuf->deleted_bytes2 from op_delete 2021-04-16 23:42:53 -07:00
chentau 5a36d413fb flush curbuf->deleted_bytes2 after calling do_move 2021-04-14 21:47:21 -07:00
Björn Linse c9817603cf Merge pull request #14318 from chentau/extmark_luado
extmark: splice extmarks on :luado
2021-04-13 15:00:42 +02:00
chentau ff43d9597e extmark: splice extmarks on :luado 2021-04-12 11:33:50 -07:00
Björn Linse 6435b46b48 Merge pull request #14317 from chentau/extmark_sub
extmark: correct extmark_splice call with substitute and inccommand when replacing with escaped backslashes
2021-04-10 18:14:42 +02:00
chentau 343ee2d254 extmark: correct extmark_splice call with inccommand 2021-04-09 00:34:02 -07:00
chentau 7602c56050 extmark: fixes for noexpandtab and retab 2021-04-02 16:21:46 -07:00
Björn Linse 1186f7dd96 Merge pull request #14191 from chentau/extmark_blockpaste
Extmarks: send correct buffer events on blockwise paste for nonuniform lines
2021-03-24 00:27:55 +01:00
chentau 7fbabbaa57 Extmarks: correct buffer events on blockwise paste 2021-03-23 14:06:57 -07:00
chentau a92a8ef506 Correctly splice extmarks on tab with noexpandtab set 2021-03-22 20:26:25 -07:00
Björn Linse 6995fad260 Merge pull request #13973 from chentau/on_bytes_undofile
New versions of neovim will not read undofiles written by nvim before this merge (there will be an error message about incopmatible version). Nvim 0.4 (or an master up to bda12927be ) can be used to recover older undofiles, so if you worried about unsaved changes lurking around in undofiles it would make sense to keep such version around somewhere to recover them.

This is a necessary change to keep tree-sitter and plugins dependent on byte-level buffer change events fully working with undo states from a undofile. If there is a clear demand we might implement reading of the old format. Such recovered buffers will not be be fully functional with plugins relying on buffer updates or tree-sitter, however.
2021-03-03 09:45:06 +01:00
chentau f42e932df4 Extmarks: Save extmark undo information to undofile. 2021-03-02 12:45:54 -08:00
Björn Linse 772421f6b1 Merge pull request #13692 from mjlbach/fix_cursor_respect_current_line
fix_cursor: do not change line number when edit will not impact cursor row
2021-02-16 18:32:38 +01:00
Björn Linse c7a65fe6a1 buffer_updates: autoload episode III: revenge of the trees 2021-02-14 11:10:36 +01:00
Björn Linse 94622ca66b buffer updates: add on_reload callback and handle it in treesitter parser 2021-02-10 18:58:46 +01:00
Thomas Vigouroux 3094bb4e38 fix(buf_updates): send updates when putting past last line
Fixes #13710
2021-02-08 19:08:42 +01:00
Björn Linse 209fb35acd tests: clean up lua/buffer_updates_spec.lua 2021-02-04 14:35:30 +01:00
Björn Linse aa50369897 inccommand: preserve extmarks when undoing preview substitution 2021-02-04 14:33:37 +01:00
Michael Lingelbach 563d7b694b tests: add test for cursor postion when deleting buffer lines 2021-01-31 12:43:48 -08:00
Björn Linse 39d098f9f9 api: set_text: fix some byte count issues
add byte count tests

update documentation
2021-01-01 19:51:58 +01:00
Thomas Vigouroux 25e20da550 feat(buffer_updates): allow ignoring when previewing
Also adds a test that we actually subscribe to buffer events when in
CMDPREVIEW.
2020-12-15 22:29:27 +01:00
Björn Linse 0b615dae07 api: multiple decoration providers at once 2020-10-10 15:16:45 +02:00
KillTheMule 02dcc3c11a Fix byte updates for blockwise paste at buffer end 2020-09-30 21:28:21 +02:00
Thomas Vigouroux c1a740ae33 bytetrack: add blockwise paste test 2020-09-30 20:10:06 +02:00
KillTheMule ba515622fb Fix buffer_updates on blockwise paste
Fixes #12718.
2020-09-30 20:10:05 +02:00
Björn Linse 3610d0091f test: buffer updates: add visual charwise paste test 2020-09-19 15:50:35 +02:00
Björn Linse b7fc7ac6a1 buffer updates: fix issues with "change" operator 2020-09-19 10:01:00 +02:00
Björn Linse 4cc2a7af4b tests: lua buffer updates: reorg check_events() 2020-09-19 09:58:31 +02:00
Thomas Vigouroux 179f0bca18 buf_updates: fix wrong updates on linewise change 2020-09-18 17:54:49 +02:00
Thomas Vigouroux 6dc815530b buf_updates: fix updates for empty buffers (#12926)
On empty buffers, when editing the first line, the line is buffered, causing offset to be < 0. While the buffer is not actually empty, the buffered line has not been flushed (and should not be) yet, so the call is valid but an edge case.
2020-09-17 23:34:28 +02:00
Thomas Vigouroux 9a7f111db6 treesitter: filter updates on <CR>
This fixes an error when fo=ro, when hitting <CR> to insert a new
comment line.
2020-09-16 16:35:17 +02:00
Björn Linse 34c0f7af04 buf_attach: fix buffer updates with setline() 2020-09-16 13:50:16 +02:00
Thomas Vigouroux a8f71676a1 fix(bufupdates): avoid sending empty updates 2020-09-11 14:48:10 +02:00
Thomas Vigouroux f0e258cf85 fix(bytetrack): send correct events when opening lines
a bit of test cleanup

ärrår

feeel

SPLIT

fix: sned correct updates on <CR>
2020-09-11 14:38:58 +02:00
Thomas Vigouroux 82fb6a8818 fix lints 2020-09-09 21:22:21 +02:00
Björn Linse bc86f76c0a api/buffer: add "on_bytes" callback to nvim_buf_attach
This implements byte-resolution updates of buffer changes.
Note: there is no promise that the buffer state is valid inside
the callback!
2020-09-09 21:22:21 +02:00