aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
Commit message (Collapse)AuthorAge
...
* vim-patch:8.2.4865: :startinsert right after :stopinsert may not work (#18418)zeertzjq2022-05-05
| | | | | | Problem: :startinsert right after :stopinsert does not work when popup menu is still visible. Solution: Use ins_compl_active() instead of pum_visible(). (closes vim/vim#10352) https://github.com/vim/vim/commit/cd5dbad184e8235beb13dcd8a22302da09db9766
* refactor: replace char_u variables and functions with charDundar Goc2022-05-04
| | | | 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.
* vim-patch:8.1.2346: CTRL-R CTRL-R doesn't work with modifyOtherKeyszeertzjq2022-04-29
| | | | | | | | | Problem: CTRL-R CTRL-R doesn't work with modifyOtherKeys. Solution: Allow key codes when fetching argument for CTRL-R. (closes vim/vim#5266) Also fix CTRL-G in Insert mode. https://github.com/vim/vim/commit/38571a04b4eb2853f46df8884750bcb9a8115db8 Omit test as it sends terminal codes. Use a Lua test instead.
* vim-patch:8.2.0916: mapping with partly modifyOtherKeys code does not workzeertzjq2022-04-29
| | | | | | | | | | | | Problem: Mapping with partly modifyOtherKeys code does not work. Solution: If there is no mapping with a separate modifier include the modifier in the key and then try mapping again. (closes vim/vim#6200) https://github.com/vim/vim/commit/975a880a1389e8ce6dea8d66a7c109140b2f94ec Cherry-pick applicable part of put_string_in_typebuf(). Revert related changes from 10a5825. Use KEYLEN_PART_KEY for incomplete modifier sequence. Omit test as it sends terminal codes. Use a Lua test instead.
* revert: "refactor: Remove allow_keys global (#6346)"zeertzjq2022-04-29
|
* feat(edit): insert an unsimplified key using CTRL-SHIFT-Vzeertzjq2022-04-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This marks the following Vim patches as ported: vim-patch:8.1.2333: with modifyOtherKeys CTRL-^ doesn't work Problem: With modifyOtherKeys CTRL-^ doesn't work. Solution: Handle the exception. https://github.com/vim/vim/commit/828ffd596394f714270a01a55fc3f949a8bd9b35 vim-patch:8.1.2350: other text for CTRL-V in Insert mode with modifyOtherKeys Problem: Other text for CTRL-V in Insert mode with modifyOtherKeys. Solution: Convert the Escape sequence back to key as if modifyOtherKeys is not set, and use CTRL-SHIFT-V to get the Escape sequence itself. (closes vim/vim#5254) https://github.com/vim/vim/commit/fc4ea2a72d36de1196a3ce17352e72f8fe90f4bb vim-patch:8.2.2084: CTRL-V U doesn't work to enter a Unicode character Problem: CTRL-V U doesn't work to enter a Unicode character when modifyOtherKeys is effective. (Ken Takata) Solution: Add a flag to get_literal() for the shift key. (closes vim/vim#7413) https://github.com/vim/vim/commit/0684e36a7ee0743f2889698fb8e0e14f7acae423 Omit getcmdkeycmd() change as it depends on Vim patch 8.2.2062, which may introduce a potential breakage.
* refactor: convert macros to all-caps (#17895)dundargoc2022-04-24
| | | Closes https://github.com/neovim/neovim/issues/6297
* refactor: add pure attribute to pure functions (#18165)dundargoc2022-04-24
| | | | This will allow the compilers that support the pure attribute to make further optimizations.
* vim-patch:8.2.3226: new digraph functions use old naming schemezeertzjq2022-04-12
| | | | | | Problem: New digraph functions use old naming scheme. Solution: Use the digraph_ prefix. (Hirohito Higashi, closes vim/vim#8580) https://github.com/vim/vim/commit/29b857150c111a455f1a38a8f748243524f692e1
* vim-patch:8.2.4739: accessing freed memory after WinScrolled autocmd event ↵zeertzjq2022-04-12
| | | | | | | | (#18090) Problem: Accessing freed memory after WinScrolled autocmd event. Solution: Check the window pointer is still valid. (closes vim/vim#10156) Remove the argument from may_trigger_winscrolled(). https://github.com/vim/vim/commit/d58862d18f091d3c14fa3647e724ef7eea1ecefa
* vim-patch:8.2.4713: plugins cannot track text scrollingzeertzjq2022-04-12
| | | | | | | | Problem: Plugins cannot track text scrolling. Solution: Add the WinScrolled event. (closes vim/vim#10102) https://github.com/vim/vim/commit/0937182d49fa8db50cec42785f22f1031760a0bd Skip User event in autocmd.txt, not needed unless #10689 is reverted.
* vim-patch:8.2.4723: the ModeChanged autocmd event is inefficientzeertzjq2022-04-10
| | | | | | | | | Problem: The ModeChanged autocmd event is inefficient. Solution: Avoid allocating memory. (closes vim/vim#10134) Rename trigger_modechanged() to may_trigger_modechanged(). https://github.com/vim/vim/commit/2bf52dd065495cbf28e28792f2c2d50d44546d9f Make v:event readonly for ModeChanged.
* vim-patch:8.2.4710: smart indenting does not work after completion (#18030)zeertzjq2022-04-08
| | | | | Problem: Smart indenting does not work after completion. Solution: Set "can_si". (Christian Brabandt, closes vim/vim#10113, closes vim/vim#558) https://github.com/vim/vim/commit/ac72c21da696cf6c31630a9e5ff4c0d3e2049c11
* vim-patch:8.2.4707: redrawing could be a bit more efficient (#18022)zeertzjq2022-04-07
| | | | | Problem: Redrawing could be a bit more efficient. Solution: Optimize redrawing. (closes vim/vim#10105) https://github.com/vim/vim/commit/8c9796085071950f9a03ca0fe116608e4f86aac2
* vim-patch:8.2.4660: cursorcolumn is sometimes not correctzeertzjq2022-04-01
| | | | | | | Problem: Cursorcolumn is sometimes not correct. Solution: Recompute the cursor column when entering Insert mode and the cursor is on a character wider than a screen cell. https://github.com/vim/vim/commit/782c6744b49b30d9460ed00d4773666e42e07163
* 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.1.1693: syntax coloring and highlighting is in one big file (#17721)Lewis Russell2022-03-18
| | | | | | | | | | | Problem: Syntax coloring and highlighting is in one big file. Solution: Move the highlighting to a separate file. (Yegappan Lakshmanan, closes vim/vim#4674) https://github.com/vim/vim/commit/f9cc9f209ede9f15959e4c2351e970477c139614 Name the new file highlight_group.c instead. Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* chore: fix typos (#17670)dundargoc2022-03-17
| | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* refactor: fix clang-tidy bugprone-signed-char-misuse warningsDundar Göc2022-03-04
| | | | | Prefer to declare variables with correct type instead of explicit casts wherever possible.
* 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.3935: CTRL-U in Insert mode does not fix the indentzeertzjq2022-01-31
| | | | | | Problem: CTRL-U in Insert mode does not fix the indent. Solution: Fix the indent when 'cindent' is set. https://github.com/vim/vim/commit/5d20fbf2e79b96a39abbdadc486b656cdcc67ed6
* vim-patch:8.2.3932: C line comment not formatted properlyzeertzjq2022-01-31
| | | | | | | Problem: C line comment not formatted properly. Solution: If a line comment follows after "#if" the next line is not the end of a paragraph. https://github.com/vim/vim/commit/264d3ddac0f9474816c20a0e92014d6f7f4b08ac
* 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
* fix(completion): update submode message when selecting from API (#17022)zeertzjq2022-01-28
|
* Merge pull request #17191 from zeertzjq/vim-8.2.4203bfredl2022-01-27
|\ | | | | vim-patch:8.2.4203: entering a character with CTRL-V may include modifiers
| * vim-patch:8.2.4203: entering a character with CTRL-V may include modifierszeertzjq2022-01-25
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Entering a character with CTRL-V may include modifiers. Solution: Reset "mod_mask" when entering a character with digits after CTRL-V. (closes vim/vim#9610) https://github.com/vim/vim/commit/502d8ae3e8ed8b6f8dd2ff175f154f9aa87228ef Commenting out test_override() as before. Commenting out part of CheckNotFeature() because Vim patch 8.2.0427 cannot be ported without breaking a lot of oldtests that check for removed features.
* | 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 #17102 from zeertzjq/vim-8.2.1762bfredl2022-01-27
|\ \ \ | |_|/ |/| | vim-patch:8.2.1762: when a timer uses :stopinsert completion isn't stopped
| * | vim-patch:8.2.1762: when a timer uses :stopinsert completion isn't stoppedzeertzjq2022-01-15
| |/ | | | | | | | | | | | | Problem: When a timer uses :stopinsert Insert mode completion isn't stopped. (Stanley Chan) Solution: Call ins_compl_prep(ESC). https://github.com/vim/vim/commit/d0e1b7103c14eb0d175c6b245b4b6ed93a204da9
* / refactor: remove CSI unescaping and clean up related names and commentszeertzjq2022-01-21
|/
* feat(completion): support selecting item via API from Lua mappingzeertzjq2022-01-11
|
* fix(completion): prevent K_LUA from closing pumzeertzjq2022-01-10
|
* 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`.
* 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>
* fix: do not save K_EVENT as lastc in Insert modezeertzjq2021-12-26
| | | | I'm also gonna move some other K_EVENT-related tests to vim_spec.lua
* vim-patch:8.1.0040: warnings from 64-bit compilerVVKot2021-12-20
| | | | | | Problem: Warnings from 64-bit compiler. Solution: Add type casts. (Mike Williams) https://github.com/vim/vim/commit/e31e256ba1769a3a3ed7840d5cc9a01ab058b8bc
* 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 insertmode related function to edit.cBjörn Linse2021-12-10
|
* vim-patch:8.2.2014: using CTRL-O in a prompt buffer moves cursor to startSean Dewar2021-12-07
| | | | | | | | Problem: Using CTRL-O in a prompt buffer moves cursor to start of the line. Solution: Do not move the cursor when restarting edit. (closes vim/vim#7330) https://github.com/vim/vim/commit/ee8b787bcd15f63a938243770065e704c9b5c85f Test_prompt_editing is skipped, so edit the Lua test in prompt_buffer_spec.
* vim-patch:8.2.1976: cannot backspace in prompt buffer after using cursor-leftSean Dewar2021-12-07
| | | | | | | | | | | | Problem: Cannot backspace in prompt buffer after using cursor-left. (Maxim Kim) Solution: Ignore "arrow_used" in a prompt buffer. (closes vim/vim#7281) https://github.com/vim/vim/commit/6f6244855fbce5aaa718cd5001a29aac3c5c15d6 cmdchar_todo wasn't adapted properly for Nvim's state system, which caused it to be a dead store and such was removed in #11900. Re-introduce cmdchar_todo properly.
* vim-patch:8.1.0064: typing CTRL-W in a prompt buffer shows mode "-- --"Sean Dewar2021-12-07
| | | | | | | | | | | | | | | | Problem: Typing CTRL-W in a prompt buffer shows mode "-- --". Solution: Set restart_edit to 'A' and check for it. https://github.com/vim/vim/commit/942b4541a2d8e8df8369ab70e112dbbbe0c7c0aa Nvim already checked for 'i' in showmode(), so this bug was fixed with <C-W> (though this patch now changes <C-W> to use 'A'). However, the missing changes I ported for v8.1.0036 use 'A' when a callback leaves the window in insert mode and edit gets restarted, so this bug was possible there. Modify showmode() restart_edit condition to match v8.2.1978: https://github.com/vim/vim/commit/957cf67d50516ba98716f59c9e1cb6412ec1535d
* vim-patch:8.1.0035: not easy to switch between prompt buffer and other windowsSean Dewar2021-12-07
| | | | | | | | | | | | Problem: Not easy to switch between prompt buffer and other windows. Solution: Accept CTRL-W commands in Insert mode. Start and stop Insert mode as one would expect. https://github.com/vim/vim/commit/6d41c78e353b630bc1a72cbff9160311d2a81e8c Cherry-pick channel.txt change from: https://github.com/vim/vim/commit/d2f3a8b8787333abf2300d38836b196955f10c00 b_prompt_insert was already ported.
* lint (#16526)Jan Edmund Lazo2021-12-05
|
* Merge pull request #16411 from dundargoc/refactor/upgrade-uncrustifyBjörn Linse2021-12-04
|\ | | | | refactor: upgrade uncrustify config version to 0.74.0
| * refactor: upgrade uncrustify config version to 0.74.0Dundar Göc2021-11-23
| | | | | | | | | | Disable formatting for assert.h since there's a bug that results in a segmentation fault in uncrustify.
* | 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