diff options
| author | Eric Andersen <andersen@codepoet.org> | 2001-05-07 22:57:47 +0000 |
|---|---|---|
| committer | Eric Andersen <andersen@codepoet.org> | 2001-05-07 22:57:47 +0000 |
| commit | c33ebc9741a475962e29fafe60bb0ba4450854b6 (patch) | |
| tree | 140a377a23216aad85346d940e66f203dcd80b30 | |
| parent | 04b0354d8e0b09ed2af80f590e2203137114819b (diff) | |
| download | busybox-w32-c33ebc9741a475962e29fafe60bb0ba4450854b6.tar.gz busybox-w32-c33ebc9741a475962e29fafe60bb0ba4450854b6.tar.bz2 busybox-w32-c33ebc9741a475962e29fafe60bb0ba4450854b6.zip | |
A patch from Vladimir to use last_char_is(), and a patch from
Larry to fix a silly bug when BB_FEATURE_VI_OPTIMIZE_CURSOR
is not defined.
| -rw-r--r-- | editors/vi.c | 11 | ||||
| -rw-r--r-- | vi.c | 11 |
2 files changed, 14 insertions, 8 deletions
diff --git a/editors/vi.c b/editors/vi.c index 54f1d265c..5a68ba9f1 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | */ | 19 | */ |
| 20 | 20 | ||
| 21 | char *vi_Version = | 21 | char *vi_Version = |
| 22 | "$Id: vi.c,v 1.6 2001/05/07 17:37:43 andersen Exp $"; | 22 | "$Id: vi.c,v 1.7 2001/05/07 22:57:47 andersen Exp $"; |
| 23 | 23 | ||
| 24 | /* | 24 | /* |
| 25 | * To compile for standalone use: | 25 | * To compile for standalone use: |
| @@ -1760,9 +1760,10 @@ static void colon(Byte * buf) | |||
| 1760 | while (isblnk(*buf)) | 1760 | while (isblnk(*buf)) |
| 1761 | buf++; | 1761 | buf++; |
| 1762 | strcpy((char *) args, (char *) buf); | 1762 | strcpy((char *) args, (char *) buf); |
| 1763 | if (last_char_is((char *)cmd, '!')) { | 1763 | buf1 = last_char_is((char *)cmd, '!'); |
| 1764 | if (buf1) { | ||
| 1764 | useforce = TRUE; | 1765 | useforce = TRUE; |
| 1765 | cmd[strlen((char *) cmd) - 1] = '\0'; // get rid of ! | 1766 | *buf1 = '\0'; // get rid of ! |
| 1766 | } | 1767 | } |
| 1767 | if (b >= 0) { | 1768 | if (b >= 0) { |
| 1768 | // if there is only one addr, then the addr | 1769 | // if there is only one addr, then the addr |
| @@ -3919,9 +3920,11 @@ static void refresh(int full_screen) | |||
| 3919 | } | 3920 | } |
| 3920 | } | 3921 | } |
| 3921 | 3922 | ||
| 3922 | place_cursor(crow, ccol, (crow == last_row) ? TRUE : FALSE); | ||
| 3923 | #ifdef BB_FEATURE_VI_OPTIMIZE_CURSOR | 3923 | #ifdef BB_FEATURE_VI_OPTIMIZE_CURSOR |
| 3924 | place_cursor(crow, ccol, (crow == last_row) ? TRUE : FALSE); | ||
| 3924 | last_row = crow; | 3925 | last_row = crow; |
| 3926 | #else | ||
| 3927 | place_cursor(crow, ccol, FALSE); | ||
| 3925 | #endif /* BB_FEATURE_VI_OPTIMIZE_CURSOR */ | 3928 | #endif /* BB_FEATURE_VI_OPTIMIZE_CURSOR */ |
| 3926 | 3929 | ||
| 3927 | if (offset != old_offset) | 3930 | if (offset != old_offset) |
| @@ -19,7 +19,7 @@ | |||
| 19 | */ | 19 | */ |
| 20 | 20 | ||
| 21 | char *vi_Version = | 21 | char *vi_Version = |
| 22 | "$Id: vi.c,v 1.6 2001/05/07 17:37:43 andersen Exp $"; | 22 | "$Id: vi.c,v 1.7 2001/05/07 22:57:47 andersen Exp $"; |
| 23 | 23 | ||
| 24 | /* | 24 | /* |
| 25 | * To compile for standalone use: | 25 | * To compile for standalone use: |
| @@ -1760,9 +1760,10 @@ static void colon(Byte * buf) | |||
| 1760 | while (isblnk(*buf)) | 1760 | while (isblnk(*buf)) |
| 1761 | buf++; | 1761 | buf++; |
| 1762 | strcpy((char *) args, (char *) buf); | 1762 | strcpy((char *) args, (char *) buf); |
| 1763 | if (last_char_is((char *)cmd, '!')) { | 1763 | buf1 = last_char_is((char *)cmd, '!'); |
| 1764 | if (buf1) { | ||
| 1764 | useforce = TRUE; | 1765 | useforce = TRUE; |
| 1765 | cmd[strlen((char *) cmd) - 1] = '\0'; // get rid of ! | 1766 | *buf1 = '\0'; // get rid of ! |
| 1766 | } | 1767 | } |
| 1767 | if (b >= 0) { | 1768 | if (b >= 0) { |
| 1768 | // if there is only one addr, then the addr | 1769 | // if there is only one addr, then the addr |
| @@ -3919,9 +3920,11 @@ static void refresh(int full_screen) | |||
| 3919 | } | 3920 | } |
| 3920 | } | 3921 | } |
| 3921 | 3922 | ||
| 3922 | place_cursor(crow, ccol, (crow == last_row) ? TRUE : FALSE); | ||
| 3923 | #ifdef BB_FEATURE_VI_OPTIMIZE_CURSOR | 3923 | #ifdef BB_FEATURE_VI_OPTIMIZE_CURSOR |
| 3924 | place_cursor(crow, ccol, (crow == last_row) ? TRUE : FALSE); | ||
| 3924 | last_row = crow; | 3925 | last_row = crow; |
| 3926 | #else | ||
| 3927 | place_cursor(crow, ccol, FALSE); | ||
| 3925 | #endif /* BB_FEATURE_VI_OPTIMIZE_CURSOR */ | 3928 | #endif /* BB_FEATURE_VI_OPTIMIZE_CURSOR */ |
| 3926 | 3929 | ||
| 3927 | if (offset != old_offset) | 3930 | if (offset != old_offset) |
