diff options
author | Ron Yorston <rmy@pobox.com> | 2019-03-31 08:55:48 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2019-03-31 09:51:00 +0100 |
commit | 61e0e3160a8be3ed8488b09200a5dca1bd1b21b4 (patch) | |
tree | d55341d875d1dd0d77445960723a47418efd14e5 /editors/vi.c | |
parent | be2949717934c19890879cf2a8fc74c5da55d1c7 (diff) | |
parent | 35082fc2c17369223669e099f422acc0982ee4ff (diff) | |
download | busybox-w32-61e0e3160a8be3ed8488b09200a5dca1bd1b21b4.tar.gz busybox-w32-61e0e3160a8be3ed8488b09200a5dca1bd1b21b4.tar.bz2 busybox-w32-61e0e3160a8be3ed8488b09200a5dca1bd1b21b4.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'editors/vi.c')
-rw-r--r-- | editors/vi.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/editors/vi.c b/editors/vi.c index d5d7dfffc..2a7d9f0a8 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
@@ -345,7 +345,8 @@ struct globals { | |||
345 | 345 | ||
346 | /* a few references only */ | 346 | /* a few references only */ |
347 | #if ENABLE_FEATURE_VI_YANKMARK | 347 | #if ENABLE_FEATURE_VI_YANKMARK |
348 | int YDreg, Ureg; // default delete register and orig line for "U" | 348 | smalluint YDreg;//,Ureg;// default delete register and orig line for "U" |
349 | #define Ureg 27 | ||
349 | char *reg[28]; // named register a-z, "D", and "U" 0-25,26,27 | 350 | char *reg[28]; // named register a-z, "D", and "U" 0-25,26,27 |
350 | char *mark[28]; // user marks points somewhere in text[]- a-z and previous context '' | 351 | char *mark[28]; // user marks points somewhere in text[]- a-z and previous context '' |
351 | char *context_start, *context_end; | 352 | char *context_start, *context_end; |
@@ -457,7 +458,7 @@ struct globals { | |||
457 | #define format_edit_status__tot (G.format_edit_status__tot) | 458 | #define format_edit_status__tot (G.format_edit_status__tot) |
458 | 459 | ||
459 | #define YDreg (G.YDreg ) | 460 | #define YDreg (G.YDreg ) |
460 | #define Ureg (G.Ureg ) | 461 | //#define Ureg (G.Ureg ) |
461 | #define mark (G.mark ) | 462 | #define mark (G.mark ) |
462 | #define context_start (G.context_start ) | 463 | #define context_start (G.context_start ) |
463 | #define context_end (G.context_end ) | 464 | #define context_end (G.context_end ) |
@@ -796,7 +797,7 @@ static void edit_file(char *fn) | |||
796 | 797 | ||
797 | #if ENABLE_FEATURE_VI_YANKMARK | 798 | #if ENABLE_FEATURE_VI_YANKMARK |
798 | YDreg = 26; // default Yank/Delete reg | 799 | YDreg = 26; // default Yank/Delete reg |
799 | Ureg = 27; // hold orig line for "U" cmd | 800 | // Ureg = 27; - const // hold orig line for "U" cmd |
800 | mark[26] = mark[27] = text; // init "previous context" | 801 | mark[26] = mark[27] = text; // init "previous context" |
801 | #endif | 802 | #endif |
802 | 803 | ||
@@ -3410,7 +3411,15 @@ static void refresh(int full_screen) | |||
3410 | if (ENABLE_FEATURE_VI_WIN_RESIZE IF_FEATURE_VI_ASK_TERMINAL(&& !G.get_rowcol_error) ) { | 3411 | if (ENABLE_FEATURE_VI_WIN_RESIZE IF_FEATURE_VI_ASK_TERMINAL(&& !G.get_rowcol_error) ) { |
3411 | unsigned c = columns, r = rows; | 3412 | unsigned c = columns, r = rows; |
3412 | query_screen_dimensions(); | 3413 | query_screen_dimensions(); |
3414 | #if ENABLE_FEATURE_VI_USE_SIGNALS | ||
3413 | full_screen |= (c - columns) | (r - rows); | 3415 | full_screen |= (c - columns) | (r - rows); |
3416 | #else | ||
3417 | if (c != columns || r != rows) { | ||
3418 | full_screen = TRUE; | ||
3419 | /* update screen memory since SIGWINCH won't have done it */ | ||
3420 | new_screen(rows, columns); | ||
3421 | } | ||
3422 | #endif | ||
3414 | } | 3423 | } |
3415 | sync_cursor(dot, &crow, &ccol); // where cursor will be (on "dot") | 3424 | sync_cursor(dot, &crow, &ccol); // where cursor will be (on "dot") |
3416 | tp = screenbegin; // index into text[] of top line | 3425 | tp = screenbegin; // index into text[] of top line |
@@ -4236,8 +4245,8 @@ static void do_cmd(int c) | |||
4236 | if (*p == '\n') | 4245 | if (*p == '\n') |
4237 | cnt++; | 4246 | cnt++; |
4238 | } | 4247 | } |
4239 | status_line("%s %d lines (%d chars) using [%c]", | 4248 | status_line("%s %u lines (%u chars) using [%c]", |
4240 | buf, cnt, strlen(reg[YDreg]), what_reg()); | 4249 | buf, cnt, (unsigned)strlen(reg[YDreg]), what_reg()); |
4241 | #endif | 4250 | #endif |
4242 | end_cmd_q(); // stop adding to q | 4251 | end_cmd_q(); // stop adding to q |
4243 | } | 4252 | } |