Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libform Allow REQ_RIGHT_CHAR to get to the end of the line.



details:   https://anonhg.NetBSD.org/src/rev/9c962940e5f7
branches:  trunk
changeset: 534747:9c962940e5f7
user:      blymn <blymn%NetBSD.org@localhost>
date:      Fri Aug 02 11:49:18 2002 +0000

description:
Allow REQ_RIGHT_CHAR to get to the end of the line.

diffstat:

 lib/libform/internals.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r ceb311f699cc -r 9c962940e5f7 lib/libform/internals.c
--- a/lib/libform/internals.c   Fri Aug 02 11:48:02 2002 +0000
+++ b/lib/libform/internals.c   Fri Aug 02 11:49:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: internals.c,v 1.26 2002/07/29 05:23:30 blymn Exp $     */
+/*     $NetBSD: internals.c,v 1.27 2002/08/02 11:49:18 blymn Exp $     */
 
 /*-
  * Copyright (c) 1998-1999 Brett Lymn
@@ -1709,7 +1709,7 @@
                   * deny the request otherwise just fall through to
                   * the next_char request handler.
                   */
-               if (cur->cursor_xpos >= cur->lines[row].length - 1)
+               if (cur->cursor_xpos >= cur->cols - 1)
                        return E_REQUEST_DENIED;
 
                  /* FALLTHRU */
@@ -1734,7 +1734,8 @@
                        _formi_set_cursor_xpos(cur);
                } else {
                        if (cur->cursor_xpos >= (cur->lines[row].length - 1)) {
-                               if ((row + 1) >= cur->row_count)
+                               if (((row + 1) >= cur->row_count) ||
+                                   (c == REQ_RIGHT_CHAR))
                                        return E_REQUEST_DENIED;
                                
                                cur->cursor_xpos = 0;
@@ -1755,7 +1756,8 @@
                                cur->row_xpos++;
                                if (cur->cursor_xpos
                                    >= cur->lines[row].length) {
-                                       if ((row + 1) >= cur->row_count) {
+                                       if (((row + 1) >= cur->row_count) ||
+                                           (c == REQ_RIGHT_CHAR)) {
                                                cur->cursor_xpos = old_xpos;
                                                cur->row_xpos = old_row_pos;
                                                return E_REQUEST_DENIED;



Home | Main Index | Thread Index | Old Index