aboutsummaryrefslogtreecommitdiff
path: root/editors/vi.c
diff options
context:
space:
mode:
Diffstat (limited to 'editors/vi.c')
-rw-r--r--editors/vi.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 3eed279e7..075f714cf 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -411,7 +411,6 @@ struct globals {
411 char undo_text[1]; // text that was deleted (if deletion) 411 char undo_text[1]; // text that was deleted (if deletion)
412 } *undo_stack_tail; 412 } *undo_stack_tail;
413#endif /* ENABLE_FEATURE_VI_UNDO */ 413#endif /* ENABLE_FEATURE_VI_UNDO */
414
415}; 414};
416#define G (*ptr_to_globals) 415#define G (*ptr_to_globals)
417#define text (G.text ) 416#define text (G.text )
@@ -501,7 +500,7 @@ static char *prev_line(char *); // return pointer to prev line B-o-l
501static char *next_line(char *); // return pointer to next line B-o-l 500static char *next_line(char *); // return pointer to next line B-o-l
502static char *end_screen(void); // get pointer to last char on screen 501static char *end_screen(void); // get pointer to last char on screen
503static int count_lines(char *, char *); // count line from start to stop 502static int count_lines(char *, char *); // count line from start to stop
504static char *find_line(int); // find begining of line #li 503static char *find_line(int); // find beginning of line #li
505static char *move_to_col(char *, int); // move "p" to column l 504static char *move_to_col(char *, int); // move "p" to column l
506static void dot_left(void); // move dot left- dont leave line 505static void dot_left(void); // move dot left- dont leave line
507static void dot_right(void); // move dot right- dont leave line 506static void dot_right(void); // move dot right- dont leave line
@@ -1684,10 +1683,10 @@ static char *dollar_line(char *p) // return pointer to just before NL line
1684 1683
1685static char *prev_line(char *p) // return pointer first char prev line 1684static char *prev_line(char *p) // return pointer first char prev line
1686{ 1685{
1687 p = begin_line(p); // goto begining of cur line 1686 p = begin_line(p); // goto beginning of cur line
1688 if (p > text && p[-1] == '\n') 1687 if (p > text && p[-1] == '\n')
1689 p--; // step to prev line 1688 p--; // step to prev line
1690 p = begin_line(p); // goto begining of prev line 1689 p = begin_line(p); // goto beginning of prev line
1691 return p; 1690 return p;
1692} 1691}
1693 1692
@@ -1735,7 +1734,7 @@ static int count_lines(char *start, char *stop)
1735 return cnt; 1734 return cnt;
1736} 1735}
1737 1736
1738static char *find_line(int li) // find begining of line #li 1737static char *find_line(int li) // find beginning of line #li
1739{ 1738{
1740 char *q; 1739 char *q;
1741 1740
@@ -3404,7 +3403,7 @@ static void refresh(int full_screen)
3404 tp = t + 1; 3403 tp = t + 1;
3405 } 3404 }
3406 3405
3407 // see if there are any changes between vitual screen and out_buf 3406 // see if there are any changes between virtual screen and out_buf
3408 changed = FALSE; // assume no change 3407 changed = FALSE; // assume no change
3409 cs = 0; 3408 cs = 0;
3410 ce = columns - 1; 3409 ce = columns - 1;
@@ -3441,7 +3440,7 @@ static void refresh(int full_screen)
3441 if (cs < 0) cs = 0; 3440 if (cs < 0) cs = 0;
3442 if (ce > columns - 1) ce = columns - 1; 3441 if (ce > columns - 1) ce = columns - 1;
3443 if (cs > ce) { cs = 0; ce = columns - 1; } 3442 if (cs > ce) { cs = 0; ce = columns - 1; }
3444 // is there a change between vitual screen and out_buf 3443 // is there a change between virtual screen and out_buf
3445 if (changed) { 3444 if (changed) {
3446 // copy changed part of buffer to virtual screen 3445 // copy changed part of buffer to virtual screen
3447 memcpy(sp+cs, out_buf+cs, ce-cs+1); 3446 memcpy(sp+cs, out_buf+cs, ce-cs+1);
@@ -3891,7 +3890,7 @@ static void do_cmd(int c)
3891 } 3890 }
3892 break; 3891 break;
3893#endif /* FEATURE_VI_SEARCH */ 3892#endif /* FEATURE_VI_SEARCH */
3894 case '0': // 0- goto begining of line 3893 case '0': // 0- goto beginning of line
3895 case '1': // 1- 3894 case '1': // 1-
3896 case '2': // 2- 3895 case '2': // 2-
3897 case '3': // 3- 3896 case '3': // 3-