diff options
-rw-r--r-- | editors/vi.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/editors/vi.c b/editors/vi.c index b41cf451c..ce261feca 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
@@ -722,6 +722,22 @@ static void screen_erase(void) | |||
722 | memset(screen, ' ', screensize); // clear new screen | 722 | memset(screen, ' ', screensize); // clear new screen |
723 | } | 723 | } |
724 | 724 | ||
725 | static char *new_screen(int ro, int co) | ||
726 | { | ||
727 | int li; | ||
728 | |||
729 | free(screen); | ||
730 | screensize = ro * co + 8; | ||
731 | screen = xmalloc(screensize); | ||
732 | // initialize the new screen. assume this will be a empty file. | ||
733 | screen_erase(); | ||
734 | // non-existent text[] lines start with a tilde (~). | ||
735 | for (li = 1; li < ro - 1; li++) { | ||
736 | screen[(li * co) + 0] = '~'; | ||
737 | } | ||
738 | return screen; | ||
739 | } | ||
740 | |||
725 | //----- Synchronize the cursor to Dot -------------------------- | 741 | //----- Synchronize the cursor to Dot -------------------------- |
726 | static NOINLINE void sync_cursor(char *d, int *row, int *col) | 742 | static NOINLINE void sync_cursor(char *d, int *row, int *col) |
727 | { | 743 | { |
@@ -2882,22 +2898,6 @@ static void colon(char *buf) | |||
2882 | // TAB NEWLINE VT FF RETURN SPACE | 2898 | // TAB NEWLINE VT FF RETURN SPACE |
2883 | // DO NOT COUNT NEWLINE AS WHITESPACE | 2899 | // DO NOT COUNT NEWLINE AS WHITESPACE |
2884 | 2900 | ||
2885 | static char *new_screen(int ro, int co) | ||
2886 | { | ||
2887 | int li; | ||
2888 | |||
2889 | free(screen); | ||
2890 | screensize = ro * co + 8; | ||
2891 | screen = xmalloc(screensize); | ||
2892 | // initialize the new screen. assume this will be a empty file. | ||
2893 | screen_erase(); | ||
2894 | // non-existent text[] lines start with a tilde (~). | ||
2895 | for (li = 1; li < ro - 1; li++) { | ||
2896 | screen[(li * co) + 0] = '~'; | ||
2897 | } | ||
2898 | return screen; | ||
2899 | } | ||
2900 | |||
2901 | static int st_test(char *p, int type, int dir, char *tested) | 2901 | static int st_test(char *p, int type, int dir, char *tested) |
2902 | { | 2902 | { |
2903 | char c, c0, ci; | 2903 | char c, c0, ci; |