mirror of
https://github.com/neovim/neovim
synced 2025-07-15 16:51:49 +00:00
test(old): emulate test_override('char_avail') using FFI
Add a non-static variable for this, otherwise it'll be really hacky. This avoid having to rewrite many incsearch tests in Lua.
This commit is contained in:
@ -1866,6 +1866,9 @@ int vpeekc_any(void)
|
||||
/// @return true if a character is available, false otherwise.
|
||||
bool char_avail(void)
|
||||
{
|
||||
if (disable_char_avail_for_testing) {
|
||||
return false;
|
||||
}
|
||||
no_mapping++;
|
||||
int retval = vpeekc();
|
||||
no_mapping--;
|
||||
|
@ -17,6 +17,8 @@ typedef enum {
|
||||
|
||||
enum { NSCRIPT = 15, }; ///< Maximum number of streams to read script from
|
||||
|
||||
EXTERN bool disable_char_avail_for_testing INIT( = false);
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "getchar.h.generated.h"
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user