aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fold.c
Commit message (Collapse)AuthorAge
* vim-patch:8.1.2057: the screen.c file is much too bigLewis Russell2022-08-19
| | | | | | | | | | | | | | | Problem: The screen.c file is much too big. Solution: Split it in three parts. (Yegappan Lakshmanan, closes vim/vim#4943) https://github.com/vim/vim/commit/7528d1f6b5422750eb778dfb550cfd0b0e540964 This is an approximation vim-patch 8.1.2057. Applying the patch directly isn't feasible since our version of screen.c has diverged too much, however we still introduce drawscreen.c and drawline.c: - screen.c is now a much smaller file used for low level screen functions - drawline.c contains everything needed for win_line() - drawscreen.c contains everything needed for update_screen() Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* refactor: change pre-decrement/increment to post (#19799)Lewis Russell2022-08-16
| | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* vim-patch:8.1.1960: fold code is spread out (#19777)zeertzjq2022-08-15
| | | | | Problem: Fold code is spread out. Solution: Move fold functions to fold.c. https://github.com/vim/vim/commit/db022f3ffb57c5ff4b97b4e93a994d11e4c10466
* refactor(fold): style #19175Lewis Russell2022-07-02
| | | | | | * refactor(fold): update comment formatting * refactor(fold): use post-increment/decrement * refactor(fold): reduce scope of local variables * refactor(fold): use booleans
* refactor: replace char_u #18429dundargoc2022-06-28
| | | Work on https://github.com/neovim/neovim/issues/459
* refactor: change type of linenr_T from long to int32_tDundar Goc2022-06-10
| | | | | | | | | | | | | The size of long varies depending on architecture, in contrast to the MAXLNUM constant which sets the maximum allowable number of lines to 2^32-1. This discrepancy may lead to hard to detect bugs, for example https://github.com/neovim/neovim/issues/18454. Setting linenr_T to a fix maximum size of 2^32-1 will prevent this type of errors in the future. Also change the variables `amount` and `amount_after` to be linenr_T since they're referring to "the line number difference" between two texts.
* feat: add preview functionality to user commandsFamiu Haque2022-05-31
| | | | Adds a Lua-only `preview` flag to user commands which allows the command to be incrementally previewed like `:substitute` when 'inccommand' is set.
* refactor(uncrustify): set maximum number of consecutive newlines to 2 (#18695)dundargoc2022-05-25
|
* vim-patch:8.2.5009: fold may not be closeable after appending (#18722)Brandon Simmons2022-05-23
| | | | | Problem: Fold may not be closeable after appending. Solution: Set the fd_small flag to MAYBE. (Brandon Simmons, closes vim/vim#10471) https://github.com/vim/vim/commit/e8c4a64bffbe628a46dc172d04cfc2db6e8dd8b6
* vim-patch:8.2.4935: with 'foldmethod' "indent" some lines not included in ↵zeertzjq2022-05-22
| | | | | | | | fold (#18694) Problem: With 'foldmethod' "indent" some lines are not included in the fold. (Oleg Koshovetc) Solution: Fix it. (Brandon Simmons, closes vim/vim#10399, closes vim/vim#3214) https://github.com/vim/vim/commit/d98e75e23666c159c7e00bcf5b6ad9a933bb0534
* vim-patch:8.2.4987: after deletion a small fold may be closable (#18683)Brandon Simmons2022-05-22
| | | | | Problem: After deletion a small fold may be closable. Solution: Check for a reverse range. (Brandon Simmons, closes vim/vim#10457) https://github.com/vim/vim/commit/3fcccf94e8bc142d2c79c3b62087145896df6b36
* vim-patch:8.1.0535: increment/decrement might get interrupted by updating foldszeertzjq2022-05-22
| | | | | | | Problem: Increment/decrement might get interrupted by updating folds. Solution: Disable fold updating for a moment. (Christian Brabandt, closes vim/vim#3599) https://github.com/vim/vim/commit/6b731886ca94d66b9bdedfb7e603af44a6400399
* refactor: replace char_u variables and functions with charDundar Goc2022-05-16
| | | | Work on https://github.com/neovim/neovim/issues/459
* vim-patch:8.2.4911: the mode #defines are not clearly named (#18499)zeertzjq2022-05-10
| | | | | | | | 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.
* refactor: replace char_u variables and functions with charDundar Goc2022-05-09
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u variables and functions with charDundar Goc2022-05-07
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u variables and functions with charDundar Goc2022-05-03
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor(uncrustify): change rules to better align with the style guideDundar Goc2022-04-29
| | | | | | | | | | | | | Add space around arithmetic operators '+' and '-'. Remove space between back-to-back parentheses, i.e. ')(' vs. ') ('. Remove space between '((' or '))' of control statements. Add space between ')' and '{' of control statements. Remove space between function name and '(' on function declaration. Collapse empty blocks between '{' and '}'. Remove newline at the end of the file. Remove newline between 'enum' and '{'. Remove newline between '}' and ')' in a function invocation. Remove newline between '}' and 'while' of 'do' statement.
* fix/PVS #17863dundargoc2022-04-24
| | | | | | | | | | | | | | | | | | * fix(PVS/V002): disable rule completely V002: "Some diagnostic messages may contain incorrect line number in this file." This particular check seems unreliable. It says on their website https://pvs-studio.com/en/docs/warnings/v002/ that this warning occurs when there are multiline pragmas, but there are none in extmark.c. * fix(PVS/V756): ignore "counter is not used inside a nested loop" warning The nested loop starts with "AutoCmd *ac = ap->cmds" so "ap" is definitely used. * fix(PVS/V560): disable "a part of conditional expression is always true" * fix(PVS/V614): potentially uninitialized variable 'blen' used
* vim-patch:8.2.4813: pasting text while indent folding may mess up foldszeertzjq2022-04-24
| | | | | | Problem: Pasting text while indent folding may mess up folds. Solution: Adjust the way folds are split. (Brandon Simmons, closes vim/vim#10254) https://github.com/vim/vim/commit/2c40707baa13a53cac4137ffb8b2ac67f50cea63
* vim-patch:8.2.4402: missing parenthesis may cause unexpected problemsBrian Leung2022-04-03
| | | | | | Problem: Missing parenthesis may cause unexpected problems. Solution: Add more parenthesis is macros. https://github.com/vim/vim/commit/ae6f1d8b14c2f63811ee83ef14e32086fb3e9b83
* refactor(fold): convert function comments to doxygen formatDundar Göc2022-03-16
|
* vim-patch:8.2.3914 (#16808)dundargoc2021-12-28
| | | | | | | | | * vim-patch:8.2.3914: various spelling mistakes in comments Problem: Various spelling mistakes in comments. Solution: Fix the mistakes. (Dominique Pellé, closes vim/vim#9416) https://github.com/vim/vim/commit/af4a61a85d6e8cacc35324f266934bc463a21673 Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* refactor(misc1): move out high-level input functions to a new file: input.cBjörn Linse2021-12-10
| | | | | Possibly dialog code is messages.c could be moved here as well. misc1.c is now empty, so delete it.
* refactor(misc1): move line_breakcheck family of functions to os/input.cBjörn Linse2021-12-09
|
* refactor: saner options for uncrustify (#16204)dundargoc2021-11-19
| | | | | | | | | | | | | | | | | | | | | | | | * sp_enum_after_assign = force * sp_brace_typedef = force * nl_do_brace = remove * sp_do_brace_open = force * sp_brace_close_while = force * sp_before_semi = remove * sp_before_semi_for = remove * sp_before_semi_for_empty = remove * sp_between_semi_for_empty = remove * sp_after_semi_for_empty = remove * sp_before_square = remove * sp_before_squares = remove * sp_inside_square = remove * sp_inside_fparens = remove * sp_inside_fparen = remove * sp_inside_tparen = remove * sp_after_tparen_close = remove * sp_return_paren = force * pos_bool = lead * sp_pp_concat = remove * sp_pp_stringify = remove * fixup: disable formatting for the INIT section
* vim-patch:8.1.0743: giving error messages is not flexibleJames McCoy2021-11-01
| | | | | | | | | Problem: Giving error messages is not flexible. Solution: Add semsg(). Change argument from "char_u *" to "char *", also for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes vim/vim#3302) Also make emsg() accept a "char *" argument. Get rid of an enormous number of type casts. https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d
* vim-patch:8.1.2379: using old C style commentsDundar Göc2021-10-21
| | | | | | Problem: Using old C style comments. Solution: Use // comments where appropriate. https://github.com/vim/vim/commit/217e1b8359447f5550dcb0d1ee43380a90c253c5
* Merge pull request #15930 from dundargoc/vim-patch/old-style-c-commentsJan Edmund Lazo2021-10-17
|\ | | | | vim-patch:8.1.2396,8.1.2395,8.1.2394,8.1.2392,8.1.2368,8.1.2388,8.1.2379
| * vim-patch:8.1.2379: using old C style commentsDundar Göc2021-10-06
| | | | | | | | | | | | Problem: Using old C style comments. Solution: Use // comments where appropriate. https://github.com/vim/vim/commit/217e1b8359447f5550dcb0d1ee43380a90c253c5
* | refactor: reduce number of unique char castsDundar Göc2021-10-13
|/
* Refactor/uncrustify (#15790)dundargoc2021-09-29
| | | | | | | | | | | | | * refactor: format with uncrustify * fixup(dundar): fix functions comments * fixup(dundar): remove space between variable and ++/-- * fixup(dundar): better workaround for macro attributes This is done to be able to better use uncrustify rules for macros * fixup(justin): make preprocessors follow neovim style guide
* feat(decorations): support virtual lines (for now: only one block at a time)Björn Linse2021-09-26
|
* refactor: convert TRUE/FALSE to true/false (#15660)dundargoc2021-09-18
|
* fix: "redundant cast to the same type" #15662dundargoc2021-09-14
| | | Apply "redundant cast to the same type" fix from clangd.
* refactor: format files with uncrustify #15607dundargoc2021-09-10
|
* refactor: replace TRUE/FALSE with true/false #15425dundargoc2021-08-22
|
* refactor(plines): move out plines related code from misc1.cBjörn Linse2021-08-10
|
* vim-patch:8.2.1702: crash when using undo after deleting folded linesJan Edmund Lazo2021-06-10
| | | | | | Problem: Crash when using undo after deleting folded lines. Solution: Check for NULL pointer. (closes vim/vim#6968) https://github.com/vim/vim/commit/da697645d5917eb3d4168c06c3442bef9fb746bf
* vim-patch:8.2.2447: 'foldlevel' not applied to folds restored from sessionJan Edmund Lazo2021-02-01
| | | | | | Problem: 'foldlevel' not applied to folds restored from session. Solution: Set 'foldlevel' after creaiting the folds. (closes vim/vim#7767) https://github.com/vim/vim/commit/f9547eb6ef02e305203b859d2dcfdae930b9d544
* vim-patch:8.2.2176: crash with a sequence of fold commandsJan Edmund Lazo2020-12-21
| | | | | | | | | | | | | | | | | | | | | | Problem: Crash with a sequence of fold commands. Solution: Bail out when there are no folds at all. Add a test (Dominique Pellé) (closes vim/vim#7515) https://github.com/vim/vim/commit/6a78f328442073c32d58eafc13ce5a1ca7729eeb N/A patches for version.c: vim-patch:8.2.2174: Mac version doesn't specify the CPU architecture Problem: Mac version doesn't specify the CPU architecture. Solution: Add "arm64" or "x86_64". (Yee Cheng Chin, closes vim/vim#7519) https://github.com/vim/vim/commit/8c9d98a8af5351a3ac98cf11dede9f0268461511 vim-patch:8.2.2175: github actions: clang-11 handling suboptimal Problem: Github actions: clang-11 handling suboptimal. Solution: Separate step of installing clang-11. Get ubuntu release name dynamically. (Ozaki Kiichi, closes vim/vim#7514) https://github.com/vim/vim/commit/9aff970204234193045cfee205d51e2393e93bfd
* refactor: pass window to was_set_insecurelyMatthieu Coudron2020-11-23
| | | | | | working on get_foldtext and wanted to get rid of the curwin backup/restore. Turns out it's not possible else f_foldtext is run on the same window. Kept the cleanup anyway.
* vim-patch:8.1.0805: too many #ifdefsJan Edmund Lazo2020-11-12
| | | | | | Problem: Too many #ifdefs. Solution: Graduate FEAT_MBYTE, part 1. https://github.com/vim/vim/commit/135059724f140ceac889c9f8136bd1bf5c41d49d
* vim-patch:8.2.1972: crash when recreating nested foldJan Edmund Lazo2020-11-11
| | | | | | | | | | | | | | Problem: Crash when recreating nested fold. Solution: Check for empty growarray. (closes vim/vim#7278) https://github.com/vim/vim/commit/5e1f22ff614821b8fc7294c9dd22765acd403aeb N/A patches for version.c: vim-patch:8.2.1974: Vim9: test for has('gui_running') fails with VIMDLL Problem: Vim9: test for has('gui_running') fails with VIMDLL. Solution: Adjust the #ifdef. (Ken Takata, closes vim/vim#7276) https://github.com/vim/vim/commit/29b281ba8ddf176ae34b22e6a9b8e0ddcbcce665
* vim-patch:8.2.1947: crash when using "zj" without folds (#13222)Sean Dewar2020-11-03
| | | | | Problem: Crash when using "zj" without folds. (Sean Dewar) Solution: Check for at least one fold. (closes vim/vim#7245) https://github.com/vim/vim/commit/c136a3528b7ebb825c3863d701af44f023381181
* api: add API for themesBjörn Linse2020-11-01
| | | | | | | | | | co-author: hlpr98 <hlpr98@gmail.com> (dict2hlattrs function) orange is sus?? NOVEMBER DAWN erase the lie that is redraw_later()
* folds: pass column on fold creationMatthieu Coudron2020-09-28
| | | | | useful if we want to have inline folds later and/or let users create folds that remember their start/end columns.
* screen: more work on fold_line replacementBjörn Linse2020-09-24
|
* extmark: separate extmark_splice_cols for column-only changeBjörn Linse2020-09-09
| | | | as the byte logic will be the same for all of these
* robustness: avoid adding offset to NULL pointerBjörn Linse2020-09-04
| | | | | | | | | | | UBSAN with clang 10.0 is checking for adding offsets to a `NULL` pointer which is not allowed. This is not yet checked in the version of clang used in CI (7.0.0). I will work on cases of this so that tests passes locally for me. This could be tested in CI by either upgrading the clang of the ASAN/UBSAN to 10.0, or add yet another CI target which builds with clang 10.0.