aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
Commit message (Collapse)AuthorAge
* 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
| * vim-patch:8.2.3609: internal error when ModeChanged is triggered recursivelyMagnus Groß2021-11-18
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Internal error when ModeChanged is triggered when v:event is already in use. Solution: Save and restore v:event if needed. https://github.com/vim/vim/commit/3075a45592fe76f2febb6321632a23e352efe949 In the vim codebase there is no occurrence of get_vim_var_dict(VV_EVENT) after the above patch, so in order to hold the same invariant in the neovim codebase we needed to replace more occurrences than the related vim patch.
| * 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: reduce number of explicit char casts (#16077)dundargoc2021-11-16
| | | * refactor: reduce number of explicit char casts
* Merge pull request #16047 from mcepl/vim-8.2.3520Jan Edmund Lazo2021-11-14
|\ | | | | vim-patch:8.2.3520: cannot define a function for thesaurus completion
| * vim-patch:8.2.3528: 'thesaurus' and 'thesaurusfunc' do not have the same scopeMatěj Cepl2021-11-06
| | | | | | | | | | | | Problem: 'thesaurus' and 'thesaurusfunc' do not have the same scope. Solution: Make 'thesaurusfunc' global-local. https://github.com/vim/vim/commit/f4d8b76d304dabc39c06d2344cd4c7b28484811b
| * vim-patch:8.2.3525: option variable name does not match option nameMatěj Cepl2021-10-24
| | | | | | | | | | | | | | Problem: Option variable name does not match option name. (Christ van Willigen) Solution: Rename the variable. https://github.com/vim/vim/commit/d4c4bfa0078a959ff90ef30288fd31d9d38f23d7
| * vim-patch:8.2.3520: cannot define a function for thesaurus completionMatěj Cepl2021-10-23
| | | | | | | | | | | | | | Problem: Cannot define a function for thesaurus completion. Solution: Add 'thesaurusfunc'. (Yegappan Lakshmanan, closes vim/vim#8987, closes 8950) https://github.com/vim/vim/commit/160e994d768d03a3c826b58115cde94df8fce607
* | refactor(macros): delete multibyte macros which just are aliasesBjörn Linse2021-11-14
| |
* | 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
* | refactor: uncrustify #16090dundargoc2021-10-29
| |
* | vim-patch:8.1.2378: 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/5d18efecfd6c45d69f55268948a22cd0465bb955