aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/getchar.c
Commit message (Collapse)AuthorAge
...
* vim-patch:8.2.4833: failure of mapping not checked forzeertzjq2022-04-29
| | | | | | Problem: Failure of mapping not checked for. Solution: Check return value of ins_typebuf(). (closes vim/vim#10299) https://github.com/vim/vim/commit/12e21e387b5bbc928097abf1c189b7dc665838fc
* vim-patch:8.2.4829: a key may be simplified to NULzeertzjq2022-04-29
| | | | | | | Problem: A key may be simplified to NUL. Solution: Use K_ZERO instead. Use macros instead of hard coded values. (closes vim/vim#10290) https://github.com/vim/vim/commit/17c95d9608370559441bb73941ba6d9a4b6b26bd
* vim-patch:8.2.4828: fix for unmapping simplified key not fully testedzeertzjq2022-04-29
| | | | | | Problem: Fix for unmapping simplified key not fully tested. Solution: Add a test case. (closes vim/vim#10292) https://github.com/vim/vim/commit/abeb09b2c53054513812d1e56716e2a5abe8f354
* vim-patch:8.2.4827: typo in variable namezeertzjq2022-04-29
| | | | | | Problem: Typo in variable name. (Gabriel Dupras) Solution: Rename the variable. https://github.com/vim/vim/commit/87f74106f96737e7b8ceaafe1a131aa718077de6
* vim-patch:8.2.4824: expression is evaluated multiple timeszeertzjq2022-04-29
| | | | | | Problem: Expression is evaluated multiple times. Solution: Evaluate expression once and store the result. (closes vim/vim#10278) https://github.com/vim/vim/commit/23d5770ef5e2f5c6d20d123303b81327045e5a1e
* vim-patch:8.2.4819: unmapping simplified keys also deletes other mappingzeertzjq2022-04-29
| | | | | | Problem: Unmapping simplified keys also deletes other mapping. Solution: Only unmap a mapping with m_simplified set. (closes vim/vim#10270) https://github.com/vim/vim/commit/a4e3332650021921068ef12923b4501c5b9918cb
* vim-patch:8.2.4504: when there is a partially matching map full map may not workzeertzjq2022-04-29
| | | | | | | | | | Problem: When there is a partially matching map and modifyOtherKeys is active a full map may not work. Solution: Only simplify modifiers when there is no matching mapping. (closes vim/vim#8792) https://github.com/vim/vim/commit/196c3850dbe95247f7aa1b0000a5cae625a99ef2 Omit test as it sends terminal codes. Use a Lua test instead.
* vim-patch:8.2.3595: check for signed overflow might not work everywherezeertzjq2022-04-29
| | | | | | Problem: Check for signed overflow might not work everywhere. Solution: Limit to 32 bit int. (closes vim/vim#9043, closes vim/vim#9067) https://github.com/vim/vim/commit/0d5a12ea041c112b06b1aafde38846ae4cff8f4c
* vim-patch:8.2.0919: merging modifier for modifyOtherKeys is done twicezeertzjq2022-04-29
| | | | | | | | | Problem: Merging modifier for modifyOtherKeys is done twice. Solution: Remove the merging done in vgetc(). https://github.com/vim/vim/commit/673fc3e23f09095d17f0095c4323958041b2d0d2 Omit ex_getln.c change as it was removed in patch 8.2.2084, so no_reduce_keys is still not needed in Nvim.
* 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
|
* vim-patch:8.2.0851: can't distinguish <M-a> from accented "a" in the GUIzeertzjq2022-04-29
| | | | | | Problem: Can't distinguish <M-a> from accented "a" in the GUI. Solution: Use another way to make mapping <C-bslash> work. (closes vim/vim#6163) https://github.com/vim/vim/commit/f4ae6b245a54f11dd967d06b80f30e5abf55fb82
* vim-patch:8.2.0839: dropping modifier when putting a character back in typeaheadzeertzjq2022-04-29
| | | | | | | | | Problem: Dropping modifier when putting a character back in typeahead. Solution: Add modifier to ins_char_typebuf(). (closes vim/vim#6158) https://github.com/vim/vim/commit/b42c0d54279b1fdb79652db0c84171e213458809 Vim's test doesn't seem to work properly as the hit-enter prompt seems to be delayed. Add a Lua screen test.
* 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.
* vim-patch:8.1.2159: some mappings are listed twicezeertzjq2022-04-29
| | | | | | Problem: Some mappings are listed twice. Solution: Skip mappings duplicated for modifyOtherKeys. (closes vim/vim#5064) https://github.com/vim/vim/commit/fafb4b18cd4aa5897537f53003b31bb83d7362df
* vim-patch:8.1.2145: cannot map <C-H> when modifyOtherKeys is enabledzeertzjq2022-04-29
| | | | | | | | | | | | | Problem: Cannot map <C-H> when modifyOtherKeys is enabled. Solution: Add the <C-H> mapping twice, both with modifier and as 0x08. Use only the first one when modifyOtherKeys has been detected. https://github.com/vim/vim/commit/459fd785e4a8d044147a3f83a5fca8748528aa84 Add REPTERM_NO_SPECIAL instead of REPTERM_SPECIAL because the meaning of "special" is different between Vim and Nvim. Omit seenModifyOtherKeys as Nvim supports attaching multiple UIs. Omit tests as they send terminal codes. Keep the behavior of API functions.
* 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.4722: ending recording with mapping records too much (#18060)zeertzjq2022-04-10
| | | | | | Problem: When a recording is ended with a mapped key that key is also recorded. Solution: Remember the previous last_recorded_len. (closes vim/vim#10122) https://github.com/vim/vim/commit/81b46a6ccd818609e1ca8cd410e26a58428c30ba
* vim-patch:partial:8.1.2333: with modifyOtherKeys CTRL-^ doesn't work (#18048)zeertzjq2022-04-09
| | | | | Problem: With modifyOtherKeys CTRL-^ doesn't work. Solution: Handle the exception. https://github.com/vim/vim/commit/828ffd596394f714270a01a55fc3f949a8bd9b35
* fix(event-loop): check if executed register has endedzeertzjq2022-04-07
|
* fix(input): fix clearing of reg_executingzeertzjq2022-04-07
| | | | vim-patch:8.2.4705
* vim-patch:8.2.{4692,4691,4690}: fix Insert mode <LeftDrag> mapping bug (#17999)zeertzjq2022-04-05
| | | | | | | | | | | | | | | | | | | | | | | | | | vim-patch:8.2.4692: no test for what 8.2.4691 fixes Problem: No test for what 8.2.4691 fixes. Solution: Add a test. Use a more generic sotlution. (closes vim/vim#10090) https://github.com/vim/vim/commit/0f68e6c07aaf62c034a242f183b93c1bb44e7f93 Test cannot be used because it must use test_setmouse(). Use a Lua test. Reverted patches: vim-patch:8.2.4691: solution for <Cmd> in a mapping causes trouble Problem: Solution for <Cmd> in a mapping causes trouble. Solution: Use another solution: put back CTRL-O after reading the <Cmd> sequence. https://github.com/vim/vim/commit/ca9d8d2cb9fc6b9240f2a74ccd36f9d966488294 vim-patch:8.2.4689: using <Cmd> in a mapping does not work for mouse keys Problem: Using <Cmd> in a mapping does not work for mouse keys in Insert mode. (Sergey Vlasov) Solution: When reading the <Cmd> argument do not use the stuff buffer. (closes vim/vim#10080) https://github.com/vim/vim/commit/d0fb2d804183c2786578b4c32ba5b92938f93d0e
* Merge pull request #17987 from leungbk/vim-patch-4402zeertzjq2022-04-04
|\ | | | | vim-patch:8.2.{4639,4402}: missing parenthesis may cause unexpected problems
| * 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
* | fix(substitute): properly check for empty command linezeertzjq2022-04-04
|/
* fix(ex_normal): spam \n in Ex mode only if in Cmdline mode (#17977)zeertzjq2022-04-03
| | | | | When using :normal in Ex mode, the editor is no longer in Cmdline mode, but the exmode_active flag is still set, causing the wrong character to be spammed in Insert mode, leading to a hang.
* vim-patch:8.1.0439: recursive use of getcmdline() still not protected (#17726)zeertzjq2022-03-30
| | | | | | | | | | | | Problem: Recursive use of getcmdline() still not protected. Solution: Instead of saving the command buffer when making a call which may cause recursiveness, save the buffer when actually being called recursively. https://github.com/vim/vim/commit/438d176e35c16d56ff3bb7a80300197ce5a30c4f Co-authored-by: zeertzjq <zeertzjq@outlook.com> Clear ccline earlier in save_cmdline() if ccline is in use so that ccline.prev_ccline can be assigned.
* feat(input)!: delay some conversions to vgetc()zeertzjq2022-03-24
|
* fix: use normal! <C-L> in default <C-L> mapping (#17695)Gregory Anders2022-03-12
|
* refactor: remove redundant castsDundar Göc2022-03-06
|
* 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.4498: using <Plug> with "noremap" does not workzeertzjq2022-03-03
| | | | | | Problem: Using <Plug> with "noremap" does not work. Solution: Always remap <Plug>. (closes vim/vim#9879, closes vim/vim#9789) https://github.com/vim/vim/commit/1fc34225acbee5ddca2b9ec3f82b3014d385b7f8
* feat(lua): show proper verbose output for lua configurationshadmansaleh2022-02-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `:verbose` didn't work properly with lua configs (For example: options or keymaps are set from lua, just say that they were set from lua, doesn't say where they were set at. This fixes that issue. Now `:verbose` will provide filename and line no when option/keymap is set from lua. Changes: - compiles lua/vim/keymap.lua as vim/keymap.lua - When souring a lua file current_sctx.sc_sid is set to SID_LUA - Moved finding scripts SID out of `do_source()` to `get_current_script_id()`. So it can be reused for lua files. - Added new function `nlua_get_sctx` that extracts current lua scripts name and line no with debug library. And creates a sctx for it. NOTE: This function ignores C functions and blacklist which currently contains only vim/_meta.lua so vim.o/opt wrappers aren't targeted. - Added function `nlua_set_sctx` that changes provided sctx to current lua scripts sctx if a lua file is being executed. - Added tests in tests/functional/lua/verbose_spec.lua - add primary support for additional types (:autocmd, :function, :syntax) to lua verbose Note: These can't yet be directly set from lua but once that's possible :verbose should work for them hopefully :D - add :verbose support for nvim_exec & nvim_command within lua Currently auto commands/commands/functions ... can only be defined by nvim_exec/nvim_command this adds support for them. Means if those Are defined within lua with vim.cmd/nvim_exec :verbose will show their location . Though note it'll show the line no on which nvim_exec call was made.
* Merge pull request #16969 from shadmansaleh/enhance/ingore_nore_on_plug_keymapsbfredl2022-02-27
|\ | | | | feat: ignore nore on <Plug> maps
| * feat: ignore nore on <Plug> mapsshadmansaleh2022-02-27
| |
* | Merge pull request #17432 from zeertzjq/vim-8.1.2336zeertzjq2022-02-27
|\ \ | |/ |/| vim-patch:8.1.2336,8.2.{4338,4401}: mapping cursor and redrawing patches
| * vim-patch:8.2.4401: map listing does not clear the rest of the command linezeertzjq2022-02-17
| | | | | | | | | | | | Problem: Map listing does not clear the rest of the command line. Solution: Call msg_clear_eos(). (closes vim/vim#5623, closes vim/vim#5962) https://github.com/vim/vim/commit/d288eaad846f0e07e0141226f97d858dcf96cb78
| * vim-patch:8.2.4338: an error from an expression mapping messes up the displayzeertzjq2022-02-17
| | | | | | | | | | | | | | Problem: An error from an expression mapping messes up the display. Solution: When the expression results in an empty string return K_IGNORE. In cmdline mode redraw the command line. (closes vim/vim#9726) https://github.com/vim/vim/commit/74a0a5b26d0180f3ea89e9495dff6a26f0df23cb
| * vim-patch:8.1.2336: when an expr mapping moves the cursor it is not restoredzeertzjq2022-02-17
| | | | | | | | | | | | Problem: When an expr mapping moves the cursor it is not restored. Solution: Position the cursor after an expr mapping. (closes vim/vim#5256) https://github.com/vim/vim/commit/4ebe0e62d097d68c5312f9c32714fb41a4c947a3
* | Merge pull request #17403 from zeertzjq/vim-8.1.1955zeertzjq2022-02-21
|\ \ | |/ |/| vim-patch:8.1.{1846,1955},8.2.0156
| * vim-patch:8.2.0156: various typos in source files and testszeertzjq2022-02-14
| | | | | | | | | | | | Problem: Various typos in source files and tests. Solution: Fix the typos. (Emir Sari, closes vim/vim#5532) https://github.com/vim/vim/commit/4b96df5a017a04141c4e901b1fc5704a3ca48099
* | vim-patch:8.2.4400: MS-Windows: cannot use the mouse in the console with VIMDLLzeertzjq2022-02-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: MS-Windows: cannot use the mouse in the console with VIMDLL. Solution: use add_char2buf() instead of fix_input_buffer(). (closes vim/vim#9784, closes vim/vim#9769) https://github.com/vim/vim/commit/646bb7247ad6051aca223a2b04b008f682cdb57f N/A patches for version.c: vim-patch:8.2.4392: MS-Windows with VIMDLL: Escaping CSI is wrong Problem: MS-Windows with VIMDLL: Escaping CSI is wrong. Solution: Put back #ifdef. (Ken Takata, closes vim/vim#9769) https://github.com/vim/vim/commit/64d95cfc56406858a05032c6a134f1e08fe2ca78 vim-patch:8.2.4394: UTF8 select mode test fails on MS-Windows Problem: UTF8 select mode test fails on MS-Windows. Solution: Revert the #ifdef change. https://github.com/vim/vim/commit/9fdde7992ab4c21517f447ca3d651b9ff4a770e8
* | refactor: remove NULL check that is always truezeertzjq2022-02-16
| |
* | feat(mappings): considering map description when filtering (#17423)Shadman2022-02-16
| |
* | fix: <Nop> not shown in :map commandsshadmansaleh2022-02-16
| |
* | chore: improve lua keymaps internal representation schemeshadmansaleh2022-02-16
|/
* vim-patch:8.2.3966: when using feedkeys() abbreviations may be blockedzeertzjq2022-02-02
| | | | | | | Problem: When using feedkeys() abbreviations may be blocked. Solution: Reset tb_no_abbr_cnt when running out of characters. (closes vim/vim#9448) https://github.com/vim/vim/commit/b37a65e4bf08c4eec4fa5b81a5efc3945fca44de
* Merge pull request #17202 from zeertzjq/unused-orig-rhsbfredl2022-01-29
|\ | | | | refactor: allocate an empty string as unused orig_rhs for Lua mappings
| * refactor: allocate an empty string as unused orig_rhs for Lua mappingszeertzjq2022-01-27
| |
* | fix(input): remove reinterpreted ALT/META chords from recorded macrozeertzjq2022-01-29
| |