aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/buffer.c
Commit message (Collapse)AuthorAge
* refactor: fix headers with IWYUdundargoc2023-11-28
|
* refactor: rename types.h to types_defs.hdundargoc2023-11-27
|
* build(IWYU): fix includes for undo_defs.hdundargoc2023-11-27
|
* build(IWYU): fix includes for func_attr.hdundargoc2023-11-27
|
* vim-patch:8.2.4685: when a swap file is found for a popup there is no dialog ↵zeertzjq2023-11-25
| | | | | | | | | | | (#26207) Problem: When a swap file is found for a popup there is no dialog and the buffer is loaded anyway. Solution: Silently load the buffer read-only. (closes vim/vim#10073) https://github.com/vim/vim/commit/188639d75c363dffaf813e8e2209f7350ad1e871 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* refactor(sign): move legacy signs to extmarksLuuk van Baal2023-11-17
| | | | | | | | | | | | | | | | | | | | Problem: The legacy signlist data structures and associated functions are redundant since the introduction of extmark signs. Solution: Store signs defined through the legacy commands in a hashmap, placed signs in the extmark tree. Replace signlist associated functions. Usage of the legacy sign commands should yield no change in behavior with the exception of: - "orphaned signs" are now always removed when the line it is placed on is deleted. This used to depend on the value of 'signcolumn'. - It is no longer possible to place multiple signs with the same identifier in a single group on multiple lines. This will now move the sign instead. Moreover, both signs placed through the legacy sign commands and through |nvim_buf_set_extmark()|: - Will show up in both |sign-place| and |nvim_buf_get_extmarks()|. - Are displayed by increasing sign identifier, left to right. Extmark signs used to be ordered decreasingly as opposed to legacy signs.
* build: remove PVSdundargoc2023-11-12
| | | | | | | 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.
* refactor(change): do API changes to buffer without curbuf switchbfredl2023-08-26
| | | | | | | | | | | | | | | | | | | | | | | Most of the messy things when changing a non-current buffer is not about the buffer, it is about windows. In particular, it is about `curwin`. When editing a non-current buffer which is displayed in some other window in the current tabpage, one such window will be "borrowed" as the curwin. But this means if two or more non-current windows displayed the buffers, one of them will be treated differenty. this is not desirable. In particular, with nvim_buf_set_text, cursor _column_ position was only corrected for one single window. Two new tests are added: the test with just one non-current window passes, but the one with two didn't. Two corresponding such tests were also added for nvim_buf_set_lines. This already worked correctly on master, but make sure this is well-tested for future refactors. Also, nvim_create_buf no longer invokes autocmds just because you happened to use `scratch=true`. No option value was changed, therefore OptionSet must not be fired.
* refactor(memline): distinguish mutating uses of ml_get_buf()bfredl2023-08-24
| | | | | | | | | | | | | | ml_get_buf() takes a third parameters to indicate whether the caller wants to mutate the memline data in place. However the vast majority of the call sites is using this function just to specify a buffer but without any mutation. This makes it harder to grep for the places which actually perform mutation. Solution: Remove the bool param from ml_get_buf(). it now works like ml_get() except for a non-current buffer. Add a new ml_get_buf_mut() function for the mutating use-case, which can be grepped along with the other ml_replace() etc functions which can modify the memline.
* vim-patch:9.0.0837: append() reports failure when not appending anythingzeertzjq2023-08-22
| | | | | | | | | Problem: append() reports failure when not appending anything. Solution: Only report failure when appending something. (closes vim/vim#11498) https://github.com/vim/vim/commit/cd9c8d400c1eb9cbb4ff6a33be02f91a30ab13b2 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* refactor: remove longdundargoc2023-07-03
| | | | | long is 32-bits even on 64-bit windows which makes the type suboptimal for a codebase meant to be cross-platform.
* refactor: uncrustifydundargoc2023-04-26
| | | | Notable changes: replace all infinite loops to `while(true)` and remove `int` from `unsigned int`.
* refactor: remove redundant const char * castsii142023-04-07
|
* refactor: replace char_u with char 24 (#21823)dundargoc2023-01-18
| | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* refactor: fix IWYU mapping file and use IWYU (#21802)dundargoc2023-01-15
| | | Also add the EXITFREE definition to main_lib rather than the nvim target, as the header generation needs the EXITFREE flag to work properly.
* feat(aucmd_win): allow crazy things with hidden buffers (#21250)zeertzjq2022-12-02
| | | | Problem: Crash when doing crazy things with hidden buffers. Solution: Dynamically allocate the list of autocommand windows.
* vim-patch:9.0.0965: using one window for executing autocommands is insufficientzeertzjq2022-11-29
| | | | | | | | | | | | | | | | | | Problem: Using one window for executing autocommands is insufficient. Solution: Use up to five windows for executing autocommands. https://github.com/vim/vim/commit/e76062c078debed0df818f70e4db14ad7a7cb53a N/A patches for version.c: vim-patch:9.0.0966: some compilers don't allow a declaration after a label Problem: Some compilers don't allow a declaration after a label. Solution: Move the declaration to the start of the block. (John Marriott) https://github.com/vim/vim/commit/f86490ed4fdab213a28f667abd055c023a73d645 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* refactor: buffer_ensure_loaded()zeertzjq2022-11-29
| | | | Cherry-picked from Vim patch 8.1.1612.
* vim-patch:9.0.0914: deletebufline() may move marks in the wrong windowzeertzjq2022-11-29
| | | | | | | | | | | Problem: deletebufline() may move marks in the wrong window. Solution: Find a window for the buffer being changed. (closes vim/vim#11583) https://github.com/vim/vim/commit/228e422855d43965f2c3319ff0cdc26ea422c10f Cherry-pick code change from patch 9.0.0961. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.0910: setting lines in another buffer may not work wellzeertzjq2022-11-29
| | | | | | | | | Problem: Setting lines in another buffer may not work well. Solution: Make sure the buffer being changed has a window. (issue vim/vim#11558) https://github.com/vim/vim/commit/c934bfa1b765505e5fc491f2ee7cc106894cafc8 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.1.2001: some source files are too big (#21231)zeertzjq2022-11-29
Problem: Some source files are too big. Solution: Move buffer and window related functions to evalbuffer.c and evalwindow.c. (Yegappan Lakshmanan, closes vim/vim#4898) https://github.com/vim/vim/commit/261f346f8154c0ec7094a4a211c653c74e9f7c2e