aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
Commit message (Collapse)AuthorAge
...
* extmarks/bufhl: reimplement using new marktree data structureBjörn Linse2020-01-16
| | | | | | | | | | | | | | | | | | | | Add new "splice" interface for tracking buffer changes at the byte level. This will later be reused for byte-resolution buffer updates. (Implementation has been started, but using undocumented "_on_bytes" option now as interface hasn't been finalized). Use this interface to improve many edge cases of extmark adjustment. Changed tests indicate previously incorrect behavior. Adding tests for more edge cases will be follow-up work (overlaps on_bytes tests) Don't consider creation/deletion of marks an undoable event by itself. This behavior was never documented, and imposes complexity for little gain. Add nvim__buf_add_decoration temporary API for direct access to the new implementation. This should be refactored into a proper API for decorations, probably involving a huge dict. fixes #11598
* edit.c: Ensure undo sync when emulating <Esc>x #11706Matthew Malcomson2020-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | After PR #8226 an unmapped META key in insert mode behaves like ESC-<key> (:help i_META). The behaviour does not fully match, since if <Esc>-<key> is pressed manually then since it were pressed manually `gotchars` would be called on the second <key> after insert-mode had already been left. This would mean that `may_sync_undo` (called from `gotchars`) would call `u_sync(FALSE)` on the second key (since we would be in normal mode). This overall means that <Meta-[something]> behaves differently with respect to undo than <Esc>[something] when the [something] makes a change. As an example, under `nvim -u NONE`: ihello<M-.>u leaves the buffer empty, while ihello<Esc>.u leaves the buffer with one instance of `hello`. - Fix by calling u_sync() manually in the new clause under `normalchar:` in `insert_handle_key`. - Update test in tui_spec.lua that accidentally relied on the old behaviour.
* vim-patch:8.0.1356: using simalt in a GUIEnter autocommand inserts charactersJan Edmund Lazo2019-12-30
| | | | | | | Problem: Using simalt in a GUIEnter autocommand inserts strange characters. (Chih-Long Chang) Solution: Ignore K_NOP in Insert mode. (closes vim/vim#2379) https://github.com/vim/vim/commit/c5aa55db7e5bc791f99fb15b0f4be0d5dd166f62
* refactor: use inserted_bytes pattern from vimBjörn Linse2019-11-23
| | | | | | | This covers all "small" inserts and deletes in insert mode, as well as a few more cases like small normal mode deletes vim-patch:8.1.0678: text properties as not adjusted for inserted text
* bufhl: use extmark column adjustment for bufhlBjörn Linse2019-11-23
| | | | | | | | NB: this is not the final implementation. Bufhl should be made a part of the extmark tree, so that "start" adjustment just works automatically. But "stop" will still need some ad-hoc trickery, until extended marks natively support ranges (hopefully sooner than forever).
* vim-patch:8.0.1449: slow redrawing with DirectXJan Edmund Lazo2019-11-19
| | | | | | | Problem: Slow redrawing with DirectX. Solution: Avoid calling gui_mch_flush() unnecessarily, especially when updating the cursor. (Ken Takata, closes vim/vim#2560) https://github.com/vim/vim/commit/a338adcf222b6a24e26ea5ae6a2ad27f914acb38
* nsmarks: initial committimeyyy2019-11-11
|
* vim-patch:8.1.2173: searchit() has too many argumentsJaehwang Jerry Jung2019-10-27
| | | | | | Problem: Searchit() has too many arguments. Solution: Move optional arguments to a struct. Add the "wrapped" argument. https://github.com/vim/vim/commit/92ea26b925a0835badb0af2d5887238a4198cabb
* Merge #11199 from bobrippling/vim-8.1.1228Justin M. Keyes2019-10-22
|\ | | | | vim-patch:8.1.{1099,1228,1962} add 'tagfunc'
| * vim-patch:8.1.1228: not possible to process tags with a functionRob Pilling2019-10-22
| | | | | | | | | | | | Problem: Not possible to process tags with a function. Solution: Add tagfunc() (Christian Brabandt, Andy Massimino, closes vim/vim#4010) https://github.com/vim/vim/commit/45e18cbdc40afd8144d20dcc07ad2d981636f4c9
* | vim-patch:8.1.2096: too many #ifdefs #11229Daniel Hahler2019-10-17
|/ | | | | | | Problem: Too many #ifdefs. Solution: Graduate FEAT_COMMENTS. https://github.com/vim/vim/commit/8c96af9c05bfcac2d5ae081e098d4863db561511 Fixes https://github.com/vim/vim/issues/4972.
* vim-patch:8.0.1806: InsertCharPre causes problems for autocompleteJan Edmund Lazo2019-09-02
| | | | | | | Problem: InsertCharPre causes problems for autocomplete. (Lifepillar) Solution: Check for InsertCharPre before calling vpeekc(). (Christian Brabandt, closes vim/vim#2876) https://github.com/vim/vim/commit/39de95257714b76ccd845d081cff57830a79b488
* vim-patch:8.1.0233: "safe" argument of call_vim_function() is always FALSEJan Edmund Lazo2019-08-30
| | | | | | Problem: "safe" argument of call_vim_function() is always FALSE. Solution: Remove the argument. https://github.com/vim/vim/commit/ded27a1febda3db7447958b60a7d791af514d124
* clang/"null pointer dereference" #10864Ihor Antonov2019-08-27
|
* clang/"dereference of null pointer" #10856Ihor Antonov2019-08-26
| | | In edit.c insert_execute calls ins_compl_addfrommatch
* Merge #10823 from janlazo/vim-8.1.1124Justin M. Keyes2019-08-21
|\
| * edit: add nonnull func attributeJan Edmund Lazo2019-08-21
| |
| * edit: compl_started,compl_used_match are boolJan Edmund Lazo2019-08-21
| |
| * vim-patch:8.1.1124: insert completion flags are mixed upJan Edmund Lazo2019-08-21
| | | | | | | | | | | | Problem: Insert completion flags are mixed up. Solution: Clean up flags use of ins_compl_add() and cp_flags. https://github.com/vim/vim/commit/d9eefe3155277cec71105f52d34a76f7a3237e7f
* | vim-patch:8.1.0888: the a: dict is not immutable as documented (#10819)Abdelhakeem Osama2019-08-21
|/ | | | | | Problem: The a: dict is not immutable as documented. Solution: Make the a:dict immutable, add a test. (Ozaki Kiichi, Yasuhiro Matsumoto, closes vim/vim#3929) https://github.com/vim/vim/commit/31b816042fca879b11965ddd75287732563ba698
* clang/"null pointer dereference" #10776Ihor Antonov2019-08-14
| | | assert(curbuf) in ins_compl_get_exp
* clang/"null pointer dereference" #10755Ihor Antonov2019-08-13
|
* includesDaniel Hahler2019-08-07
|
* Merge #10615 'vim-patch:8.1.0053'Justin M. Keyes2019-07-29
|\ | | | | fix #10604
| * vim-patch:8.1.0053 use typval_T in the caller of call_vim_functioncangscop2019-07-29
| | | | | | | | | | | | Problem: unreliable types for complete function arguments Solution: fix argument type for functions w/ unreliable type conversion(Ozaki Kiichi) vim/vim#2993
| * vim-patch:8.1.53 use typval_T in the caller of call_vim_functioncangscop2019-07-27
| | | | | | | | | | | | Problem: unreliable types for complete function arguments Solution: fix argument type for functions w/ unreliable type conversion(Ozaki Kiichi) vim/vim#2993
* | vim-patch:8.1.1138: add CompleteChanged #10644Justin M. Keyes2019-07-29
| | | | | | | | | | | | (This was originally a Neovim patch, but this commit merges some changes from the Vim patch.) https://github.com/vim/vim/commit/d7f246c68cfb97406bcd4b098a2df2d870b3ef92
* | clang/"dead assignments" #10620Bartosz Miera2019-07-29
|/ | | | Also revert possibly-wrong change in f_sign_getplaced() from 652be3cb0040.
* cleanup: remove mch_fopen in favor of os_fopenJustin M. Keyes2019-07-25
|
* Fix missing CursorHoldI events (#3758)Daniel Hahler2019-07-16
| | | Fixes https://github.com/neovim/neovim/issues/3757.
* vim-patch:8.0.1482: using feedkeys() does not work to test completionJan Edmund Lazo2019-06-24
| | | | | | | | Problem: Using feedkeys() does not work to test Insert mode completion. (Lifepillar) Solution: Do not check for typed keys when executing :normal or feedkeys(). Fix thesaurus completion not working when 'complete' is empty. https://github.com/vim/vim/commit/02ae9b4a93deea4993d7abe20485f91f1cce5e36
* vim-patch:8.0.1479: insert mode completion state is confusingJan Edmund Lazo2019-06-23
| | | | | | Problem: Insert mode completion state is confusing. Solution: Move ctrl_x_mode into edit.c. Add CTRL_X_NORMAL for zero. https://github.com/vim/vim/commit/bc0e9adae9c253f36803665180e4b576d1e725ab
* vim-patch:8.1.1055: CTRL-G U in Insert mode doesn't work for shift-LeftJan Edmund Lazo2019-06-23
| | | | | | | | Problem: CTRL-G U in Insert mode doesn't work to avoid splitting the undo sequence for shift-left and shift-right. Solution: Also check dont_sync_undo for shifted cursor keys. (Christian Brabandt) https://github.com/vim/vim/commit/75bf3d22f42684beecd977f3185e98045b5c33d9
* vim-patch:8.1.0242: Insert mode completion may use an invalid buffer pointerJan Edmund Lazo2019-06-23
| | | | | | Problem: Insert mode completion may use an invalid buffer pointer. Solution: Check for ins_buf to be valid. (closes vim/vim#3290) https://github.com/vim/vim/commit/02ab97709d5c56fb7fe42e134bb9fc54f76a1f9f
* vim-patch:8.1.0629: "gn" selects the wrong text with a multi-line matcherw72019-06-04
| | | | | | Problem: "gn" selects the wrong text with a multi-line match. Solution: Get the end position from searchit() directly. (closes vim/vim#3695) https://github.com/vim/vim/commit/5d24a2257e597fd752e33b2c1e9c19cf9114a517
* vim-patch:8.1.0020: cannot tell whether a register is executing or recordingJan Edmund Lazo2019-05-26
| | | | | | | | | Problem: Cannot tell whether a register is being used for executing or recording. Solution: Add reg_executing() and reg_recording(). (Hirohito Higashi, closes vim/vim#2745) Rename the global variables for consistency. Store the register name in reg_executing. https://github.com/vim/vim/commit/0b6d911e5de1a1c10a23d4c2ee1b0275c474a2dd
* lintAndrej Zieger2019-05-26
|
* lintJustin M. Keyes2019-05-25
|
* vim-patch:8.0.1496: VIM_CLEAR()Justin M. Keyes2019-05-25
| | | | | | | | Problem: Clearing a pointer takes two lines. Solution: Add VIM_CLEAR() and replace vim_clear(). (Hirohito Higashi, closes #2629) vim-patch:8.0.1481
* build: fix warningJustin M. Keyes2019-04-07
|
* vim-patch:8.1.1123: avoid filtering autocompleteroxma2019-04-07
| | | | | | | | | | | Author: roxma <roxma@qq.com> Problem: No way to avoid filtering for autocomplete function, causing flickering of the popup menu. Solution: Add the "equal" field to complete items. (closes vim/vim#3887) https://github.com/vim/vim/commit/73655cf0ca37a9aa8f56fc51bb853a8b1f7b43d4 closes #9566
* PVS/V560: expression is always trueJustin M. Keyes2019-04-01
|
* clang/"null pointer dereference": insert_executeJustin M. Keyes2019-04-01
|
* Merge #9807 from mhinz/window-local-last-cursormovedMarco Hinz2019-03-31
|\
| * cursormoved: make global last_cursormoved window-localMarco Hinz2019-03-29
| | | | | | | | Fixes https://github.com/neovim/neovim/issues/9755
* | autocmd: rename MenuPopupChanged to CompleteChanged #9819Qiming zhao2019-03-31
| |
* | complete_info(): fix null referenceJustin M. Keyes2019-03-30
| |
* | Merge #9815 'vim-patch:8.1.1068: complete_info()'Justin M. Keyes2019-03-30
|\ \ | |/ |/|
| * vim-patch:8.1.1068: cannot get all the information about current completionShougo Matsushita2019-03-30
|/ | | | | | Problem: Cannot get all the information about current completion. Solution: Add complete_info(). (Shougo, Hirohito Higashi, closes vim/vim#4106) https://github.com/vim/vim/commit/fd133323d4e1cc9c0e61c0ce357df4d36ea148e3
* signs: support multiple columns #9295Dan Aloni2019-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | closes #990 closes #9295 - Support for multiple auto-adjusted sign columns. With this change, having more than one sign on a line, and with the 'auto' setting on 'signcolumn', extra columns will shown automatically to accomodate all the existing signs. For example, suppose we have this view: 5147 } 5148 5149 return sign->typenr; 5150 } 5151 } 5152 return 0; 5153 } 5154 We have GitGutter installed, so it tells us about modified lines that are not commmited. So let's change line 5152: 5147 } 5148 5149 return sign->typenr; 5150 } 5151 } ~ 5152 return 0; 5153 } 5154 Now we add a mark over line 5152 using 'ma' in normal mode: 5147 } 5148 5149 return sign->typenr; 5150 } 5151 } a ~ 5152 return 0; 5153 } 5154 Previously, Vim/Nvim would have picked only one of the signs, because there was no support for having multiple signs in a line. - Remove signs from deleted lines. Suppose we have highlights on a group of lines and we delete them: + 6 use std::ops::Deref; --+ 7 use std::borrow::Cow; --+ 8 use std::io::{Cursor}; 9 use proc_macro2::TokenStream; 10 use syn::export::ToTokens; --+ 11 use std::io::Write; >> 12 use std::ops::Deref; Without this change, these signs will momentarily accumulate in the sign column until the plugins wake up to refresh them. + --+ --+ --+ >> 6 Discussion: It may be better to extend the API a bit and allow this to happen for only certain types of signs. For example, VIM marks and vim-gitgutter removal signs may want to be presreved, unlike line additions and linter highlights. - 'signcolumn': support 'auto:NUM' and 'yes:NUM' settings - sort signs according to id, from lowest to highest. If you have git-gutter, vim-signature, and ALE, it would appear in this order: git-gutter - vim-signature - ALE. - recalculate size before screen update - If no space for all signs, prefer the higher ids (while keeping the rendering order from low to high). - Prevent duplicate signs. Duplicate signs were invisible to the user, before using our extended non-standard signcolumn settings. - multi signcols: fix bug related to wrapped lines. In wrapped lines, the wrapped parts of a line did not include the extra columns if they existed. The result was a misdrawing of the wrapped parts. Fix the issue by: 1. initializing the signcol counter to 0 when we are on a wrap boundary 2. allowing for the draw of spaces in that case.