Commit b516d8e3 authored by Chris Allegretta's avatar Chris Allegretta
Browse files

- nano.c:main() - Added var constcheck as a CRC-like check of whether cursor...

- nano.c:main() - Added var constcheck as a CRC-like check of whether cursor pos has changed and if so update the pos with -c


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@820 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 4 additions and 6 deletions
+4 -6
...@@ -44,7 +44,7 @@ CVS code - ...@@ -44,7 +44,7 @@ CVS code -
- Initialize totsize (DLR). - Initialize totsize (DLR).
- nano.c: - nano.c:
main() main()
- Added vars oldcurrent and oldcurrent_x to check whether cursor - Added var constcheck as a CRC-like check of whether cursor
pos has changed and if so update the pos with -c. pos has changed and if so update the pos with -c.
- Many tweaks and changes from numerics to char equivs - Many tweaks and changes from numerics to char equivs
(David Lawrence Ramsey). (David Lawrence Ramsey).
......
...@@ -2448,8 +2448,7 @@ int main(int argc, char *argv[]) ...@@ -2448,8 +2448,7 @@ int main(int argc, char *argv[])
int keyhandled; /* Have we handled the keystroke yet? */ int keyhandled; /* Have we handled the keystroke yet? */
int i, modify_control_seq; int i, modify_control_seq;
char *argv0; char *argv0;
filestruct *oldcurrent; /* Check to constantly update */ long constcheck; /* Check to constantly update */
int oldcurrent_x; /* Same */
#ifdef _POSIX_VDISABLE #ifdef _POSIX_VDISABLE
struct termios term; struct termios term;
...@@ -2752,8 +2751,7 @@ int main(int argc, char *argv[]) ...@@ -2752,8 +2751,7 @@ int main(int argc, char *argv[])
reset_cursor(); reset_cursor();
while (1) { while (1) {
oldcurrent = current; constcheck = current->lineno + current_x + totsize;
oldcurrent_x = current_x;
#ifndef DISABLE_MOUSE #ifndef DISABLE_MOUSE
currshortcut = main_list; currshortcut = main_list;
...@@ -3035,7 +3033,7 @@ int main(int argc, char *argv[]) ...@@ -3035,7 +3033,7 @@ int main(int argc, char *argv[])
if (ISSET(DISABLE_CURPOS)) if (ISSET(DISABLE_CURPOS))
UNSET(DISABLE_CURPOS); UNSET(DISABLE_CURPOS);
else if (ISSET(CONSTUPDATE)) else if (ISSET(CONSTUPDATE))
if (current != oldcurrent || current_x != oldcurrent_x) if (constcheck != current->lineno + current_x + totsize)
do_cursorpos(); do_cursorpos();
reset_cursor(); reset_cursor();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment