aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
Commit message (Collapse)AuthorAge
* 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: remove redundant check for w_p_cole (#17944)zeertzjq2022-04-01
| | | No longer needed after #17890.
* perf: only redraw concealed line if cursor has moved horizontallyzeertzjq2022-03-28
| | | | | Building upon #17889, this moves conceal redrawing logic into move.c, so that concealed line is only redrawn if cursor has moved horizontally.
* vim-patch:8.2.4638: superfluous check if a redraw is needed for 'cursorline'zeertzjq2022-03-28
| | | | | | | | | Problem: Superfluous check if a redraw is needed for 'cursorline'. Solution: Remove check_redraw_cursorline(). (closes vim/vim#10030, closes vim/vim#10029) https://github.com/vim/vim/commit/3e559cd88486ffab6b6fb4e0921b4600d137a617 redraw_after_callback() is N/A. Omits changes that just revert code from patch 8.2.4630.
* vim-patch:8.2.4591: cursor line not updated when a callback moves the cursorzeertzjq2022-03-24
| | | | | | | | Problem: Cursor line not updated when a callback moves the cursor. Solution: Check if the cursor moved. (closes vim/vim#9970) https://github.com/vim/vim/commit/e7a74d53754765f22ef8ce71c915bb669d5f7f3f redraw_after_callback() is N/A. Nvim handles timers on the main loop.
* vim-patch:8.2.1401: cannot jump to the last used tabpageSean Dewar2022-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Cannot jump to the last used tabpage. Solution: Add g<Tab> and tabpagnr('#'). (Yegappan Lakshmanan, closes vim/vim#6661, neovim #11626) https://github.com/vim/vim/commit/62a232506d06f6d1b3b7271801c907d6294dfe84 Nvim implemented this feature before Vim, but Vim made some useful changes (e.g: beeping on failure). Port the changes to closer match Vim (also makes porting future patches easier). Also note that because CHECK_CMDWIN was added to goto_tabpage_tp, there is no need to do the extra work with tabpage_index and goto_tabpage inside goto_tabpage_lastused to fix cmdwin issues any more (#11692). Note that while goto_tabpage_tp doesn't check for textlock like goto_tabpage does, it shouldn't matter as it is already checked for earlier. Add tags for <C-Tab> to tabpage.txt, and refer to <C-Tab> over CTRL-Tab to be consistent with other docs like the patch. Remove mention of "previous tabpage" (it can be confused with the tabpage to the left, e.g: `:tabprevious`). Similarly, don't rename old_curtab to last_tab in enter_tabpage (it might be confused with the right-most tabpage, e.g: `:tablast`). Cherry-pick Test_tabpage change from v8.2.0634. https://github.com/vim/vim/commit/92b83ccfda7a1d654ccaaf161a9c8a8e01fbcf76
* fix(coverity): dead code and operands don't affect result #17662dundargoc2022-03-11
| | | | | | | | | | | | | | | | | | | | | * fix(coverity/349942): structurally dead code * fix(coverity/331396): operands don't affect result * fix(coverity/331393): operands don't affect result * fix(coverity/331392): operands don't affect result * fix(coverity/331384): operands don't affect result * fix(coverity/331374): operands don't affect result * fix(coverity/331372): operands don't affect result * fix(coverity/331371): operands don't affect result * fix(coverity/331364): operands don't affect result * fix(coverity/105585): operands don't affect result
* chore(lgtm): fix "empty block without comment" warningsDundar Göc2022-03-09
|
* vim-patch:8.2.3660: overflow check uses wrong numberzeertzjq2022-02-18
| | | | | | Problem: Overflow check uses wrong number. Solution: Divide by ten. https://github.com/vim/vim/commit/9b0e82f35ed4e98414333e71b71ca56219683d16
* vim-patch:8.2.3659: integer overflow with large line numberzeertzjq2022-02-18
| | | | | | | | | Problem: Integer overflow with large line number. Solution: Check for overflow. (closes vim/vim#9202) https://github.com/vim/vim/commit/03725c5795ae5b8c14da4a39cd0ce723c6dd4304 Put E1247 in globals.h as E1240 is also there. Do not make getdigits() abort.
* vim-patch:8.2.4242: put in Visual mode cannot be repeatedzeertzjq2022-02-09
| | | | | | | | | | Problem: Put in Visual mode cannot be repeated. Solution: Use "P" to put without yanking the deleted text into the unnamed register. (Shougo Matsushita, closes vim/vim#9591) https://github.com/vim/vim/commit/fb55207ed17918c8a2a6cadf5ad9d5fcf686a7ab Cherry-pick get_y_previous() and set_y_previous() from patch 8.1.1736. Nvim has removed y_current, so code related to it is N/A.
* vim-patch:8.2.3583: the "gd" and "gD" commands do not update search statszeertzjq2022-02-04
| | | | | | | Problem: The "gd" and "gD" commands do not update search stats. (Gary Johnson) Solution: Clear search stats. https://github.com/vim/vim/commit/0c71114aede81a209b7efc126b4bf19f11d58955
* Merge pull request #17226 from dundargoc/refactor/remove-redundant-codezeertzjq2022-02-03
|\ | | | | vim-patch:8.2.4241: some type casts are redundant
| * vim-patch:8.2.4241: some type casts are redundantDundar Göc2022-01-30
| | | | | | | | | | | | | | | | Problem: Some type casts are redundant. Solution: Remove the type casts. (closes vim/vim#9643) https://github.com/vim/vim/commit/420fabcd4ffeaf79082a6e43db91e1d363f88f27 This is not a literal port but an equivalent one.
* | vim-patch:8.2.4273: the EBCDIC support is outdatedzeertzjq2022-02-01
| | | | | | | | | | | | | | | | | | | | | | Problem: The EBCDIC support is outdated. Solution: Remove the EBCDIC support. https://github.com/vim/vim/commit/424bcae1fb0f69e0aef5e0cf84fd771cf34a0fb7 Also remove a comment in buf_init_chartab() as it is for enc_dbcs only. Skip test_expr.vim: the check was already removed when patch 7.4.2265 was first ported.
* | vim-patch:8.2.3787: no proper formatting of a C line comment after a statementzeertzjq2022-01-31
|/ | | | | | | Problem: No proper formatting of a C line comment after a statement. Solution: Find the start of the line comment, insert the comment leader and indent the comment properly. https://github.com/vim/vim/commit/6e371ecb27227ff8fedd8561d0f3880a17576848
* vim-patch:8.2.4237: record buffer wrong if character in Select mode was not ↵zeertzjq2022-01-28
| | | | | | | | | typed Problem: Record buffer wrong if character in Select mode was not typed. Solution: Only delete the tail from the record buffer if the character was typed. (closes vim/vim#9650) https://github.com/vim/vim/commit/fbf4f1ca159028382eaeb3bfc31bb6bb96dbb67a
* vim-patch:8.2.3903: "gM" does not count tabs as expected (#16796)zeertzjq2022-01-28
|
* Merge pull request #17185 from zeertzjq/vim-8.2.3993bfredl2022-01-27
|\ | | | | vim-patch:8.2.{3993,4002}: when recording a change in Select mode char appears twice
| * vim-patch:8.2.3993: when recording a change in Select mode char appears twicezeertzjq2022-01-24
| | | | | | | | | | | | | | | | Problem: When recording a change in Select mode the first typed character appears twice. Solution: When putting the character back into typeahead remove it from recorded characters. (closes vim/vim#9462) https://github.com/vim/vim/commit/c88e977862ba6477a3b5b28706c45f96069a3073
* | Merge pull request #17166 from Shougo/vim-8.2.4160bfredl2022-01-27
|\ \ | | | | | | vim-patch:8.2.4160: cannot change the register used for Select mode d…
| * | vim-patch:8.2.4160: cannot change the register used for Select mode deleteShougo Matsushita2022-01-22
| | | | | | | | | | | | | | | | | | | | | Problem: Cannot change the register used for Select mode delete. Solution: Make CTRL-R set the register to be used when deleting text for Select mode. (Shougo Matsushita, closes vim/vim#9531) https://github.com/vim/vim/commit/4ede01f18884961f2e008880b4964e5d61ea5c36
* | | Merge pull request #17131 from zeertzjq/vim-8.2.3580bfredl2022-01-27
|\ \ \ | | | | | | | | vim-patch:8.2.3580: gj does not move properly with a wide character
| * | | vim-patch:8.2.3580: gj does not move properly with a wide characterzeertzjq2022-01-18
| |/ / | | | | | | | | | | | | | | | Problem: gj does not move properly with a wide character. Solution: Move one to the right. (Christian Brabandt, closes vim/vim#8702) https://github.com/vim/vim/commit/aaec1d4fb12efb82b87ad322e95994de77b1a833
* | | Merge pull request #17095 from zeertzjq/vim-8.2.3227bfredl2022-01-27
|\ \ \ | | | | | | | | vim-patch:8.2.{3227,3280,4094}: global-local 'virtualedit'
| * | | vim-patch:8.2.3227: 'virtualedit' can only be set globallyzeertzjq2022-01-15
| |/ / | | | | | | | | | | | | | | | | | | | | | Problem: 'virtualedit' can only be set globally. Solution: Make 'virtualedit' global-local. (Gary Johnson, closes vim/vim#8638) https://github.com/vim/vim/commit/53ba05b09075f14227f9be831a22ed16f7cc26b2 I changed some macros to unsigned integer literals to avoid compiler warnings.
* | | Merge pull request #17132 from zeertzjq/vim-8.2.3611Christian Clason2022-01-26
|\ \ \ | |_|/ |/| | vim-patch:8.2.{3494,3611,3613}: two Visual mode crash fixes
| * | vim-patch:8.2.3611: crash when using CTRL-W f without finding a file namezeertzjq2022-01-18
| | | | | | | | | | | | | | | | | | Problem: Crash when using CTRL-W f without finding a file name. Solution: Bail out when the file name length is zero. https://github.com/vim/vim/commit/615ddd5342b50a6878a907062aa471740bd9a847
| * | vim-patch:8.2.3494: illegal memory access in utf_head_offzeertzjq2022-01-18
| |/ | | | | | | | | | | | | | | | | Problem: Illegal memory access in utf_head_off. Solution: Check cursor position when reselecting the Visual area. (closes vim/vim#8963) https://github.com/vim/vim/commit/b07626d4afa73dd2af0f03c0d59eed25ee159ef9 Including the XTest_beval -> XTest_block from patch 8.2.3096.
* / fix(input): put modifiers back into typeahead buffer when neededzeertzjq2022-01-23
|/
* fix(keywordprg): retain terminal buffer after K (#17046)Daniel Steinberg2022-01-12
|
* feat(api): add support for lua function & description in keymapshadmansaleh2022-01-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Behavioral changes: 1. Added support for lua function in keymaps in -------------------------------------------- - nvim_set_keymap Can set lua function as keymap rhs like following: ```lua vim.api.nvim_{buf_}set_keymap('n', '<leader>lr', '', {callback = vim.lsp.buf.references}) ``` Note: lua function can only be set from lua . If api function being called from viml or over rpc this option isn't available. - nvim_{buf_}get_keymap When called from lua, lua function is returned is `callback` key . But in other cases callback contains number of the function ref. - :umap, nvim_del_keymap & nvim_buf_del_keymap clears lua keymaps correctly. - :map commands for displaing rhs . For lua keymaps rhs is displayed as <Lua function ref_no> Note: lua keymap cannot be set through viml command / functions. - mapargs() When dict is false it returns string in `<Lua function ref_no>` format (same format as :map commands). When dict is true it returns ref_no number in `callback` key. - mapcheck() returns string in `<Lua function ref_no>` format (same format as :map commands). 2. Added support for keymap description --------------------------------------- - nvim_{buf_}set_keymap: added `desc` option in opts table . ```lua vim.api.nvim_set_keymap('n', '<leader>w', '<cmd>w<cr>', {desc='Save current file'}) ``` - nvim_{buf_}get_keymap: contains `desc` in returned list. - commands like `:nmap <leader>w` will show description in a new line below rhs. - `maparg()` return dict contains `desc`.
* feat(autocmd): add Recording autocmdsThomas Vigouroux2021-12-18
| | | | | | | | | | | | | | feat(eval): add reg_recorded() This function is used the get the last recorded register. style(Recording): rename handler to match suggestions fix(RecordingLeave): send autocommand earlier This makes the autocommand fire just before setting reg_recorded to reg_recording, this way we clearly show that we are actually just before actually quitting the recording mode.
* 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.
* vim-patch:8.1.2104: the normal.c file is too big (#16389)Volodymyr Kot2021-12-06
| | | | | | Problem: The normal.c file is too big. Solution: Move do_pending_operator() to ops.c. (Yegappan Lakshmanan, closes vim/vim#4999). https://github.com/vim/vim/commit/792cf5e1bec04c6d6d70cfbb9ef24c798b469731
* Merge pull request #15840 from vimpostor/vim-8.2.3430Jan Edmund Lazo2021-11-30
|\ | | | | vim-patch:8.2.{3430,3434,3462,3463,3555,3609,3610}: ModeChanged autocmd
| * vim-patch:8.2.3610: crash when ModeChanged triggered too earlyMagnus Groß2021-11-18
| | | | | | | | | | | | Problem: Crash when ModeChanged triggered too early. Solution: Trigger ModeChanged after setting VIsual. https://github.com/vim/vim/commit/a062006b9de0b2947ab5fb376c6e67ef92a8cd69
| * vim-patch:8.2.3555: ModeChanged is not triggered on every mode changeMagnus Groß2021-11-18
| | | | | | | | | | | | Problem: ModeChanged is not triggered on every mode change. Solution: Also trigger on minor mode changes. (Maguns Gross, closes vim/vim#8999) https://github.com/vim/vim/commit/25def2c8b8bd7b0c3d5f020207c717a880b05d50
| * vim-patch:8.2.3430: no generic way to trigger an autocommand on mode changeMagnus Groß2021-11-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: No generic way to trigger an autocommand on mode change. Solution: Add the ModeChanged autocommand event. (Magnus Gross, closes vim/vim#8856) https://github.com/vim/vim/commit/f1e8876fa2359b572d262772747405d3616db670 N/A patches for version.c: vim-patch:8.2.3434: function prototype for trigger_modechanged() is incomplete Problem: Function prototype for trigger_modechanged() is incomplete. Solution: Add "void". https://github.com/vim/vim/commit/28e591dd5080bbcd0f468f9d9597cedb716e28c9 Fixes #4399. Fixes #7416.
* | 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
* refactor(multibyte): eliminate mb_ptr2len alias for utfc_ptr2lenBjörn Linse2021-11-14
|
* vim-patch:8.1.0779: argument for message functions is inconsistentJames McCoy2021-11-01
| | | | | | Problem: Argument for message functions is inconsistent. Solution: Make first argument to msg() "char *". https://github.com/vim/vim/commit/32526b3c1846025f0e655f41efd4e5428da16b6c
* 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
* refactor: saner options for uncrustify #16196dundargoc2021-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * refactor: general good option changes sp_deref = remove sp_not = remove sp_inv = remove sp_inside_paren_cast = remove mod_remove_duplicate_include = true sp_after_semi = add sp_after_semi_for = force sp_sizeof_paren = remove nl_return_expr = remove nl_else_brace = remove nl_else_if = remove * refactor: mod_remove_extra_semicolon = true * refactor: nl_max = 3 * refactor: sp_bool = force * refactor: sp_compare = force * refactor: sp_inside_paren = remove * refactor: sp_paren_paren = remove * refactor: sp_inside_sparen = remove * refactor: sp_before_sparen = force * refactor: sp_sign = remove * refactor: sp_addr = remove * refactor: sp_member = remove * refactor: nl_struct_brace = remove * refactor: nl_before_if_closing_paren = remove * refactor: nl_fdef_brace = force * refactor: sp_paren_comma = force * refactor: mod_full_brace_do = add
* vim-patch:8.1.2392: 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/6e0ce171e19d0118ecd7c2b16e2a1bd50aa76013
* vim-patch:8.2.3537: wrong mode() during 'operatorfunc' #16087zeertzjq2021-10-19
| | | | | Problem: mode() does not return the right value in 'operatorfunc'. Solution: Reset finish_op while calling 'operatorfunc'. https://github.com/vim/vim/commit/75c30e96cf280a8cc01ac01c41a9252db3e503cc
* vim-patch:8.1.2392: 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/6e0ce171e19d0118ecd7c2b16e2a1bd50aa76013
* 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(style): switch-case formatting, "uncrustify:indent-off" #15669dundargoc2021-09-17
| | | | | | * refactor: disable formatting for attribute in macro * fixup: disable/enable uncrustify with uncrustify:indent-off/on * fixup: stop indenting contents inside braces in case * fixup: remove case brace if no variable declaration