aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/getchar.c
Commit message (Collapse)AuthorAge
* 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
| |
* | vim-patch:8.2.4236: accessing freed memoryChristian Clason2022-01-28
| | | | | | | | | | | | Problem: Accessing freed memory. Solution: Set the bh_curr pointer to NULL. https://github.com/vim/vim/commit/166788c657f4b1090a31ea37a023b1f2c78790c8
* | vim-patch:8.2.4235: invalid check for NULL pointerChristian Clason2022-01-28
| | | | | | | | | | | | Problem: Invalid check for NULL pointer. Solution: Remove the check. https://github.com/vim/vim/commit/37cf413e3e768b76c975e4a7081472d75d649c72
* | vim-patch:8.2.4233: crash when recording and using Select modeChristian Clason2022-01-28
| | | | | | | | | | | | | | Problem: Crash when recording and using Select mode. Solution: When deleting the last recorded character check there is something to delete. https://github.com/vim/vim/commit/a4bc2dd7cccf5a4a9f78b58b6f35a45d17164323
* | vim-patch:8.2.4002: first char typed in Select mode can be wrongzeertzjq2022-01-24
| | | | | | | | | | | | | | | | | | | | | | | | Problem: First char typed in Select mode can be wrong. Solution: Escape special bytes in the input buffer. (closes vim/vim#9469) https://github.com/vim/vim/commit/6cac77016b1636e04073e8348b7cee02259ef928 The `buf` should already be large enough, but I'll change its size anyway in case future patches change the meaning of `MB_MAXBYTES` macro. `fix_input_buffer()` cannot be used here because of the `using_script()` check, and there is already equivalent code in its place.
* | 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
* fix(input): put modifiers back into typeahead buffer when neededzeertzjq2022-01-23
|
* refactor: remove CSI unescaping and clean up related names and commentszeertzjq2022-01-21
|
* fix(input): never escape CSI byteszeertzjq2022-01-21
|
* 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>
* vim-patch:8.2.3825: various comments could be improvedzeertzjq2021-12-16
| | | | | | Problem: Various comments could be improved. Solution: Improve the comments. https://github.com/vim/vim/commit/52797bae1710621926c03a2611c40a692c96fb44
* 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 way beep functions elsewhereBjörn Linse2021-12-10
|
* vim-patch:8.1.1798: warning for unused variable in tiny versionzeertzjq2021-12-07
| | | | | | Problem: Warning for unused variable in tiny version. (Tony Mechelynck) Solution: Move inside #ifdef. Reformat code. https://github.com/vim/vim/commit/eda35f7127c6ac51573eda808687f6369c31ee2d
* vim-patch:8.1.1797: the vgetorpeek() function is too longzeertzjq2021-12-07
| | | | | | Problem: The vgetorpeek() function is too long. Solution: Split off the part that handles mappings, with fix. https://github.com/vim/vim/commit/edd680f3649c47d7ed5818e356e7c47f874f5cf8
* lint (#16526)Jan Edmund Lazo2021-12-05
|
* 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(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
|
* fix(input): never reinterpret unmapped ALT- chrods in Terminal mode (#16222)zeertzjq2021-11-04
|
* 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