This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 6b53a19  Arrow keys not working when in INSERT mode
6b53a19 is described below

commit 6b53a1959b0ff7ccdbe7f55ed78e13073cbbda6c
Author: jturnsek <[email protected]>
AuthorDate: Thu May 20 08:08:30 2021 +0200

    Arrow keys not working when in INSERT mode
---
 system/vi/vi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/system/vi/vi.c b/system/vi/vi.c
index 4ba0eef..31d812f 100644
--- a/system/vi/vi.c
+++ b/system/vi/vi.c
@@ -5392,7 +5392,7 @@ static void vi_insert_mode(FAR struct vi_s *vi)
        */
 
       vi->updatereqcol = true;
-      if (!iscntrl(ch) || ch == '\t')
+      if (isprint(ch) || ch == '\t')
         {
           /* Insert the filtered character into the buffer */
 
@@ -5586,7 +5586,7 @@ static void vi_insert_mode(FAR struct vi_s *vi)
               vi->curpos = vi_cursorright(vi, vi->curpos, 1);
               if (vi->curpos >= vi->textsize)
                 {
-                  vi->curpos = vi->textsize - 1;
+                  vi->curpos = vi->textsize;
                 }
             }
             break;

Reply via email to