diff --git a/ChangeLog b/ChangeLog index ad042e2db3fda00e64b0207753814a8358b6af4e..60c57c4e36c420b9087d546b0fbf6fe8b8d514bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,10 @@ CVS code - use a flag instead (just as messy?) - --enable-tiny now leaves out the Auto Indent code, do you really need that on a bootdisk? =-) +- nano.c: + main() + - Added vars oldcurrent and oldcurrent_x to check whether cursor + pos has changed and if so update the pos with -c. - nano.texi: - corrected the Mouse Toggle section, noticed by Daniel Bonniot. - winio.c: diff --git a/nano.c b/nano.c index d7f5795116b17b4da8d23ff11c65c91d433b0070..a27ea5cb4b2a43ac542b4c2a800950fc1aaead97 100644 --- a/nano.c +++ b/nano.c @@ -608,7 +608,6 @@ int do_mark(void) edit_refresh(); } #endif - SET(DISABLE_CURPOS); return 1; } @@ -2322,8 +2321,6 @@ void do_toggle(int which) statusbar("%s %s", toggles[which].desc, enabled); } - SET(DISABLE_CURPOS); - #endif } @@ -2370,6 +2367,9 @@ int main(int argc, char *argv[]) int keyhandled; /* Have we handled the keystroke yet? */ int i, modify_control_seq; char *argv0; + filestruct *oldcurrent; /* Check to constantly update */ + int oldcurrent_x; /* Same */ + #ifdef _POSIX_VDISABLE struct termios term; #endif @@ -2635,6 +2635,8 @@ int main(int argc, char *argv[]) reset_cursor(); while (1) { + oldcurrent = current; + oldcurrent_x = current_x; #ifndef DISABLE_MOUSE currshortcut = main_list; @@ -2900,12 +2902,9 @@ int main(int argc, char *argv[]) } do_char(kbinput); } - if (ISSET(CONSTUPDATE)) { - if (ISSET(DISABLE_CURPOS)) - UNSET(DISABLE_CURPOS); - else + if (ISSET(CONSTUPDATE)) + if (current != oldcurrent || current_x != oldcurrent_x) do_cursorpos(); - } reset_cursor(); wrefresh(edit);