diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2024-09-10 01:14:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-10 01:14:18 -0700 |
commit | 5d7853f22903a4f42d52f565f6a662c3ef178a8c (patch) | |
tree | 9329edaa4dc694186644a5a9e3f405eb365e8ae8 /src/nvim/state.c | |
parent | f279d1ae33ee5650bccf7b52f9f29fd192ccea1d (diff) | |
download | rneovim-5d7853f22903a4f42d52f565f6a662c3ef178a8c.tar.gz rneovim-5d7853f22903a4f42d52f565f6a662c3ef178a8c.tar.bz2 rneovim-5d7853f22903a4f42d52f565f6a662c3ef178a8c.zip |
refactor(os/input.c): rename os_inchar => input_get #30327
Problem:
The name `os_inchar` (from Vim's old `mch_inchar`) is ambiguous:
"inchar" sounds like it could be reading or enqueuing (setting) input.
Its docstring is also ambiguous.
Solution:
- Rename `os_inchar` to `input_get`.
- Write some mf'ing docstrings.
- Add assert() in TRY_READ().
Diffstat (limited to 'src/nvim/state.c')
-rw-r--r-- | src/nvim/state.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nvim/state.c b/src/nvim/state.c index eab976927c..1b08a08fba 100644 --- a/src/nvim/state.c +++ b/src/nvim/state.c @@ -74,10 +74,9 @@ getkey: } // Flush screen updates before blocking. ui_flush(); - // Call `os_inchar` directly to block for events or user input without - // consuming anything from `input_buffer`(os/input.c) or calling the - // mapping engine. - os_inchar(NULL, 0, -1, typebuf.tb_change_cnt, main_loop.events); + // Call `input_get` directly to block for events or user input without consuming anything from + // `os/input.c:input_buffer` or calling the mapping engine. + input_get(NULL, 0, -1, typebuf.tb_change_cnt, main_loop.events); // If an event was put into the queue, we send K_EVENT directly. if (!input_available() && !multiqueue_empty(main_loop.events)) { key = K_EVENT; |