- Change resetpos function to be global (now called resetstatuspos. Fixes annoying but small odd problem with cursor placement when inserting a file. This needs to be done better in 1.3 (originally by David Lawrence Ramsey) Added this issue to TODO
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1459 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
diff --git a/winio.c b/winio.c
index 15eca54..5ffc4c0 100644
--- a/winio.c
+++ b/winio.c
@@ -194,7 +194,7 @@
#ifndef DISABLE_TABCOMP
, int *list
#endif
- , int resetpos)
+ )
{
int kbinput;
static int x = -1;
@@ -218,7 +218,7 @@
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 || resetpos)
+ if (x == -1 || x > xend || resetstatuspos)
x = xend;
answer = (char *)nrealloc(answer, xend + 1);
@@ -1162,8 +1162,6 @@
#ifndef DISABLE_TABCOMP
int list = 0;
#endif
- static int resetpos = 0; /* Do we need to scrap the cursor position
- on the statusbar? */
bottombars(s);
@@ -1180,22 +1178,22 @@
#ifndef DISABLE_TABCOMP
, &list
#endif
- , resetpos);
+ );
free(foo);
- resetpos = 0;
+ resetstatuspos = 0;
switch (ret) {
case NANO_FIRSTLINE_KEY:
do_first_line();
- resetpos = 1;
+ resetstatuspos = 1;
break;
case NANO_LASTLINE_KEY:
do_last_line();
- resetpos = 1;
+ resetstatuspos = 1;
break;
case NANO_CANCEL_KEY:
ret = -1;
- resetpos = 1;
+ resetstatuspos = 1;
break;
}
blank_statusbar();