diff options
Diffstat (limited to 'editors/vi.c')
-rw-r--r-- | editors/vi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/editors/vi.c b/editors/vi.c index 712af0326..9d74acc91 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
@@ -536,7 +536,6 @@ static void edit_file(char *fn) | |||
536 | #define cur_line edit_file__cur_line | 536 | #define cur_line edit_file__cur_line |
537 | #endif | 537 | #endif |
538 | int c; | 538 | int c; |
539 | int size; | ||
540 | #if ENABLE_FEATURE_VI_USE_SIGNALS | 539 | #if ENABLE_FEATURE_VI_USE_SIGNALS |
541 | int sig; | 540 | int sig; |
542 | #endif | 541 | #endif |
@@ -545,7 +544,6 @@ static void edit_file(char *fn) | |||
545 | rawmode(); | 544 | rawmode(); |
546 | rows = 24; | 545 | rows = 24; |
547 | columns = 80; | 546 | columns = 80; |
548 | size = 0; | ||
549 | IF_FEATURE_VI_ASK_TERMINAL(G.get_rowcol_error =) query_screen_dimensions(); | 547 | IF_FEATURE_VI_ASK_TERMINAL(G.get_rowcol_error =) query_screen_dimensions(); |
550 | #if ENABLE_FEATURE_VI_ASK_TERMINAL | 548 | #if ENABLE_FEATURE_VI_ASK_TERMINAL |
551 | if (G.get_rowcol_error /* TODO? && no input on stdin */) { | 549 | if (G.get_rowcol_error /* TODO? && no input on stdin */) { |
@@ -1690,12 +1688,16 @@ static char *char_insert(char *p, char c) // insert the char c at 'p' | |||
1690 | p = text_hole_delete(p, p); // shrink buffer 1 char | 1688 | p = text_hole_delete(p, p); // shrink buffer 1 char |
1691 | } | 1689 | } |
1692 | } else { | 1690 | } else { |
1691 | #if ENABLE_FEATURE_VI_SETOPTS | ||
1693 | // insert a char into text[] | 1692 | // insert a char into text[] |
1694 | char *sp; // "save p" | 1693 | char *sp; // "save p" |
1694 | #endif | ||
1695 | 1695 | ||
1696 | if (c == 13) | 1696 | if (c == 13) |
1697 | c = '\n'; // translate \r to \n | 1697 | c = '\n'; // translate \r to \n |
1698 | #if ENABLE_FEATURE_VI_SETOPTS | ||
1698 | sp = p; // remember addr of insert | 1699 | sp = p; // remember addr of insert |
1700 | #endif | ||
1699 | p += 1 + stupid_insert(p, c); // insert the char | 1701 | p += 1 + stupid_insert(p, c); // insert the char |
1700 | #if ENABLE_FEATURE_VI_SETOPTS | 1702 | #if ENABLE_FEATURE_VI_SETOPTS |
1701 | if (showmatch && strchr(")]}", *sp) != NULL) { | 1703 | if (showmatch && strchr(")]}", *sp) != NULL) { |