get_untranslated_kbinput()
- Make the ascii_digits variables ints instead of size_t's,
since they will only hold very small values. (DLR)
+ get_verbatim_kbinput()
+ - Don't pass v_kbinput in as a parameter, since we're
+ dynamically allocating it and then returning it. (DLR)
get_shortcut(), get_toggle()
- Add debug messages. (DLR)
statusbar(_("Verbatim input"));
- v_kbinput = get_verbatim_kbinput(edit, ERR, v_kbinput, &v_len,
- TRUE);
+ v_kbinput = get_verbatim_kbinput(edit, ERR, &v_len, TRUE);
/* Turn on DISABLE_CURPOS while inserting character(s) and turn it
* off afterwards, so that if constant cursor position display is
int get_escape_seq_kbinput(const int *escape_seq, size_t es_len, bool
*ignore_seq);
int get_escape_seq_abcd(int kbinput);
-int *get_verbatim_kbinput(WINDOW *win, int first, int *v_kbinput, size_t
- *v_len, bool allow_ascii);
+int *get_verbatim_kbinput(WINDOW *win, int v_first, size_t *v_len, bool
+ allow_ascii);
int get_untranslated_kbinput(int kbinput, size_t position, bool
allow_ascii
#ifndef NANO_SMALL
int *sequence = NULL;
size_t seq_len;
- sequence = get_verbatim_kbinput(win, kbinput, sequence,
- &seq_len, FALSE);
+ sequence = get_verbatim_kbinput(win, kbinput, &seq_len,
+ FALSE);
/* Handle escape sequences. */
if (seq == ESCAPE_SEQ) {
}
/* Read in a string of input characters (e.g. an escape sequence)
- * verbatim. If first isn't ERR, make it the first character of the
- * string. Store the string in v_kbinput and return the length of the
- * string in v_len. Assume nodelay(win) is FALSE. */
-int *get_verbatim_kbinput(WINDOW *win, int first, int *v_kbinput, size_t
- *v_len, bool allow_ascii)
+ * verbatim. If v_first isn't ERR, make it the first character of the
+ * string. Return the length of the string in v_len. Assume
+ * nodelay(win) is FALSE. */
+int *get_verbatim_kbinput(WINDOW *win, int v_first, size_t *v_len, bool
+ allow_ascii)
{
- int kbinput;
+ int kbinput, *v_kbinput;
size_t i = 0, v_newlen = 0;
#ifndef NANO_SMALL
/* If first is ERR, read the first character using blocking input,
* since using non-blocking input will eat up all unused CPU.
- * Otherwise, treat first as the first character. Then increment
+ * Otherwise, treat v_first as the first character. Then increment
* v_len and save the character in v_kbinput. */
- if (first == ERR)
+ if (v_first == ERR)
kbinput = wgetch(win);
else
- kbinput = first;
+ kbinput = v_first;
(*v_len)++;
v_kbinput[0] = kbinput;
#ifdef DEBUG