Skip to content

Commit c6ee366

Browse files
committed
refactor: remove defunct FEAT_TERMINAL
1 parent 9ade7d1 commit c6ee366

33 files changed

+131
-987
lines changed

src/auto/configure

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7423,49 +7423,6 @@ if test "$enable_channel" = "yes"; then
74237423

74247424
fi
74257425

7426-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-terminal argument" >&5
7427-
$as_echo_n "checking --enable-terminal argument... " >&6; }
7428-
# Check whether --enable-terminal was given.
7429-
if test "${enable_terminal+set}" = set; then :
7430-
enableval=$enable_terminal;
7431-
else
7432-
enable_terminal="auto"
7433-
fi
7434-
7435-
if test "$enable_terminal" = "yes" || test "$enable_terminal" = "auto" -a "x$features" = "xhuge" ; then
7436-
if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
7437-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use terminal emulator with tiny or small features" >&5
7438-
$as_echo "cannot use terminal emulator with tiny or small features" >&6; }
7439-
enable_terminal="no"
7440-
else
7441-
if test "$enable_terminal" = "auto"; then
7442-
enable_terminal="yes"
7443-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: defaulting to yes" >&5
7444-
$as_echo "defaulting to yes" >&6; }
7445-
else
7446-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7447-
$as_echo "yes" >&6; }
7448-
fi
7449-
fi
7450-
else
7451-
if test "$enable_terminal" = "auto"; then
7452-
enable_terminal="no"
7453-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: defaulting to no" >&5
7454-
$as_echo "defaulting to no" >&6; }
7455-
else
7456-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7457-
$as_echo "no" >&6; }
7458-
fi
7459-
fi
7460-
if test "$enable_terminal" = "yes" -a "$enable_channel" = "yes"; then
7461-
$as_echo "#define FEAT_TERMINAL 1" >>confdefs.h
7462-
7463-
TERM_SRC="libvterm/src/encoding.c libvterm/src/keyboard.c libvterm/src/mouse.c libvterm/src/parser.c libvterm/src/pen.c libvterm/src/termscreen.c libvterm/src/state.c libvterm/src/unicode.c libvterm/src/vterm.c"
7464-
7465-
TERM_OBJ="objects/encoding.o objects/keyboard.o objects/mouse.o objects/parser.o objects/pen.o objects/termscreen.o objects/state.o objects/unicode.o objects/vterm.o"
7466-
7467-
fi
7468-
74697426
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-autoservername argument" >&5
74707427
$as_echo_n "checking --enable-autoservername argument... " >&6; }
74717428
# Check whether --enable-autoservername was given.

src/buffer.c

