- Refresh the screen when Ctrl-L is pressed at the statusbar
prompt, as Pico does. (DLR)
- Always return the key pressed by the user. (DLR)
+ - Take new parameter reset_x, containing the value of
+ resetstatuspos, so that resetstatuspos can be a static
+ variable for just statusq(). (DLR)
statusq()
- Rework slightly to reset the cursor position when the user
hits Enter as well as Cancel. This means that resetstatuspos
static int statusblank = 0; /* Number of keystrokes left after
* we call statusbar(), before we
* actually blank the statusbar. */
-static bool resetstatuspos = FALSE;
- /* Should we reset the statusbar cursor
- * position? */
/* Control character compatibility:
*
#ifndef NANO_SMALL
historyheadtype *history_list,
#endif
- const shortcut *s
+ const shortcut *s, bool reset_x
#ifndef DISABLE_TABCOMP
, bool *list
#endif
#endif
xend = strlen(def);
- /* Only put x at the end of the string if it's uninitialized or if
- it would be past the end of the string as it is. Otherwise,
- leave it alone. This is so the cursor position stays at the same
- place if a prompt-changing toggle is pressed. */
- if (x == -1 || x > xend || resetstatuspos)
+ /* Only put x at the end of the string if it's uninitialized, if it
+ would be past the end of the string as it is, or if reset_x is
+ TRUE. Otherwise, leave it alone. This is so the cursor position
+ stays at the same place if a prompt-changing toggle is
+ pressed. */
+ if (x == -1 || x > xend || reset_x)
x = xend;
answer = charealloc(answer, xend + 1);
va_list ap;
char *foo = charalloc(COLS - 3);
int ret;
+ static bool resetstatuspos = FALSE;
#ifndef DISABLE_TABCOMP
bool list = FALSE;
#endif
#ifndef NANO_SMALL
which_history,
#endif
- s
+ s, resetstatuspos
#ifndef DISABLE_TABCOMP
, &list
#endif