refactor: Remove term modules and termcap options

- Removed term.c, term.h and term_defs.h
- Tests for T_* values were removed. screen.c was simplified as a
  consequence(the best strategy for drawing is implemented in the UI layer)
- Redraw functions now call ui.c functions directly. Updates are flushed with
  `ui_flush()`
- Removed all termcap options(they now return empty strings for compatibility)
- &term/&ttybuiltin options return a constant value(nvim)
- &t_Co is still available, but it mirrors t_colors directly
- Remove cursor tracking from screen.c and the `screen_start` function. Now the
  UI is expected to maintain cursor state across any call, and reset it when
  resized.
- Remove unused code
This commit is contained in:
Thiago de Arruda
2015-02-16 23:47:56 -03:00
parent 486d2e944d
commit 3baba1e7bc
50 changed files with 849 additions and 3695 deletions

View File

@@ -62,7 +62,7 @@
#include "nvim/syntax.h"
#include "nvim/tag.h"
#include "nvim/tempfile.h"
#include "nvim/term.h"
#include "nvim/ui.h"
#include "nvim/undo.h"
#include "nvim/window.h"
#include "nvim/os/os.h"
@@ -946,7 +946,7 @@ void do_bang(int addr_count, exarg_T *eap, int forceit, int do_in, int do_out)
msg_putchar('!');
msg_outtrans(newcmd);
msg_clr_eos();
windgoto(msg_row, msg_col);
ui_cursor_goto(msg_row, msg_col);
do_shell(newcmd, 0);
} else { /* :range! */
@@ -1064,8 +1064,8 @@ do_filter (
/* Create the shell command in allocated memory. */
cmd_buf = make_filter_cmd(cmd, itmp, otmp);
windgoto((int)Rows - 1, 0);
cursor_on();
ui_cursor_goto((int)Rows - 1, 0);
ui_cursor_on();
/*
* When not redirecting the output the command can write anything to the
@@ -1245,23 +1245,18 @@ do_shell (
}
}
/* This windgoto is required for when the '\n' resulted in a "delete line
* 1" command to the terminal. */
if (!swapping_screen())
windgoto(msg_row, msg_col);
cursor_on();
// This ui_cursor_goto is required for when the '\n' resulted in a "delete line
// 1" command to the terminal.
ui_cursor_goto(msg_row, msg_col);
ui_cursor_on();
(void)call_shell(cmd, flags, NULL);
did_check_timestamps = FALSE;
need_check_timestamps = TRUE;
/*
* put the message cursor at the end of the screen, avoids wait_return()
* to overwrite the text that the external command showed
*/
if (!swapping_screen()) {
msg_row = Rows - 1;
msg_col = 0;
}
// put the message cursor at the end of the screen, avoids wait_return()
// to overwrite the text that the external command showed
msg_row = Rows - 1;
msg_col = 0;
if (autocmd_busy) {
if (msg_silent == 0)
@@ -1284,8 +1279,6 @@ do_shell (
* want to wait for "hit return to continue".
*/
save_nwr = no_wait_return;
if (swapping_screen())
no_wait_return = FALSE;
wait_return(msg_silent == 0);
no_wait_return = save_nwr;
}
@@ -1945,21 +1938,6 @@ void viminfo_writestring(FILE *fd, char_u *p)
putc('\n', fd);
}
/*
* Implementation of ":fixdel", also used by get_stty().
* <BS> resulting <Del>
* ^? ^H
* not ^? ^?
*/
void do_fixdel(exarg_T *eap)
{
char_u *p;
p = find_termcode((char_u *)"kb");
add_termcode((char_u *)"kD", p != NULL
&& *p == DEL ? (char_u *)CTRL_H_STR : DEL_STR, FALSE);
}
void print_line_no_prefix(linenr_T lnum, int use_number, int list)
{
char_u numbuf[30];
@@ -1985,8 +1963,8 @@ void print_line(linenr_T lnum, int use_number, int list)
print_line_no_prefix(lnum, use_number, list);
if (save_silent) {
msg_putchar('\n');
cursor_on(); /* msg_start() switches it off */
out_flush();
ui_cursor_on(); /* msg_start() switches it off */
ui_flush();
silent_mode = save_silent;
}
info_message = FALSE;
@@ -3971,7 +3949,7 @@ void do_sub(exarg_T *eap)
msg_no_more = FALSE;
msg_scroll = i;
showruler(TRUE);
windgoto(msg_row, msg_col);
ui_cursor_goto(msg_row, msg_col);
RedrawingDisabled = temp;
#ifdef USE_ON_FLY_SCROLL