Lines changed: 8 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -450,36 +450,6 @@ void close_buffer(
450450
else if (buf->b_p_bh[0] == 'u') /* 'bufhidden' == "unload" */
451451
unload_buf = TRUE;
452452

453-
#ifdef FEAT_TERMINAL
454-
if (bt_terminal(buf) && (buf->b_nwindows == 1 || del_buf))
455-
{
456-
if (term_job_running(buf->b_term))
457-
{
458-
if (wipe_buf || unload_buf)
459-
{
460-
if (!can_unload_buffer(buf))
461-
return;
462-
463-
/* Wiping out or unloading a terminal buffer kills the job. */
464-
free_terminal(buf);
465-
}
466-
else
467-
{
468-
/* The job keeps running, hide the buffer. */
469-
del_buf = FALSE;
470-
unload_buf = FALSE;
471-
}
472-
}
473-
else
474-
{
475-
/* A terminal buffer is wiped out if the job has finished. */
476-
del_buf = TRUE;
477-
unload_buf = TRUE;
478-
wipe_buf = TRUE;
479-
}
480-
}
481-
#endif
482-
483453
/* Disallow deleting the buffer when it is locked (already being closed or
484454
* halfway a command that relies on it). Unloading is allowed. */
485455
if ((del_buf || wipe_buf) && !can_unload_buffer(buf))
@@ -795,9 +765,6 @@ free_buffer(buf_T *buf)
795765
#ifdef FEAT_JOB_CHANNEL
796766
channel_buffer_free(buf);
797767
#endif
798-
#ifdef FEAT_TERMINAL
799-
free_terminal(buf);
800-
#endif
801768
#ifdef FEAT_JOB_CHANNEL
802769
vim_free(buf->b_prompt_text);
803770
free_callback(&buf->b_prompt_callback);
@@ -1538,7 +1505,9 @@ void set_curbuf(buf_T *buf, int action)
15381505
if (prevbuf == curbuf)
15391506
u_sync(FALSE);
15401507
close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf,
1541-
unload ? action : (action == DOBUF_GOTO && !buf_hide(prevbuf) && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE);
1508+
unload ? action : (action == DOBUF_GOTO && !buf_hide(prevbuf) && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD
1509+
: 0,
1510+
FALSE);
15421511
if (curwin != previouswin && win_valid(previouswin))
15431512
/* autocommands changed curwin, Grr! */
15441513
curwin = previouswin;
@@ -1660,22 +1629,12 @@ void do_autochdir(void)
16601629

16611630
void no_write_message(void)
16621631
{
1663-
#ifdef FEAT_TERMINAL
1664-
if (term_job_running(curbuf->b_term))
1665-
emsg(_("E948: Job still running (add ! to end the job)"));
1666-
else
1667-
#endif
1668-
emsg(_("E37: No write since last change (add ! to override)"));
1632+
emsg(_("E37: No write since last change (add ! to override)"));
16691633
}
16701634

16711635
void no_write_message_nobang(buf_T *buf UNUSED)
16721636
{
1673-
#ifdef FEAT_TERMINAL
1674-
if (term_job_running(buf->b_term))
1675-
emsg(_("E948: Job still running"));
1676-
else
1677-
#endif
1678-
emsg(_("E37: No write since last change"));
1637+
emsg(_("E37: No write since last change"));
16791638
}
16801639

16811640
/*
@@ -2753,23 +2712,11 @@ void buflist_list(exarg_T *eap)
27532712
int i;
27542713
int ro_char;
27552714
int changed_char;
2756-
#ifdef FEAT_TERMINAL
2757-
int job_running;
2758-
int job_none_open;
2759-
#endif
27602715

27612716
for (buf = firstbuf; buf != NULL && !got_int; buf = buf->b_next)
27622717
{
2763-
#ifdef FEAT_TERMINAL
2764-
job_running = term_job_running(buf->b_term);
2765-
job_none_open = job_running && term_none_open(buf->b_term);
2766-
#endif
27672718
/* skip unlisted buffers, unless ! was used */
2768-
if ((!buf->b_p_bl && !eap->forceit && !vim_strchr(eap->arg, 'u')) || (vim_strchr(eap->arg, 'u') && buf->b_p_bl) || (vim_strchr(eap->arg, '+') && ((buf->b_flags & BF_READERR) || !bufIsChanged(buf))) || (vim_strchr(eap->arg, 'a') && (buf->b_ml.ml_mfp == NULL || buf->b_nwindows == 0)) || (vim_strchr(eap->arg, 'h') && (buf->b_ml.ml_mfp == NULL || buf->b_nwindows != 0))
2769-
#ifdef FEAT_TERMINAL
2770-
|| (vim_strchr(eap->arg, 'R') && (!job_running || (job_running && job_none_open))) || (vim_strchr(eap->arg, '?') && (!job_running || (job_running && !job_none_open))) || (vim_strchr(eap->arg, 'F') && (job_running || buf->b_term == NULL))
2771-
#endif
2772-
|| (vim_strchr(eap->arg, '-') && buf->b_p_ma) || (vim_strchr(eap->arg, '=') && !buf->b_p_ro) || (vim_strchr(eap->arg, 'x') && !(buf->b_flags & BF_READERR)) || (vim_strchr(eap->arg, '%') && buf != curbuf) || (vim_strchr(eap->arg, '#') && (buf == curbuf || curwin->w_alt_fnum != buf->b_fnum)))
2719+
if ((!buf->b_p_bl && !eap->forceit && !vim_strchr(eap->arg, 'u')) || (vim_strchr(eap->arg, 'u') && buf->b_p_bl) || (vim_strchr(eap->arg, '+') && ((buf->b_flags & BF_READERR) || !bufIsChanged(buf))) || (vim_strchr(eap->arg, 'a') && (buf->b_ml.ml_mfp == NULL || buf->b_nwindows == 0)) || (vim_strchr(eap->arg, 'h') && (buf->b_ml.ml_mfp == NULL || buf->b_nwindows != 0)) || (vim_strchr(eap->arg, '-') && buf->b_p_ma) || (vim_strchr(eap->arg, '=') && !buf->b_p_ro) || (vim_strchr(eap->arg, 'x') && !(buf->b_flags & BF_READERR)) || (vim_strchr(eap->arg, '%') && buf != curbuf) || (vim_strchr(eap->arg, '#') && (buf == curbuf || curwin->w_alt_fnum != buf->b_fnum)))
27732720
continue;
27742721
if (buf_spname(buf) != NULL)
27752722
vim_strncpy(NameBuff, buf_spname(buf), MAXPATHL - 1);
@@ -2780,21 +2727,8 @@ void buflist_list(exarg_T *eap)
27802727

27812728
changed_char = (buf->b_flags & BF_READERR) ? 'x'
27822729
: (bufIsChanged(buf) ? '+' : ' ');
2783-
#ifdef FEAT_TERMINAL
2784-
if (term_job_running(buf->b_term))
2785-
{
2786-
if (term_none_open(buf->b_term))
2787-
ro_char = '?';
2788-
else
2789-
ro_char = 'R';
2790-
changed_char = ' '; /* bufIsChanged() returns TRUE to avoid
2791-
* closing, but it's not actually changed. */
2792-
}
2793-
else if (buf->b_term != NULL)
2794-
ro_char = 'F';
2795-
else
2796-
#endif
2797-
ro_char = !buf->b_p_ma ? '-' : (buf->b_p_ro ? '=' : ' ');
2730+
2731+
ro_char = !buf->b_p_ma ? '-' : (buf->b_p_ro ? '=' : ' ');
27982732

27992733
msg_T *msg = msg2_create(MSG_INFO);
28002734

@@ -4089,9 +4023,6 @@ void write_viminfo_bufferlist(FILE *fp)
40894023
if (buf->b_fname == NULL || !buf->b_p_bl
40904024
#ifdef FEAT_QUICKFIX
40914025
|| bt_quickfix(buf)
4092-
#endif
4093-
#ifdef FEAT_TERMINAL
4094-
|| bt_terminal(buf)
40954026
#endif
40964027
|| removable(buf->b_ffname))
40974028
continue;
@@ -4127,16 +4058,6 @@ int bt_quickfix(buf_T *buf)
41274058
}
41284059
#endif
41294060

4130-
#if defined(FEAT_TERMINAL) || defined(PROTO)
4131-
/*
4132-
* Return TRUE if "buf" is a terminal buffer.
4133-
*/
4134-
int bt_terminal(buf_T *buf)
4135-
{
4136-
return buf != NULL && buf->b_p_bt[0] == 't';
4137-
}
4138-
#endif
4139-
41404061
/*
41414062
* Return TRUE if "buf" is a help buffer.
41424063
*/
@@ -4235,10 +4156,6 @@ buf_spname(buf_T *buf)
42354156
* contains the name as specified by the user. */
42364157
if (bt_nofile(buf))
42374158
{
4238-
#ifdef FEAT_TERMINAL
4239-
if (buf->b_term != NULL)
4240-
return term_get_status_text(buf->b_term);
4241-
#endif
42424159
if (buf->b_fname != NULL)
42434160
return buf->b_fname;
42444161
#ifdef FEAT_JOB_CHANNEL

0 commit comments

Comments
 (0)