aboutsummaryrefslogtreecommitdiff
path: root/editors/vi.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-03-15 08:29:22 +0000
committerEric Andersen <andersen@codepoet.org>2004-03-15 08:29:22 +0000
commitc7bda1ce659294d6e22c06e087f6f265983c7578 (patch)
tree4c6d2217f4d8306c59cf1096f8664e1cfd167213 /editors/vi.c
parent8854004b41065b3d081af7f3df13a100b0c8bfbe (diff)
downloadbusybox-w32-c7bda1ce659294d6e22c06e087f6f265983c7578.tar.gz
busybox-w32-c7bda1ce659294d6e22c06e087f6f265983c7578.tar.bz2
busybox-w32-c7bda1ce659294d6e22c06e087f6f265983c7578.zip
Remove trailing whitespace. Update copyright to include 2004.
Diffstat (limited to 'editors/vi.c')
-rw-r--r--editors/vi.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 1932742ec..28eca754a 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -19,7 +19,7 @@
19 */ 19 */
20 20
21static const char vi_Version[] = 21static const char vi_Version[] =
22 "$Id: vi.c,v 1.33 2004/02/06 10:36:08 andersen Exp $"; 22 "$Id: vi.c,v 1.34 2004/03/15 08:28:32 andersen Exp $";
23 23
24/* 24/*
25 * To compile for standalone use: 25 * To compile for standalone use:
@@ -2548,14 +2548,14 @@ static void place_cursor(int row, int col, int opti)
2548 // char cm3[BUFSIZ]; 2548 // char cm3[BUFSIZ];
2549 int Rrow= last_row; 2549 int Rrow= last_row;
2550#endif /* CONFIG_FEATURE_VI_OPTIMIZE_CURSOR */ 2550#endif /* CONFIG_FEATURE_VI_OPTIMIZE_CURSOR */
2551 2551
2552 memset(cm1, '\0', BUFSIZ - 1); // clear the buffer 2552 memset(cm1, '\0', BUFSIZ - 1); // clear the buffer
2553 2553
2554 if (row < 0) row = 0; 2554 if (row < 0) row = 0;
2555 if (row >= rows) row = rows - 1; 2555 if (row >= rows) row = rows - 1;
2556 if (col < 0) col = 0; 2556 if (col < 0) col = 0;
2557 if (col >= columns) col = columns - 1; 2557 if (col >= columns) col = columns - 1;
2558 2558
2559 //----- 1. Try the standard terminal ESC sequence 2559 //----- 1. Try the standard terminal ESC sequence
2560 sprintf((char *) cm1, CMrc, row + 1, col + 1); 2560 sprintf((char *) cm1, CMrc, row + 1, col + 1);
2561 cm= cm1; 2561 cm= cm1;
@@ -2565,7 +2565,7 @@ static void place_cursor(int row, int col, int opti)
2565 //----- find the minimum # of chars to move cursor ------------- 2565 //----- find the minimum # of chars to move cursor -------------
2566 //----- 2. Try moving with discreet chars (Newline, [back]space, ...) 2566 //----- 2. Try moving with discreet chars (Newline, [back]space, ...)
2567 memset(cm2, '\0', BUFSIZ - 1); // clear the buffer 2567 memset(cm2, '\0', BUFSIZ - 1); // clear the buffer
2568 2568
2569 // move to the correct row 2569 // move to the correct row
2570 while (row < Rrow) { 2570 while (row < Rrow) {
2571 // the cursor has to move up 2571 // the cursor has to move up
@@ -2577,7 +2577,7 @@ static void place_cursor(int row, int col, int opti)
2577 strcat(cm2, CMdown); 2577 strcat(cm2, CMdown);
2578 Rrow++; 2578 Rrow++;
2579 } 2579 }
2580 2580
2581 // now move to the correct column 2581 // now move to the correct column
2582 strcat(cm2, "\r"); // start at col 0 2582 strcat(cm2, "\r"); // start at col 0
2583 // just send out orignal source char to get to correct place 2583 // just send out orignal source char to get to correct place
@@ -2748,7 +2748,7 @@ static void format_line(Byte *dest, Byte *src, int li)
2748{ 2748{
2749 int co; 2749 int co;
2750 Byte c; 2750 Byte c;
2751 2751
2752 for (co= 0; co < MAX_SCR_COLS; co++) { 2752 for (co= 0; co < MAX_SCR_COLS; co++) {
2753 c= ' '; // assume blank 2753 c= ' '; // assume blank
2754 if (li > 0 && co == 0) { 2754 if (li > 0 && co == 0) {
@@ -2899,7 +2899,7 @@ static void refresh(int full_screen)
2899#else 2899#else
2900 place_cursor(crow, ccol, FALSE); 2900 place_cursor(crow, ccol, FALSE);
2901#endif /* CONFIG_FEATURE_VI_OPTIMIZE_CURSOR */ 2901#endif /* CONFIG_FEATURE_VI_OPTIMIZE_CURSOR */
2902 2902
2903 if (offset != old_offset) 2903 if (offset != old_offset)
2904 old_offset = offset; 2904 old_offset = offset;
2905} 2905}
@@ -2997,29 +2997,29 @@ key_cmd_mode:
2997 //case 0x1d: // gs 2997 //case 0x1d: // gs
2998 //case 0x1e: // rs 2998 //case 0x1e: // rs
2999 //case 0x1f: // us 2999 //case 0x1f: // us
3000 //case '!': // !- 3000 //case '!': // !-
3001 //case '#': // #- 3001 //case '#': // #-
3002 //case '&': // &- 3002 //case '&': // &-
3003 //case '(': // (- 3003 //case '(': // (-
3004 //case ')': // )- 3004 //case ')': // )-
3005 //case '*': // *- 3005 //case '*': // *-
3006 //case ',': // ,- 3006 //case ',': // ,-
3007 //case '=': // =- 3007 //case '=': // =-
3008 //case '@': // @- 3008 //case '@': // @-
3009 //case 'F': // F- 3009 //case 'F': // F-
3010 //case 'K': // K- 3010 //case 'K': // K-
3011 //case 'Q': // Q- 3011 //case 'Q': // Q-
3012 //case 'S': // S- 3012 //case 'S': // S-
3013 //case 'T': // T- 3013 //case 'T': // T-
3014 //case 'V': // V- 3014 //case 'V': // V-
3015 //case '[': // [- 3015 //case '[': // [-
3016 //case '\\': // \- 3016 //case '\\': // \-
3017 //case ']': // ]- 3017 //case ']': // ]-
3018 //case '_': // _- 3018 //case '_': // _-
3019 //case '`': // `- 3019 //case '`': // `-
3020 //case 'g': // g- 3020 //case 'g': // g-
3021 //case 'u': // u- FIXME- there is no undo 3021 //case 'u': // u- FIXME- there is no undo
3022 //case 'v': // v- 3022 //case 'v': // v-
3023 default: // unrecognised command 3023 default: // unrecognised command
3024 buf[0] = c; 3024 buf[0] = c;
3025 buf[1] = '\0'; 3025 buf[1] = '\0';
@@ -3338,15 +3338,15 @@ key_cmd_mode:
3338 break; 3338 break;
3339#endif /* CONFIG_FEATURE_VI_SEARCH */ 3339#endif /* CONFIG_FEATURE_VI_SEARCH */
3340 case '0': // 0- goto begining of line 3340 case '0': // 0- goto begining of line
3341 case '1': // 1- 3341 case '1': // 1-
3342 case '2': // 2- 3342 case '2': // 2-
3343 case '3': // 3- 3343 case '3': // 3-
3344 case '4': // 4- 3344 case '4': // 4-
3345 case '5': // 5- 3345 case '5': // 5-
3346 case '6': // 6- 3346 case '6': // 6-
3347 case '7': // 7- 3347 case '7': // 7-
3348 case '8': // 8- 3348 case '8': // 8-
3349 case '9': // 9- 3349 case '9': // 9-
3350 if (c == '0' && cmdcnt < 1) { 3350 if (c == '0' && cmdcnt < 1) {
3351 dot_begin(); // this was a standalone zero 3351 dot_begin(); // this was a standalone zero
3352 } else { 3352 } else {