mirror of git://git.sv.gnu.org/nano.git
macro: insert it in keystroke buffer without discarding latter's contents
Instead of simply overwriting the current contents of the keystroke buffer with the contents of the macro buffer, insert the latter's contents at the head of the keystroke buffer. This allows using {runmacro} in a string bind, and allows typing ahead over a laggy connection after invoking `runmacro` (normally with M-;). This fixes https://savannah.gnu.org/bugs/?65991. Reported-by: Tasos Papastylianou <tpapastylianou@hotmail.com> Bug exists since version 2.9.4, since string binds were introduced.
This commit is contained in:
parent
c53839cefa
commit
c356db9f44
|
@ -595,8 +595,8 @@ linestruct *line_from_number(ssize_t number);
|
|||
void record_macro(void);
|
||||
void run_macro(void);
|
||||
#endif
|
||||
void reserve_space_for(size_t newsize);
|
||||
size_t waiting_keycodes(void);
|
||||
void put_back(int keycode);
|
||||
#ifdef ENABLE_NANORC
|
||||
void implant(const char *string);
|
||||
#endif
|
||||
|
|
|
@ -123,14 +123,9 @@ void run_macro(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (macro_length > capacity)
|
||||
reserve_space_for(macro_length);
|
||||
for (size_t index = macro_length; index > 0; )
|
||||
put_back(macro_buffer[--index]);
|
||||
|
||||
for (size_t i = 0; i < macro_length; i++)
|
||||
key_buffer[i] = macro_buffer[i];
|
||||
|
||||
waiting_codes = macro_length;
|
||||
nextcodes = key_buffer;
|
||||
mute_modifiers = TRUE;
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
|
Loading…
Reference in New Issue