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/input.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/input.c')
-rw-r--r-- | src/nvim/input.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/input.c b/src/nvim/input.c index e14bfe7539..ef400710fe 100644 --- a/src/nvim/input.c +++ b/src/nvim/input.c @@ -37,7 +37,7 @@ /// @param[in] str Prompt: question to ask user. Is always followed by /// " (y/n)?". /// @param[in] direct Determines what function to use to get user input. If -/// true then os_inchar() will be used, otherwise vgetc(). +/// true then input_get() will be used, otherwise vgetc(). /// I.e. when direct is true then characters are obtained /// directly from the user without buffers involved. /// @@ -111,7 +111,7 @@ int get_keystroke(MultiQueue *events) // First time: blocking wait. Second time: wait up to 100ms for a // terminal code to complete. - n = os_inchar(buf + len, maxlen, len == 0 ? -1 : 100, 0, events); + n = input_get(buf + len, maxlen, len == 0 ? -1 : 100, 0, events); if (n > 0) { // Replace zero and K_SPECIAL by a special key code. n = fix_input_buffer(buf + len, n); |