summaryrefslogtreecommitdiffstatshomepage
path: root/src/nvim/textobject.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.
2025-03-06vim-patch:9.1.1175: inconsistent behaviour with exclusive selection and ↵zeertzjq1
motion commands (#32745) Problem: inconsistent behaviour with exclusive selection and motion commands (aidancz) Solution: adjust cursor position when selection is exclusive (Jim Zhou) fixes: vim/vim#16278 closes: vim/vim#16784 https://github.com/vim/vim/commit/c8cce711dde2d8abcf0929b3b12c4bfc5547a89d Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com> Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2024-12-23refactor: iwyu #31637Justin M. Keyes1
Result of `make iwyu` (after some "fixups").
2024-07-30refactor: collapse statements in single assignmentsLewis Russell1
Problem: Variables are often assigned multiple places in common patterns. Solution: Replace these common patterns with different patterns that reduce the number of assignments. Use `MAX` and `MIN`: ```c if (x < y) { x = y; } // --> x = MAX(x, y); ``` ```c if (x > y) { x = y; } // --> x = MIN(x, y); ``` Use ternary: ```c int a; if (cond) { a = b; } els { a = c; } // --> int a = cond ? b : c; ```
2024-06-20vim-patch:9.1.0504: inner-tag textobject confused about ">" in attributes ↵zeertzjq1
(#29420) Problem: inner-tag textobject confused about ">" in attributes Solution: Skip over quoted '>' when determining the start position fixes: vim/vim#15043 closes: vim/vim#15049 https://github.com/vim/vim/commit/ca7f93e6f351b310c17cfc8f88acf21c839d6116 Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-14vim-patch:9.1.0172: More code can use ml_get_buf_len() instead of STRLEN()zeertzjq1
Problem: More code can use ml_get_buf_len() instead of STRLEN(). Solution: Change more STRLEN() calls to ml_get_buf_len(). Also do not set ml_line_textlen in ml_replace_len() if "has_props" is set, because "len_arg" also includes the size of text properties in that case. (zeertzjq) closes: vim/vim#14183 https://github.com/vim/vim/commit/94b7c3233ef534acc669b3083ed1fe59cf3a090b
2024-03-13fix(api/buffer): fix handling of viewport of non-current bufferbfredl1
A lot of functions in move.c only worked for curwin, alternatively took a `wp` arg but still only work if that happens to be curwin. Refactor those that are needed for update_topline(wp) to work for any window. fixes #27723 fixes #27720
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.
2024-01-06vim-patch:9.1.0012: regression with empty inner blocks introducedzeertzjq1
Problem: regression with empty inner blocks introduced (after v9.1.0007) Solution: Set correct cursor position, Check for visual mode being active (Maxim Kim) relates: vim/vim#13514 closes: vim/vim#13819 https://github.com/vim/vim/commit/3779516988f14f2070d827514c79383334a0946b Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-01-06vim-patch:9.1.0007: can select empty inner text blockszeertzjq1
Problem: can select empty inner text blocks (laurentalacoque) Solution: make selecting empty inner text blocks an error textobjects: Make selecting inner empty blocks an error fixes: vim/vim#13514 closes: vim/vim#13523 https://github.com/vim/vim/commit/ad4d7f446dc6754bde212234d46f4849b520b6e0 Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-12-30refactor: follow style guidedundargoc1
2023-12-28vim-patch:9.0.2188: cursor wrong after { in single line buffer (#26766)zeertzjq1
Problem: cursor wrong after { in single line buffer (Edwin Chan) Solution: do not place the cursor at the end for a single line buffer when moving backwards (Gary Johnson) closes: vim/vim#13780 closes: vim/vim#13783 https://github.com/vim/vim/commit/9e6549d2fb282c45a2492ea95fe7ba54c2082c3e Co-authored-by: Gary Johnson <garyjohn@spocom.com>
2023-12-21refactor: run IWYU on entire repodundargoc1
Reference: https://github.com/neovim/neovim/issues/6371.
2023-12-20refactor: eliminate cyclic includesdundargoc1
2023-12-19refactor: use `bool` to represent boolean valuesdundargoc1
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(IWYU): create normal_defs.h (#26293)zeertzjq1
2023-11-28refactor: fix headers with IWYUdundargoc1
2023-11-27build(IWYU): fix includes for undo_defs.hdundargoc1
2023-11-27build(IWYU): fix includes for func_attr.hdundargoc1
2023-11-19refactor: follow style guidedundargoc1
- reduce variable scope - prefer initialization over declaration and assignment
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-11-11refactor: remove redundant castsdundargoc1
2023-11-05refactor: the long goodbyedundargoc1
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.
2023-10-09refactor: the long goodbyedundargoc1
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.
2023-09-30refactor: reorganize option header files (#25437)zeertzjq1
- 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
2023-09-30build(iwyu): add a few more _defs.h mappings (#25435)zeertzjq1
2023-07-03refactor: remove longdundargoc1
long is 32-bits even on 64-bit windows which makes the type suboptimal for a codebase meant to be cross-platform.
2023-05-16vim-patch:9.0.1561: display wrong when moving cursor to above the top line ↵luukvbaal1
(#23644) Problem: Display wrong when moving cursor to above the top line and 'smoothscroll' is set. Solution: Call adjust_skipcol() in more places and make it work better. (Luuk van Baal, closes vim/vim#12395) https://github.com/vim/vim/commit/798fa76dbf737f855e47b10bf326453866b429ab
2023-04-26refactor: uncrustifydundargoc1
Notable changes: replace all infinite loops to `while(true)` and remove `int` from `unsigned int`.
2023-03-14refactor(screen): screen.c delenda estbfredl1
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.
2023-02-11refactor: reduce scope of locals as per the style guide (#22211)dundargoc1
2023-01-19refactor: replace char_u with char 25 (#21838)dundargoc1
refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
2023-01-15refactor: fix IWYU mapping file and use IWYU (#21802)dundargoc1
Also add the EXITFREE definition to main_lib rather than the nvim target, as the header generation needs the EXITFREE flag to work properly.
2023-01-13refactor: replace char_u with char 20 (#21714)dundargoc1
refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
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-10-21refactor: clang-tidy fixes to silence clangd warning (#20683)dundargoc1
* refactor: readability-uppercase-literal-suffix * refactor: readability-named-parameter * refactor: bugprone-suspicious-string-compare * refactor: google-readability-casting * refactor: readability-redundant-control-flow * refactor: bugprone-too-small-loop-variable * refactor: readability-non-const-parameter * refactor: readability-avoid-const-params-in-decls * refactor: google-readability-todo * refactor: readability-inconsistent-declaration-parameter-name * refactor: bugprone-suspicious-missing-comma * refactor: remove noisy or slow warnings
2022-10-15refactor: replace char_u with charDundar Göc1
Work on https://github.com/neovim/neovim/issues/459
2022-09-30docs: fix typos (#20394)dundargoc1
Co-authored-by: Raphael <glephunter@gmail.com> Co-authored-by: smjonas <jonas.strittmatter@gmx.de> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-09-06refactor: replace char_u with charDundar Göc1
Work on https://github.com/neovim/neovim/issues/459
2022-09-01refactor: replace char_u with charDundar Göc1
Work on https://github.com/neovim/neovim/issues/459
2022-08-31refactor: replace char_u with charDundar Göc1
Work on https://github.com/neovim/neovim/issues/459
2022-08-27vim-patch:8.2.0660: the search.c file is a bit big (#19963)zeertzjq1
Problem: The search.c file is a bit big. Solution: Split off the text object code to a separate file. (Yegappan Lakshmanan, closes vim/vim#6007) https://github.com/vim/vim/commit/ed8ce057b7a2fcd89b5f55680ae8f85d62a992a5