aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
Commit message (Collapse)AuthorAge
* Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpostJosh Rahm2023-11-30
|\
| * refactor: move some constants out of vim_defs.h (#26298)zeertzjq2023-11-29
| |
| * refactor: fix headers with IWYUdundargoc2023-11-28
| |
| * refactor: rename types.h to types_defs.hdundargoc2023-11-27
| |
| * build: enable IWYU on macdundargoc2023-11-27
| |
| * refactor: enable formatting for ternariesdundargoc2023-11-20
| | | | | | | | | | | | This requires removing the "Inner expression should be aligned" rule from clint as it prevents essentially any formatting regarding ternary operators.
| * refactor: follow style guidedundargoc2023-11-19
| | | | | | | | | | - reduce variable scope - prefer initialization over declaration and assignment
| * refactor: follow style guidedundargoc2023-11-13
| | | | | | | | | | | | - reduce variable scope - prefer initialization over declaration and assignment - use bool to represent boolean values
| * fix(textformat): remove unnecessary changed_bytes() (#26027)zeertzjq2023-11-13
| | | | | | This was removed from Vim in patch 8.1.0681.
| * 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: remove redundant castsdundargoc2023-11-11
| |
| * refactor: change some xstrndup() and xstrnsave() to xmemdupz() (#25959)zeertzjq2023-11-10
| | | | | | | | When the given length is exactly the number of bytes to copy, xmemdupz() makes the intention clearer.
| * refactor: the long goodbyedundargoc2023-11-05
| | | | | | | | | | | | long is 32 bits on windows, while it is 64 bits on other architectures. This makes the type suboptimal for a codebase meant to be cross-platform. Replace it with more appropriate integer types.
| * vim-patch:9.0.2075: TextChangedI may not always trigger (#25808)zeertzjq2023-10-28
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: TextChangedI may not always trigger Solution: trigger it in more cases: for insert/ append/change operations, and when opening a new line, fixes: vim/vim#13367 closes: vim/vim#13375 https://github.com/vim/vim/commit/4bca4897a12dfb91b3b27e3083fd5f370bd857d1 Co-authored-by: Christian Brabandt <cb@256bit.org>
| * refactor(options): rename `empty_option` to `empty_string_option`Famiu Haque2023-10-17
| |
| * refactor: use xstpcpy() instead of strcat() (#25572)James2023-10-10
| |
| * refactor: the long goodbyedundargoc2023-10-09
| | | | | | | | | | | | long is 32 bits on windows, while it is 64 bits on other architectures. This makes the type suboptimal for a codebase meant to be cross-platform. Replace it with more appropriate integer types.
| * refactor: the long goodbyedundargoc2023-10-03
| | | | | | | | | | | | long is 32 bits on windows, while it is 64 bits on other architectures. This makes the type suboptimal for a codebase meant to be cross-platform. Replace it with more appropriate integer types.
| * refactor: reorganize option header files (#25437)zeertzjq2023-09-30
| | | | | | | | | | | | - Move vimoption_T to option.h - option_defs.h is for option-related types - option_vars.h corresponds to Vim's option.h - option_defs.h and option_vars.h don't include each other
| * refactor(message): smsg_attr -> smsgbfredl2023-09-29
| |
| * refactor: remove longdundargoc2023-09-29
| | | | | | | | | | long is 32-bits even on 64-bit windows which makes the type suboptimal for a codebase meant to be cross-platform.
| * refactor(messages): fold msg_attr into msgbfredl2023-09-27
| | | | | | | | | | problem: there are too many different functions in message.c solution: fold some of the functions into themselves
| * refactor(messages): fold msg_outtrans_attr into msg_outtransbfredl2023-09-27
| | | | | | | | | | problem: there are too many different functions in message.c solution: fold some of the functions into themselves
| * vim-patch:9.0.1847: [security] potential oob write in do_addsub()zeertzjq2023-09-03
| | | | | | | | | | | | | | | | | | Problem: potential oob write in do_addsub() Solution: don't overflow buf2, check size in for loop() https://github.com/vim/vim/commit/889f6af37164775192e33b233a90e86fd3df0f57 Co-authored-by: Christian Brabandt <cb@256bit.org>
| * 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.
| * 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.
| * vim-patch:partial:8.2.4950: text properties position wrong after shifting ↵zeertzjq2023-06-06
| | | | | | | | | | | | | | | | | | | | | | text (#23930) Problem: Text properties position wrong after shifting text. Solution: Adjust the text properties when shifting a block of text. (closes vim/vim#10418) https://github.com/vim/vim/commit/4b93674159d60c985de906c30f45dbaf2b64056f Co-authored-by: LemonBoy <thatlemon@gmail.com>
| * vim-patch:9.0.1597: cursor ends up below the window after a put (#23873)zeertzjq2023-06-02
| | | | | | | | | | | | | | | | | | Problem: Cursor ends up below the window after a put. Solution: Mark w_crow and w_botline invalid when changing the cursor line. (closes vim/vim#12465) https://github.com/vim/vim/commit/8509014adda188ee8bdf6a2e123fbf15a91b29d2 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:9.0.1588: Incsearch not triggered when pasting clipboard register ↵zeertzjq2023-05-30
| | | | | | | | | | | | | | | | | | | | | | | | (#23817) Problem: Incsearch not triggered when pasting clipboard register on the command line. Solution: Also set "literally" when using a clipboard register. (Ken Takata, closes vim/vim#12460) https://github.com/vim/vim/commit/9cf6ab133227ac7e9169941752293bb7178d8e38 Co-authored-by: K.Takata <kentkt@csc.jp>
| * fix(redo): make redo of Lua mappings in op-pending mode work (#23566)zeertzjq2023-05-10
| |
| * vim-patch:9.0.1521: failing redo of command with control characterszeertzjq2023-05-08
| | | | | | | | | | | | | | Problem: Failing redo of command with control characters. Solution: Use AppendToRedobuffLit() for colon commands. (closes vim/vim#12354) https://github.com/vim/vim/commit/30b6d6104c3d541c41c868989c020b743e01af08
| * vim-patch:9.0.1516: cannot use special keys in <Cmd> mappingzeertzjq2023-05-08
| | | | | | | | | | | | | | | | Problem: Cannot use special keys in <Cmd> mapping. Solution: Do allow for special keys in <Cmd> and <ScriptCmd> mappings. (closes vim/vim#12326) https://github.com/vim/vim/commit/3ab3a864814f903da8a158c01820e4fbe1013c08
| * vim-patch:8.2.4890: inconsistent capitalization in error messageszeertzjq2023-05-05
| | | | | | | | | | | | | | | | | | Problem: Inconsistent capitalization in error messages. Solution: Make capitalization consistent. (Doug Kearns) https://github.com/vim/vim/commit/cf030578b26460643dca4a40e7f2e3bc19c749aa Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:9.0.0751: 'scrolloff' does not work well with 'smoothscroll'Luuk van Baal2023-05-02
| | | | | | | | | | | | | | | | | | Problem: 'scrolloff' does not work well with 'smoothscroll'. Solution: Make positioning the cursor a bit better. Rename functions. https://github.com/vim/vim/commit/c9121f798f49fa71e814912cb186d89c164090c3 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:9.0.1330: handling new value of an option has a long "else if" chainLewis Russell2023-04-28
| | | | | | | | | | | | | | Problem: Handling new value of an option has a long "else if" chain. Solution: Use a function pointer. (Yegappan Lakshmanan, closes vim/vim#12015) https://github.com/vim/vim/commit/af93691b53f38784efce0b93fe7644c44a7e382e
| * refactor: uncrustifydundargoc2023-04-26
| | | | | | | | Notable changes: replace all infinite loops to `while(true)` and remove `int` from `unsigned int`.
| * refactor(clang-tidy): remove redundant castsdundargoc2023-04-26
| |
| * vim-patch:8.2.1049: Vim9: leaking memory when using continuation linezeertzjq2023-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Vim9: leaking memory when using continuation line. Solution: Keep a pointer to the continuation line in evalarg_T. Centralize checking for a next command. https://github.com/vim/vim/commit/b171fb179053fa631fec74911b5fb9374cb6a8a1 Omit eval_next_line(): Vim9 script only. vim-patch:8.2.1050: missing change in struct Problem: Missing change in struct. Solution: Add missing change. https://github.com/vim/vim/commit/65a8ed37f7bc61fbe5c612a7b0eb0dfc16ad3e11 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * refactor: remove redundant const char * castsii142023-04-07
| |
| * fix(folds): handle visual blockwise indent insertion correctly (#22898)Brandon Simmons2023-04-07
| | | | | | | | | | Previously, the fold information was incorrect because it wasn't being updated during the blockwise insertion. (Solution by zeertzjq)
| * refactor: make error message definitions constii142023-04-05
| | | | | | | | message.c functions now take const char * as a format. Error message definitions can be made const.
| * refactor: remove char_u (#22829)dundargoc2023-04-02
| | | | | | Closes https://github.com/neovim/neovim/issues/459
| * refactor(screen): screen.c delenda estbfredl2023-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | drawscreen.c vs screen.c makes absolutely no sense. The screen exists only to draw upon it, therefore helper functions are distributed randomly between screen.c and the file that does the redrawing. In addition screen.c does a lot of drawing on the screen. It made more sense for vim/vim as our grid.c is their screen.c Not sure if we want to dump all the code for option chars into optionstr.c, so keep these in a optionchar.c for now.
| * vim-patch:9.0.1380: CTRL-X on 2**64 subtracts two (#22530)zeertzjq2023-03-05
| | | | | | | | | | | | | | | | Problem: CTRL-X on 2**64 subtracts two. (James McCoy) Solution: Correct computation for large number. (closes vim/vim#12103) https://github.com/vim/vim/commit/5fb78c3fa5c996c08a65431d698bd2c251eef5c7 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:9.0.1378: illegal memory access when using virtual editing (#22527)zeertzjq2023-03-05
| | | | | | | | | | | | | | | | Problem: Illegal memory access when using virtual editing. Solution: Make sure "startspaces" is not negative. https://github.com/vim/vim/commit/c99cbf8f289bdda5d4a77d7ec415850a520330ba Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * refactor: replace char_u with char or uint8_t (#22400)dundargoc2023-03-04
| | | | | | Work on https://github.com/neovim/neovim/issues/459
| * vim-patch:9.0.1376: accessing invalid memory with put in Visual block mode ↵zeertzjq2023-03-04
| | | | | | | | | | | | | | | | | | | | (#22505) Problem: Accessing invalid memory with put in Visual block mode. Solution: Adjust the cursor column if needed. https://github.com/vim/vim/commit/1c73b65229c25e3c1fd8824ba958f7cc4d604f9c Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * build: treat clang-tidy warnings as errors (#22238)dundargoc2023-02-12
| |
| * refactor: replace char_u with char (#21901)dundargoc2023-02-11
| | | | | | | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459