aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
Commit message (Collapse)AuthorAge
...
* refactor!: delete insertmode (#18547)Gregory Anders2022-05-22
| | | | | | | Neovim already removed `evim` (or any similar flags). The 'insertmode' option is a weird remnant, so get rid of it. The 'insertmode' option is replaced with a script that closely emulates the option. This script is documented at :help 'insertmode'
* vim-patch:8.2.4993: smart/C/lisp indenting is optional (#18684)zeertzjq2022-05-22
| | | | | | Problem: smart/C/lisp indenting is optional, which makes the code more complex, while it only reduces the executable size a bit. Solution: Graduate FEAT_CINDENT, FEAT_SMARTINDENT and FEAT_LISP. https://github.com/vim/vim/commit/8e145b82464a21ee4fdf7948f04e2a1d505f8bfa
* refactor: grid->rows and grid->colsbfredl2022-05-18
|
* vim-patch:8.2.4969: changing text in Visual mode may cause invalid memory accesszeertzjq2022-05-17
| | | | | | Problem: Changing text in Visual mode may cause invalid memory access. Solution: Check the Visual position after making a change. https://github.com/vim/vim/commit/7ce5b2b590256ce53d6af28c1d203fb3bc1d2d97
* 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.4953: with 'si' inserting '}' after completion goes wrongzeertzjq2022-05-14
| | | | | | Problem: With 'smartindent' inserting '}' after completion goes wrong. Solution: Check the cursor is in indent. (closes vim/vim#10420) https://github.com/vim/vim/commit/2e444bbef0f36535bf941f007f2961f3f66bbe87
* vim-patch:8.2.4951: smart indenting done when not enabledzeertzjq2022-05-14
| | | | | | Problem: Smart indenting done when not enabled. Solution: Check option values before setting can_si. (closes vim/vim#10420) https://github.com/vim/vim/commit/de5cf287812510d2c8ffe66b99cf33c4e1a6e6f1
* Merge pull request #18489 from dundargoc/refactor/remove-char_ubfredl2022-05-13
|\ | | | | refactor: replace char_u variables and functions with char
| * refactor: replace char_u variables and functions with charDundar Goc2022-05-11
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
* | refactor: rename keymap.{c,h} to keycodes.{c,h} (#18535)zeertzjq2022-05-12
|/ | | | | | | | Most code in keymap.h is for keycode definitions, while most code in keymap.c is for the parsing and conversion of keycodes. The name "keymap" may also make people think these two files are for mappings, while in fact keycodes are used even when no mappings are involved, so "keycodes" should be a better file name than "keymap".
* 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
* vim-patch:8.2.4908: no text formatting for // comment after a statement (#18472)zeertzjq2022-05-08
| | | | | Problem: No text formatting for // comment after a statement. Solution: format a comment when the 'c' flag is in 'formatoptions'. https://github.com/vim/vim/commit/48a8a833033e10fc1eba96f2fc8dd19c2408eddf
* Merge pull request #18425 from dundargoc/refactor/char_u/1bfredl2022-05-07
|\ | | | | refactor: replace char_u variables and functions with char
| * refactor: replace char_u variables and functions with charDundar Goc2022-05-07
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
* | fix(extmarks): revert to int for extmark rowzeertzjq2022-05-07
|/
* refactor: enable -Wconversion warning for edit.cDundar Goc2022-05-06
| | | | Work on https://github.com/neovim/neovim/issues/567
* refactor: replace char_u variables and functions with charDundar Goc2022-05-05
| | | | Work on https://github.com/neovim/neovim/issues/459
* 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