OSDN Git Service

DELETE・ュ。シシォツホ、ホニーコ釥ャ。「タ霪ホ・ミ・ー、テ、ソBACKSPACE、ホ・ウ。シ・ノ、ヒーヘツク、キ、ニ、、、ニ。「ニー、ォ、ハ、ッ、ハ、テ...
authormogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 3 Nov 2003 08:54:27 +0000 (08:54 +0000)
committermogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 3 Nov 2003 08:54:27 +0000 (08:54 +0000)
src/autopick.c

index 74ee0ee..7e0cbba 100644 (file)
@@ -5372,8 +5372,11 @@ static bool do_editor_command(text_body_type *tb, int com_id)
        }
 
        case EC_DELETE_CHAR:
+       {
                /* DELETE == go forward + BACK SPACE */
 
+               int len;
+
                /* Ignore selection */
                if (tb->mark)
                {
@@ -5388,8 +5391,25 @@ static bool do_editor_command(text_body_type *tb, int com_id)
 #endif
                tb->cx++;
 
+               /* Pass through the end of line to next line */
+               len = strlen(tb->lines_list[tb->cy]);
+               if (len < tb->cx)
+               {
+                       if (tb->lines_list[tb->cy + 1])
+                       {
+                               tb->cy++;
+                               tb->cx = 0;
+                       }
+                       else
+                       {
+                               tb->cx = len;
+                               break;
+                       }
+               }
+
                do_editor_command(tb, EC_BACKSPACE);
                break;
+       }
 
        case EC_BACKSPACE:
        {