make resetstatuspos static to just statusq()

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1966 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2004-10-05 02:29:52 +00:00
parent d532f197b0
commit 4dd723a095
3 changed files with 13 additions and 11 deletions

View File

@ -161,6 +161,9 @@ CVS code -
- 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

View File

@ -555,7 +555,7 @@ int nanogetstr(int allowtabs, const char *buf, const char *def,
#ifndef NANO_SMALL
historyheadtype *history_list,
#endif
const shortcut *s
const shortcut *s, bool reset_x
#ifndef DISABLE_TABCOMP
, bool *list
#endif

View File

@ -33,9 +33,6 @@
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:
*
@ -1762,7 +1759,7 @@ int nanogetstr(int allowtabs, const char *buf, const char *def,
#ifndef NANO_SMALL
historyheadtype *history_list,
#endif
const shortcut *s
const shortcut *s, bool reset_x
#ifndef DISABLE_TABCOMP
, bool *list
#endif
@ -1795,11 +1792,12 @@ int nanogetstr(int allowtabs, const char *buf, const char *def,
#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);
@ -2989,6 +2987,7 @@ int statusq(int allowtabs, const shortcut *s, const char *def,
va_list ap;
char *foo = charalloc(COLS - 3);
int ret;
static bool resetstatuspos = FALSE;
#ifndef DISABLE_TABCOMP
bool list = FALSE;
#endif
@ -3004,7 +3003,7 @@ int statusq(int allowtabs, const shortcut *s, const char *def,
#ifndef NANO_SMALL
which_history,
#endif
s
s, resetstatuspos
#ifndef DISABLE_TABCOMP
, &list
#endif