aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fold.c
Commit message (Collapse)AuthorAge
...
* fold: recursive in deleteFoldEntry() is boolJan Edmund Lazo2018-08-01
|
* fold: fold_changed is boolJan Edmund Lazo2018-08-01
|
* fold: finish in foldUpdateIEMSRecurse() is boolJan Edmund Lazo2018-08-01
|
* fold: lineFolded() is boolJan Edmund Lazo2018-08-01
|
* fold: check_closed() returns boolJan Edmund Lazo2018-08-01
| | | | | | | Update affected variables (ie. had_folded). Add const to params to restrict usage. TODO: refactor win_T.w_lines[idx].wl_folded from char to bool
* fold: fold_T.fd_small is TriStateJan Edmund Lazo2018-08-01
|
* vim-patch:8.0.0{469,581,583} (#8601)Jan Edmund Lazo2018-06-20
| | | | | | | | | | | | | | | | | vim-patch:8.0.0469: compiler warnings on MS-Windows Problem: Compiler warnings on MS-Windows. Solution: Add type casts. (Christian Brabandt) https://github.com/vim/vim/commit/0c0d4eca4dd6252f22ec39f2d561a5e8a68e9a4e vim-patch:8.0.0581: moving folded text is sometimes not correct Problem: Moving folded text is sometimes not correct. Solution: Bail out when "move_end" is zero. (Matthew Malcomson) https://github.com/vim/vim/commit/94be619e30e82d28cadeea5e0766c6f5c321ff8b vim-patch:8.0.0583: fold test hangs on MS-Windows Problem: Fold test hangs on MS-Windows. Solution: Avoid overflow in compare. https://github.com/vim/vim/commit/b11c826ddc459813f9f991cdb8e8736b686a6328
* vim-patch:8.0.0451: some macros are in lower caseJan Edmund Lazo2018-06-12
| | | | | | | Problem: Some macros are in lower case. Solution: Make a few more macros upper case. Avoid lower case macros use an argument twice. https://github.com/vim/vim/commit/91acfffc1e6c0d8c2abfb186a0e79a5bf19c3f3f
* vim-patch:8.0.0452: some macros are in lower case (#8505)Jan Edmund Lazo2018-06-08
| | | | | Problem: Some macros are in lower case. Solution: Make a few more macros upper case. https://github.com/vim/vim/commit/1c46544412382db8b3203d6c78e550df885540bd
* Merge #7917 'API: buffer updates'Justin M. Keyes2018-06-08
|\
| * Rename some more, fixe borked renamingKillTheMule2018-05-23
| |
| * LintKillTheMule2018-05-23
| |
| * Some renamings and doc changesKillTheMule2018-05-23
| |
| * Enable -WconversionKillTheMule2018-05-23
| |
| * The grand renamingKillTheMule2018-05-23
| |
| * API: Implement buffer updatesPeter Hodge2018-05-23
| | | | | | | | | | Originally written by @phodge in https://github.com/neovim/neovim/pull/5269.
* | vim-patch:8.0.0515: ml_get errors in silent Ex mode (#8452)KunMing Xie2018-05-30
| | | | | | | | | | | | Problem: ml_get errors in silent Ex mode. (Dominique Pelle) Solution: Clear valid flags when setting the cursor. Set the topline when not in full screen mode. https://github.com/vim/vim/commit/d5d37537d1fa46fd468bd378af2006dd09840f38
* | vim-patch:8.0.0503: endless loop in updating folds with 32 bit ints (#8433)nthanben2018-05-24
|/ | | | | Problem: Endless loop in updating folds with 32 bit ints. Solution: Subtract from LHS instead of add to the RHS. (Matthew Malcomson) vim/vim@9d20ce6
* charset,*: Refactor transstr()ZyX2018-04-09
|
* vim-patch:7.4.1976James McCoy2017-06-04
| | | | | | | Problem: Number variables are not 64 bits while they could be. Solution: Add the num64 feature. (Ken Takata) https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
* Merge #6550 from ZyX-I/pvs-check-commentJustin M. Keyes2017-04-20
|\
| * *: Add comment to all C filesZyX2017-04-19
| |
* | vim-patch:7.4.2152James McCoy2017-04-19
|/ | | | | | | Problem: No proper translation of messages with a count. Solution: Use ngettext(). (Sergey Alyoshin) https://github.com/vim/vim/commit/ee695f787ade7fd88fc5f5497553d95c0c3645b5
* fold: foldMoveRange(): fix :move bug #6534Matthew Malcomson2017-04-17
| | | | | | | | | | | | Closes #6540 In #6221 there was a mistake in calculating which folds need to be re-ordered. When there are no folds after those that have been adjusted, then `move_end` remains 0. This results in reverse_fold_order() swapping folds that have been adjusted with uninitialised folds in the remainder of the grow array. Add a check in foldMoveRange() to account for this case.
* fold.c: more edge-cases when updating (#6207)Matthew Malcomson2017-03-31
| | | | | | | | | | | | | | | | When foldUpdateIEMSRecurse() re-uses an existing fold, it misses the case where the existing fold spans from before startlnum to after firstlnum, the new fold does not span this range, and there is no "forced start" of a fold. We add a case for this in. Ensure that if there was no forced break in folds, we merge folds that now touch each other. Include testing for a tricky foldmethod=expr case that has never been a bug. This case works at the moment because of some effects that are not obvious when reading the code. A test for this could be useful to ensure a regression doesn't happen. vim-patch:8.0.0408
* fold.c: uppercase macrosJustin M. Keyes2017-03-25
|
* Fix wrap-around in 32 bitMatthew Malcomson2017-03-23
|
* Robustly handle folds during a :move commandMatthew Malcomson2017-03-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to re-order marks according to the :move command, do_move() uses mark_adjust() in a non-standard manner. The non-standard action is that it moves some marks *past* other marks. This doesn't matter for marks, but mark_adjust() calls foldMarkAdjust() which simply changes fold starts and lengths and doesn't have enough information to know that other folds have to be checked and reordered. The array of folds for each window are assumed to be in order of increasing line number, and if this gets broken some folds can get "lost". There has been a previous patch to avoid this problem by deleting and recalculating all folds in the window, but this comes at the cost of closing all folds when executing :move, and doesn't cover the case of manual folds. This patch adds a new function foldMoveRange() specifically for the :move command that handles reordering folds as well as simply moving them. Additionally, we allow calling mark_adjust_nofold() that does the same as mark_adjust() but doesn't affect any fold array. Calling mark_adjust_nofold() should be done in the same manner as calling mark_adjust(), but according changes to the fold arrays must be done seperately by the calling function. vim-patch:8.0.0457 vim-patch:8.0.0459 vim-patch:8.0.0461 vim-patch:8.0.0465
* vim-patch:8.0.0453 (#6266)Matthieu Coudron2017-03-13
| | | | | | Problem: Adding fold marker creates new comment. Solution: Use an existing comment if possible. (LemonBoy, closes vim/vim#1549) https://github.com/vim/vim/commit/025a6b708a9bff54c73fb9c641b980da19e943a9
* vim-patch:8.0.0388Matthew Malcomson2017-03-02
| | | | | | | | | | | | | | | | Fix a problem when filtering manually folded lines When foldMarkAdjustRecurse() is called to adjust folds that start inside the range of lines that are being moved and end outside that range, it calculates `amount_after` for its recursive call incorrectly. The calculation assumes that folds inside the changed range are being deleted, but this is not always the case. This means nested folds that start after the changed range of lines are shifted an incorrect amount. We fix this by calculating the `amount_after` differently if the folds inside the changed range are not being deleted.
* refactor: Remove strncpy/STRNCPY. (#6008)Justin M. Keyes2017-01-26
| | | | | | | | | | | | | | | Closes #731 References #851 Note: This does not remove some intentional legacy usages of strncpy. - memcpy isn't equivalent because it doesn't check the string length of `src`, and doesn't zero-out the remainder of `dst`. - xstrlcpy isn't equivalent because it doesn't zero-out the remainder of `dst`. Some Vim logic depends on that (e.g. ex_append which calls vim_strnsave). Helped-by: Douglas Schneider <ds3@ualberta.ca> Helped-by: oni-link <knil.ino@gmail.com> Helped-by: James McCoy <jamessan@jamessan.com>
* vim-patch:7.4.1909 (#5748)Shougo2016-12-10
| | | | | | Problem: Doubled semicolons. Solution: Reduce to one. (Dominique Pelle) https://github.com/vim/vim/commit/945ec093cd4ddefab930239990564b12eb232153
* folds: Do not auto-update folds for some foldmethods. #5426Shougo Matsushita2016-10-19
|
* insert_enter: Update folds on insert-leave. #5351Shougo Matsushita2016-09-18
| | | | | Fixes failing test: 045_folding_spec.lua References #5299
* perf: Skip foldUpdate() in insert-mode. #5299Shougo2016-09-16
| | | Closes #5270
* refactor: eliminate misc2.cJustin M. Keyes2016-09-13
| | | | | | | | | | move `call_shell` to misc1.c Move some fns to state.c Move some fns to option.c Move some fns to memline.c Move `vim_chdir*` fns to file_search.c Move some fns to new module, bytes.c Move some fns to fileio.c
* Linting.KillTheMule2016-04-23
|
* vim-patch:7.4.822KillTheMule2016-04-23
| | | | | | | | | | Problem: More problems reported by coverity. Solution: Avoid the warnings. (Christian Brabandt) https://github.com/vim/vim/commit/cde885473099296c4837de261833f48b24caf87c Applied manually. Files that do not exst anymore: gui.c gui_w16.c gui_w32.c if_xcmdsrv.c os_unix.c
* *: Make set_vim_var_\* functions have proper argument typesZyX2016-04-18
|
* complete: disable folding when completingAnmol Sethi2016-03-09
| | | | Fixes vim/vim#643
* vim-patch:7.4.700watiko2016-02-05
| | | | | | | | Problem: Fold can't be opened after ":move". (Ein Brown) Solution: Delete the folding information and update it afterwards. (Christian Brabandt) https://github.com/vim/vim/commit/d5f6933d5c57ea6f79bbdeab6c426cf66a393f33
* src/*: Remove `VIM - Vi improved ...` headerMichael Reed2015-11-27
| | | | | | | | | | | | | | | | | | | Regarding the individual items in the header: `Vim - Vi improved by Bram Moolenar` Bram Moolenar is already mentioned throughout the documentation, as well as the intro screen. `:help uganda` It's already shown to all users who don't use `shortmess+=I` upon starting nvim, and is already placed prominently in help.txt, i.e., `:help` run with no arguments. `:help credits` Already mentioned near the top of help.txt. `README.md` Already mentioned in develop.txt.
* src: README.txt -> README.mdMichael Reed2015-11-23
| | | | | The former no longer exists in this repo; see the top of src/nvim/README.md.
* hasFolding return bool nowNicolas Cornu2015-09-08
|
* hasFoldingWin now return boolNicolas Cornu2015-09-08
|
* vim-patch:7.4.699 #2508grtlr2015-04-25
| | | | | | | | Problem: E315 when trying to delete a fold. (Yutao Yuan) Solution: Make sure the fold doesn't go beyond the last buffer line. (Christian Brabandt) https://code.google.com/p/vim/source/detail?r=v7-4-699
* Replace VIM_ISDIGIT() and vim_isdigit() with ascii_isdigit() defined in ascii.hFelipe Oliveira Carvalho2015-04-24
|
* Replace vim_iswhite with ascii_iswhite() defined in ascii.hFelipe Oliveira Carvalho2015-04-24
|
* memory: Add `free` wrapper and refactor project to use itThiago de Arruda2015-04-13
| | | | | | We already use wrappers for allocation, the new `xfree` function is the equivalent for deallocation and provides a way to fully replace the malloc implementation used by Neovim.
* Enable -Wconversion: fold.c.Eliseo Martínez2015-04-07
| | | | | | | | | | | | Refactor summary: - foldinfo_T.fi_lnum: int --> linenr_T Reorder field for optimal packing. - foldAddMarker(..., markerlen): int --> size_t * foldstartmarkerlen: int --> size_t - foldDelMarker(..., markerlen): int --> size_t * foldendmarkerlen: int --> size_t Helped-by: oni-link <knil.ino@gmail.com>