commit b516d8e3f3f263454c08cf31a8326824ed2c32c7
parent 66c33b8731286c5a829856aa00a56d7a770ab047
Author: Chris Allegretta <chrisa@asty.org>
Date: Wed, 3 Oct 2001 00:01:36 +0000
- 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
Diffstat:
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -44,7 +44,7 @@ CVS code -
- Initialize totsize (DLR).
- nano.c:
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.
- Many tweaks and changes from numerics to char equivs
(David Lawrence Ramsey).
diff --git a/nano.c b/nano.c
@@ -2448,8 +2448,7 @@ 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 */
+ long constcheck; /* Check to constantly update */
#ifdef _POSIX_VDISABLE
struct termios term;
@@ -2752,8 +2751,7 @@ int main(int argc, char *argv[])
reset_cursor();
while (1) {
- oldcurrent = current;
- oldcurrent_x = current_x;
+ constcheck = current->lineno + current_x + totsize;
#ifndef DISABLE_MOUSE
currshortcut = main_list;
@@ -3035,7 +3033,7 @@ int main(int argc, char *argv[])
if (ISSET(DISABLE_CURPOS))
UNSET(DISABLE_CURPOS);
else if (ISSET(CONSTUPDATE))
- if (current != oldcurrent || current_x != oldcurrent_x)
+ if (constcheck != current->lineno + current_x + totsize)
do_cursorpos();
reset_cursor();