mirror of
https://github.com/neovim/neovim.git
synced 2025-10-15 06:16:08 +00:00

Problem: using global variable for get_insert()/get_lambda_name()
(after v9.1.1151)
Solution: let the functions return a string_T object instead
(Yee Cheng Chin)
In vim/vim#16720, `get_insert()` was modified to store a string length in a
global variable to be queried immediately by another `get_insert_len()`
function, which is somewhat fragile. Instead, just have the function
itself return a `string_T` object instead. Also do the same for
`get_lambda_name()` which has similar issues.
closes: vim/vim#16775
0b5fe42071
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
23 lines
674 B
C
23 lines
674 B
C
#pragma once
|
|
|
|
#include <stddef.h> // IWYU pragma: keep
|
|
#include <stdint.h> // IWYU pragma: keep
|
|
|
|
#include "nvim/api/private/defs.h" // IWYU pragma: keep
|
|
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
|
|
#include "nvim/getchar_defs.h" // IWYU pragma: keep
|
|
#include "nvim/types_defs.h" // IWYU pragma: keep
|
|
|
|
/// Argument for flush_buffers().
|
|
typedef enum {
|
|
FLUSH_MINIMAL,
|
|
FLUSH_TYPEAHEAD, ///< flush current typebuf contents
|
|
FLUSH_INPUT, ///< flush typebuf and inchar() input
|
|
} flush_buffers_T;
|
|
|
|
enum { NSCRIPT = 15, }; ///< Maximum number of streams to read script from
|
|
|
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
|
# include "getchar.h.generated.h"
|
|
#endif
|