aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/api/buffer.c2
-rw-r--r--src/nvim/buffer.c12
-rw-r--r--src/nvim/globals.h3
-rw-r--r--src/nvim/option.c4
-rw-r--r--src/nvim/os_unix.c10
-rw-r--r--src/nvim/term.c131
-rw-r--r--src/nvim/testdir/Makefile2
-rw-r--r--src/nvim/testdir/test107.in38
-rw-r--r--src/nvim/testdir/test107.ok4
-rw-r--r--src/nvim/version.c2
10 files changed, 56 insertions, 152 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index 21bfc5ede0..a268e04559 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -490,7 +490,7 @@ static void switch_to_win_for_buf(buf_T *buf,
win_T *wp;
tabpage_T *tp;
- if (find_win_for_buf(buf, &wp, &tp) == FAIL
+ if (!find_win_for_buf(buf, &wp, &tp)
|| switch_win(save_curwinp, save_curtabp, wp, tp, true) == FAIL)
switch_buffer(save_curbufp, buf);
}
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index a1efc98516..ee2b1ecf1d 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -4246,7 +4246,7 @@ char_u *buf_spname(buf_T *buf)
* For location list window, w_llist_ref points to the location list.
* For quickfix window, w_llist_ref is NULL.
*/
- if (find_win_for_buf(buf, &win, &tp) == OK && win->w_llist_ref != NULL)
+ if (find_win_for_buf(buf, &win, &tp) && win->w_llist_ref != NULL)
return (char_u *)_(msg_loclist);
else
return (char_u *)_(msg_qflist);
@@ -4265,17 +4265,17 @@ char_u *buf_spname(buf_T *buf)
/*
* Find a window for buffer "buf".
- * If found OK is returned and "wp" and "tp" are set to the window and tabpage.
- * If not found FAIL is returned.
+ * If found true is returned and "wp" and "tp" are set to the window and tabpage.
+ * If not found false is returned.
*/
-int find_win_for_buf(buf_T *buf, win_T **wp, tabpage_T **tp)
+bool find_win_for_buf(buf_T *buf, win_T **wp, tabpage_T **tp)
{
FOR_ALL_TAB_WINDOWS(*tp, *wp) {
if ((*wp)->w_buffer == buf) {
- return OK;
+ return true;
}
}
- return FAIL;
+ return false;
}
/*
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index c0122ae189..a0cbedcc57 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -902,9 +902,6 @@ EXTERN int read_cmd_fd INIT(= 0); /* fd to read commands from */
/* volatile because it is used in signal handler catch_sigint(). */
EXTERN volatile int got_int INIT(= FALSE); /* set to TRUE when interrupt
signal occurred */
-#ifdef USE_TERM_CONSOLE
-EXTERN int term_console INIT(= FALSE); /* set to TRUE when console used */
-#endif
EXTERN int termcap_active INIT(= FALSE); /* set by starttermcap() */
EXTERN int cur_tmode INIT(= TMODE_COOK); /* input terminal mode */
EXTERN int bangredo INIT(= FALSE); /* set to TRUE with ! command */
diff --git a/src/nvim/option.c b/src/nvim/option.c
index fd834788db..ca49a3dcb8 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -965,10 +965,10 @@ static struct vimoption
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"initclipboard","icpb",P_STRING|P_VI_DEF|P_SECURE,
(char_u *)&p_icpb, PV_NONE,
- {(char_u *)NULL, (char_u *)0L} SCRIPTID_INIT},
+ {(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
{"initpython","ipy",P_STRING|P_VI_DEF|P_SECURE,
(char_u *)&p_ipy, PV_NONE,
- {(char_u *)NULL, (char_u *)0L} SCRIPTID_INIT},
+ {(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
{"insertmode", "im", P_BOOL|P_VI_DEF|P_VIM,
(char_u *)&p_im, PV_NONE,
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c
index e3b14fa352..d4b661bff8 100644
--- a/src/nvim/os_unix.c
+++ b/src/nvim/os_unix.c
@@ -298,14 +298,6 @@ int use_xterm_mouse(void)
return 0;
}
-int vim_is_iris(char_u *name)
-{
- if (name == NULL)
- return FALSE;
- return STRNICMP(name, "iris-ansi", 9) == 0
- || STRCMP(name, "builtin_iris-ansi") == 0;
-}
-
int vim_is_vt300(char_u *name)
{
if (name == NULL)
@@ -324,7 +316,7 @@ int vim_is_fastterm(char_u *name)
{
if (name == NULL)
return FALSE;
- if (vim_is_xterm(name) || vim_is_vt300(name) || vim_is_iris(name))
+ if (vim_is_xterm(name) || vim_is_vt300(name))
return TRUE;
return STRNICMP(name, "hpterm", 6) == 0
|| STRNICMP(name, "sun-cmd", 7) == 0
diff --git a/src/nvim/term.c b/src/nvim/term.c
index e231869003..f5c2d3c174 100644
--- a/src/nvim/term.c
+++ b/src/nvim/term.c
@@ -792,115 +792,6 @@ static struct builtin_term builtin_termcaps[] =
{TERMCAP2KEY('F', 'R'), "\033[58;*~"}, /* F37 */
# endif
-# if defined(UNIX) || defined(ALL_BUILTIN_TCAPS)
- /*
- * iris-ansi for Silicon Graphics machines.
- */
- {(int)KS_NAME, "iris-ansi"},
- {(int)KS_CE, "\033[K"},
- {(int)KS_CD, "\033[J"},
- {(int)KS_AL, "\033[L"},
-# ifdef TERMINFO
- {(int)KS_CAL, "\033[%p1%dL"},
-# else
- {(int)KS_CAL, "\033[%dL"},
-# endif
- {(int)KS_DL, "\033[M"},
-# ifdef TERMINFO
- {(int)KS_CDL, "\033[%p1%dM"},
-# else
- {(int)KS_CDL, "\033[%dM"},
-# endif
- {(int)KS_CL, "\033[H\033[2J"},
- {(int)KS_VE, "\033[9/y\033[12/y"}, /* These aren't documented */
- {(int)KS_VS, "\033[10/y\033[=1h\033[=2l"}, /* These aren't documented */
- {(int)KS_TI, "\033[=6h"},
- {(int)KS_TE, "\033[=6l"},
- {(int)KS_SE, "\033[21;27m"},
- {(int)KS_SO, "\033[1;7m"},
- {(int)KS_ME, "\033[m"},
- {(int)KS_MR, "\033[7m"},
- {(int)KS_MD, "\033[1m"},
- {(int)KS_CCO, "8"}, /* allow 8 colors */
- {(int)KS_CZH, "\033[3m"}, /* italic mode on */
- {(int)KS_CZR, "\033[23m"}, /* italic mode off */
- {(int)KS_US, "\033[4m"}, /* underline on */
- {(int)KS_UE, "\033[24m"}, /* underline off */
-# ifdef TERMINFO
- {(int)KS_CAB, "\033[4%p1%dm"}, /* set background color (ANSI) */
- {(int)KS_CAF, "\033[3%p1%dm"}, /* set foreground color (ANSI) */
- {(int)KS_CSB, "\033[102;%p1%dm"}, /* set screen background color */
- {(int)KS_CSF, "\033[101;%p1%dm"}, /* set screen foreground color */
-# else
- {(int)KS_CAB, "\033[4%dm"}, /* set background color (ANSI) */
- {(int)KS_CAF, "\033[3%dm"}, /* set foreground color (ANSI) */
- {(int)KS_CSB, "\033[102;%dm"}, /* set screen background color */
- {(int)KS_CSF, "\033[101;%dm"}, /* set screen foreground color */
-# endif
- {(int)KS_MS, "y"}, /* guessed */
- {(int)KS_UT, "y"}, /* guessed */
- {(int)KS_LE, "\b"},
-# ifdef TERMINFO
- {(int)KS_CM, "\033[%i%p1%d;%p2%dH"},
-# else
- {(int)KS_CM, "\033[%i%d;%dH"},
-# endif
- {(int)KS_SR, "\033M"},
-# ifdef TERMINFO
- {(int)KS_CRI, "\033[%p1%dC"},
-# else
- {(int)KS_CRI, "\033[%dC"},
-# endif
- {(int)KS_CIS, "\033P3.y"},
- {(int)KS_CIE, "\234"}, /* ST "String Terminator" */
- {(int)KS_TS, "\033P1.y"},
- {(int)KS_FS, "\234"}, /* ST "String Terminator" */
-# ifdef TERMINFO
- {(int)KS_CWS, "\033[203;%p1%d;%p2%d/y"},
- {(int)KS_CWP, "\033[205;%p1%d;%p2%d/y"},
-# else
- {(int)KS_CWS, "\033[203;%d;%d/y"},
- {(int)KS_CWP, "\033[205;%d;%d/y"},
-# endif
- {K_UP, "\033[A"},
- {K_DOWN, "\033[B"},
- {K_LEFT, "\033[D"},
- {K_RIGHT, "\033[C"},
- {K_S_UP, "\033[161q"},
- {K_S_DOWN, "\033[164q"},
- {K_S_LEFT, "\033[158q"},
- {K_S_RIGHT, "\033[167q"},
- {K_F1, "\033[001q"},
- {K_F2, "\033[002q"},
- {K_F3, "\033[003q"},
- {K_F4, "\033[004q"},
- {K_F5, "\033[005q"},
- {K_F6, "\033[006q"},
- {K_F7, "\033[007q"},
- {K_F8, "\033[008q"},
- {K_F9, "\033[009q"},
- {K_F10, "\033[010q"},
- {K_F11, "\033[011q"},
- {K_F12, "\033[012q"},
- {K_S_F1, "\033[013q"},
- {K_S_F2, "\033[014q"},
- {K_S_F3, "\033[015q"},
- {K_S_F4, "\033[016q"},
- {K_S_F5, "\033[017q"},
- {K_S_F6, "\033[018q"},
- {K_S_F7, "\033[019q"},
- {K_S_F8, "\033[020q"},
- {K_S_F9, "\033[021q"},
- {K_S_F10, "\033[022q"},
- {K_S_F11, "\033[023q"},
- {K_S_F12, "\033[024q"},
- {K_INS, "\033[139q"},
- {K_HOME, "\033[H"},
- {K_END, "\033[146q"},
- {K_PAGEUP, "\033[150q"},
- {K_PAGEDOWN, "\033[154q"},
-# endif
-
# if defined(DEBUG) || defined(ALL_BUILTIN_TCAPS)
/*
* for debugging
@@ -1132,9 +1023,7 @@ static struct builtin_term *find_builtin_term(char_u *term)
while (p->bt_string != NULL) {
if (p->bt_entry == (int)KS_NAME) {
#ifdef UNIX
- if (STRCMP(p->bt_string, "iris-ansi") == 0 && vim_is_iris(term))
- return p;
- else if (STRCMP(p->bt_string, "xterm") == 0 && vim_is_xterm(term))
+ if (STRCMP(p->bt_string, "xterm") == 0 && vim_is_xterm(term))
return p;
else
#endif
@@ -1530,29 +1419,13 @@ int set_termname(char_u *term)
# endif
-#ifdef USE_TERM_CONSOLE
- /* DEFAULT_TERM indicates that it is the machine console. */
- if (STRCMP(term, DEFAULT_TERM) != 0)
- term_console = FALSE;
- else {
- term_console = TRUE;
- }
-#endif
-
#if defined(UNIX)
/*
- * 'ttyfast' is default on for xterm, iris-ansi and a few others.
+ * 'ttyfast' is default on for xterm and a few others.
*/
if (vim_is_fastterm(term))
p_tf = TRUE;
#endif
-#ifdef USE_TERM_CONSOLE
- /*
- * 'ttyfast' is default on consoles
- */
- if (term_console)
- p_tf = TRUE;
-#endif
ttest(TRUE); /* make sure we have a valid set of terminal codes */
diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile
index c93706fce2..21f2928593 100644
--- a/src/nvim/testdir/Makefile
+++ b/src/nvim/testdir/Makefile
@@ -29,7 +29,7 @@ SCRIPTS := test_autoformat_join.out \
test91.out test92.out test93.out test94.out test95.out \
test96.out test97.out test98.out test99.out test100.out \
test101.out test102.out test103.out test104.out test105.out \
- test106.out
+ test106.out test107.out
SCRIPTS_GUI := test16.out
diff --git a/src/nvim/testdir/test107.in b/src/nvim/testdir/test107.in
new file mode 100644
index 0000000000..9143380f18
--- /dev/null
+++ b/src/nvim/testdir/test107.in
@@ -0,0 +1,38 @@
+Tests for adjusting window and contents vim: set ft=vim :
+
+STARTTEST
+:so small.vim
+:new
+:call setline(1, range(1,256))
+:let r=[]
+:func! GetScreenStr(row)
+: let str = ""
+: for c in range(1,3)
+: let str .= nr2char(screenchar(a:row, c))
+: endfor
+: return str
+:endfunc
+:
+:exe ":norm! \<C-W>t\<C-W>=1Gzt\<C-W>w\<C-W>+"
+:let s3=GetScreenStr(1)
+:wincmd p
+:call add(r, [line("w0"), s3])
+:
+:exe ":norm! \<C-W>t\<C-W>=50Gzt\<C-W>w\<C-W>+"
+:let s3=GetScreenStr(1)
+:wincmd p
+:call add(r, [line("w0"), s3])
+:
+:exe ":norm! \<C-W>t\<C-W>=59Gzt\<C-W>w\<C-W>+"
+:let s3=GetScreenStr(1)
+::wincmd p
+:call add(r, [line("w0"), s3])
+:
+:bwipeout!
+:$put=r
+:call garbagecollect(1)
+:"
+:/^start:/,$wq! test.out
+ENDTEST
+
+start:
diff --git a/src/nvim/testdir/test107.ok b/src/nvim/testdir/test107.ok
new file mode 100644
index 0000000000..3e0eda1fe7
--- /dev/null
+++ b/src/nvim/testdir/test107.ok
@@ -0,0 +1,4 @@
+start:
+[1, '1 ']
+[50, '50 ']
+[59, '59 ']
diff --git a/src/nvim/version.c b/src/nvim/version.c
index c59642ba8c..dd39070558 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -234,7 +234,7 @@ static int included_patches[] = {
//318,
//317,
//316,
- //315,
+ 315,
//314,
//313,
//312,