summaryrefslogtreecommitdiffstatshomepage
path: root/src/nvim/buffer_updates.c
AgeCommit message (Collapse)AuthorFiles
2025-08-14refactor(build): remove INCLUDE_GENERATED_DECLARATIONS guardsbfredl1
These are not needed after #35129 but making uncrustify still play nice with them was a bit tricky. Unfortunately `uncrustify --update-config-with-doc` breaks strings with backslashes. This issue has been reported upstream, and in the meanwhile auto-update on every single run has been disabled.
2024-12-23refactor: iwyu #31637Justin M. Keyes1
Result of `make iwyu` (after some "fixups").
2024-02-13refactor(lua): use Arena when converting from lua stack to API argsbfredl1
and for return value of nlua_exec/nlua_call_ref, as this uses the same family of functions. NB: the handling of luaref:s is a bit of a mess. add api_luarefs_free_XX functions as a stop-gap as refactoring luarefs is a can of worms for another PR:s. as a minor feature/bug-fix, nvim_buf_call and nvim_win_call now preserves arbitrary return values.
2024-02-11refactor(api): use an arena for nvim_buf_get_lines and buffer updatesbfredl1
Refactor some earlier "temporary Array" code in buffer_updates.c to use the modern style of MAXSIZE_TEMP_ARRAY and ADD_C
2024-01-11refactor(IWYU): fix headersdundargoc1
Remove `export` pramgas from defs headers as it causes IWYU to believe that the definitions from the defs headers comes from main header, which is not what we really want.
2023-12-21refactor: run IWYU on entire repodundargoc1
Reference: https://github.com/neovim/neovim/issues/6371.
2023-11-30build: don't define FUNC_ATTR_* as empty in headers (#26317)zeertzjq1
FUNC_ATTR_* should only be used in .c files with generated headers. Defining FUNC_ATTR_* as empty in headers causes misuses of them to be silently ignored. Instead don't define them by default, and only define them as empty after a .c file has included its generated header.
2023-11-29refactor: move some constants out of vim_defs.h (#26298)zeertzjq1
2023-11-28refactor: fix headers with IWYUdundargoc1
2023-11-27refactor: rename types.h to types_defs.hdundargoc1
2023-11-27build(IWYU): fix includes for undo_defs.hdundargoc1
2023-11-27build(IWYU): fix includes for func_attr.hdundargoc1
2023-11-27refactor: move Arena and ArenaMem to memory_defs.h (#26240)zeertzjq1
2023-11-12build: remove PVSdundargoc1
We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
2023-03-09fix(buffer_updates): save and restore current window cursor (#16732)zeertzjq1
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.
2023-01-03refactor(api): do not allocate temporaries for internal eventsbfredl1
2022-12-14fix(treesitter): properly restore `'syntax'` (#21358)Lewis Russell1
2022-11-15fix(api): nvim_buf_get_text regression (#21071)Lewis Russell1
2022-11-15build: allow IWYU to fix includes for all .c filesdundargoc1
Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers.
2022-11-14feat(lua-api): avoid unnecessary allocations (#19877)Lewis Russell1
Lua makes (or reuses) an internal copy of strings, so we can safely push buf pointers onto the stack.
2022-08-31feat(lua): vim.ui_attach to get ui events from luabfredl1
Co-authored-by: Famiu Haque <famiuhaque@protonmail.com>
2022-07-20refactor(object): get rid of redundant FIXED_TEMP_ARRAYbfredl1
use the MAXSIZE_TEMP_ARRAY + ADD_C pattern instead, as exemplified by the changes in this commit.
2022-05-31feat: add preview functionality to user commandsFamiu Haque1
Adds a Lua-only `preview` flag to user commands which allows the command to be incrementally previewed like `:substitute` when 'inccommand' is set.
2022-05-25refactor(uncrustify): set maximum number of consecutive newlines to 2 (#18695)dundargoc1
2022-05-10vim-patch:8.2.4911: the mode #defines are not clearly named (#18499)zeertzjq1
Problem: The mode #defines are not clearly named. Solution: Prepend MODE_. Renumber them to put the mapped modes first. https://github.com/vim/vim/commit/249591057b4840785c50e41dd850efb8a8faf435 A hunk from the patch depends on patch 8.2.4861, which hasn't been ported yet, but that should be easy to notice.
2022-05-07fix(extmarks): revert to int for extmark rowzeertzjq1
2022-05-06refactor: enable -Wconversion warning for edit.cDundar Goc1
Work on https://github.com/neovim/neovim/issues/567
2022-04-13refactor: add pure attribute to pure functionsDundar Göc1
This will allow compilers that support the pure attribute to make further optimizations to functions.
2021-09-19refactor: format with uncrustify #15722dundargoc1
2021-07-24fix: fix incorrect call sites of xcallocGregory Anders1
The number of elements comes first and the size of each element second.
2021-07-07chore: use codespell to spell check #15016dundargoc1
2021-04-03luaref: free all references in buffer_updatesBjörn Linse1
2021-02-10buffer updates: add on_reload callback and handle it in treesitter parserBjörn Linse1
2020-12-15feat(buffer_updates): allow ignoring when previewingThomas Vigouroux1
Also adds a test that we actually subscribe to buffer events when in CMDPREVIEW.
2020-09-11Merge pull request #12889 from vigoux/bytetrack-open-lineBjörn Linse1
Fix invalid events with `o` `<CR>` and `autoindent`
2020-09-11fix(bufupdates): avoid sending empty updatesThomas Vigouroux1
2020-09-10lua: cleanup naming conventions of executor functionsBjörn Linse1
2020-09-09fix lintsThomas Vigouroux1
2020-09-09api/buffer: add "on_bytes" callback to nvim_buf_attachBjörn Linse1
This implements byte-resolution updates of buffer changes. Note: there is no promise that the buffer state is valid inside the callback!
2020-02-10treesitter: cleanup some luahl stuffBjörn Linse1
2020-01-16extmarks/bufhl: reimplement using new marktree data structureBjörn Linse1
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
2019-12-22tree-sitter: implement query functionality and highlighting prototype ↵Björn Linse1
[skip.lint]
2019-08-06lua: support getting UTF-32 and UTF-16 sizes of replaced textBjörn Linse1
2019-08-06lua: add {old_byte_size} to on_lines buffer change eventBjörn Linse1
2019-06-15api/lua: add on_detach to nvim_buf_attachBjörn Linse1
2019-06-04api: allow nvim_buf_attach from lua using callbacksBjörn Linse1
2018-09-24add func_attr_printf in :MichaHoffmann1
log.c message.c strings.c fixed some printf warnings in: src/nvim/undo.c src/nvim/eval.c src/nvim/eval/encode.c src/nvim/eval/typval.c src/nvim/ex_getln.c src/nvim/fileio.c src/nvim/lua/executor.c src/nvim/main.c src/nvim/regexp_nfa.c src/nvim/shada.c src/nvim/spellfile.c src/nvim/tui/terminfo.c src/nvim/garray.h
2018-06-22*: Replace b_changedtick with new always-inline functionsZyX1
Ref #8474
2018-06-09refactor: buf_collect_lines (#8509)Justin M. Keyes1
Move redundant common logic into a function.
2018-06-08Merge #7917 'API: buffer updates'Justin M. Keyes1