mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.1.2057: the screen.c file is much too big
Problem: The screen.c file is much too big.
Solution: Split it in three parts. (Yegappan Lakshmanan, closes vim/vim#4943)
7528d1f6b5
This is an approximation vim-patch 8.1.2057. Applying the patch directly
isn't feasible since our version of screen.c has diverged too much,
however we still introduce drawscreen.c and drawline.c:
- screen.c is now a much smaller file used for low level screen functions
- drawline.c contains everything needed for win_line()
- drawscreen.c contains everything needed for update_screen()
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
This commit is contained in:
parent
a5ed89c972
commit
51063a90df
@ -18,6 +18,7 @@
|
||||
#include "nvim/change.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/decoration.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/ex_cmds.h"
|
||||
#include "nvim/ex_docmd.h"
|
||||
#include "nvim/extmark.h"
|
||||
@ -28,7 +29,6 @@
|
||||
#include "nvim/memory.h"
|
||||
#include "nvim/move.h"
|
||||
#include "nvim/ops.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/undo.h"
|
||||
#include "nvim/vim.h"
|
||||
#include "nvim/window.h"
|
||||
|
@ -10,11 +10,11 @@
|
||||
#include "nvim/api/private/helpers.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/decoration_provider.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/extmark.h"
|
||||
#include "nvim/highlight_group.h"
|
||||
#include "nvim/lua/executor.h"
|
||||
#include "nvim/memline.h"
|
||||
#include "nvim/screen.h"
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "api/extmark.c.generated.h"
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "nvim/context.h"
|
||||
#include "nvim/decoration.h"
|
||||
#include "nvim/decoration_provider.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/typval.h"
|
||||
@ -55,7 +56,6 @@
|
||||
#include "nvim/os/process.h"
|
||||
#include "nvim/popupmenu.h"
|
||||
#include "nvim/runtime.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/state.h"
|
||||
#include "nvim/types.h"
|
||||
#include "nvim/ui.h"
|
||||
|
@ -10,9 +10,9 @@
|
||||
#include "nvim/api/private/helpers.h"
|
||||
#include "nvim/api/win_config.h"
|
||||
#include "nvim/ascii.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/highlight_group.h"
|
||||
#include "nvim/option.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/strings.h"
|
||||
#include "nvim/syntax.h"
|
||||
#include "nvim/ui.h"
|
||||
|
@ -12,12 +12,12 @@
|
||||
#include "nvim/ascii.h"
|
||||
#include "nvim/buffer.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/ex_docmd.h"
|
||||
#include "nvim/globals.h"
|
||||
#include "nvim/lua/executor.h"
|
||||
#include "nvim/move.h"
|
||||
#include "nvim/option.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/syntax.h"
|
||||
#include "nvim/vim.h"
|
||||
#include "nvim/window.h"
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "nvim/buffer.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/userfunc.h"
|
||||
@ -29,7 +30,6 @@
|
||||
#include "nvim/profile.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/runtime.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/state.h"
|
||||
#include "nvim/ui_compositor.h"
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "nvim/decoration.h"
|
||||
#include "nvim/diff.h"
|
||||
#include "nvim/digraph.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/vars.h"
|
||||
#include "nvim/ex_cmds.h"
|
||||
@ -73,7 +74,6 @@
|
||||
#include "nvim/quickfix.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/runtime.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/sign.h"
|
||||
#include "nvim/spell.h"
|
||||
#include "nvim/strings.h"
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/diff.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/extmark.h"
|
||||
@ -23,7 +24,6 @@
|
||||
#include "nvim/move.h"
|
||||
#include "nvim/option.h"
|
||||
#include "nvim/plines.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/state.h"
|
||||
#include "nvim/ui.h"
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "nvim/change.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/extmark.h"
|
||||
#include "nvim/fold.h"
|
||||
#include "nvim/mark.h"
|
||||
@ -17,7 +18,6 @@
|
||||
#include "nvim/move.h"
|
||||
#include "nvim/option.h"
|
||||
#include "nvim/plines.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/state.h"
|
||||
#include "nvim/vim.h"
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "nvim/ascii.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/debugger.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/ex_docmd.h"
|
||||
#include "nvim/ex_getln.h"
|
||||
@ -18,7 +19,6 @@
|
||||
#include "nvim/pos.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/runtime.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/types.h"
|
||||
#include "nvim/vim.h"
|
||||
|
||||
|
@ -4,12 +4,12 @@
|
||||
#include "nvim/api/ui.h"
|
||||
#include "nvim/buffer.h"
|
||||
#include "nvim/decoration.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/extmark.h"
|
||||
#include "nvim/highlight.h"
|
||||
#include "nvim/highlight_group.h"
|
||||
#include "nvim/lua/executor.h"
|
||||
#include "nvim/move.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/vim.h"
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/diff.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/ex_cmds.h"
|
||||
#include "nvim/ex_docmd.h"
|
||||
@ -36,7 +37,6 @@
|
||||
#include "nvim/os/os.h"
|
||||
#include "nvim/os/shell.h"
|
||||
#include "nvim/path.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/strings.h"
|
||||
#include "nvim/ui.h"
|
||||
#include "nvim/undo.h"
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "nvim/ascii.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/digraph.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/eval/typval.h"
|
||||
#include "nvim/ex_docmd.h"
|
||||
#include "nvim/ex_getln.h"
|
||||
@ -24,7 +25,6 @@
|
||||
#include "nvim/normal.h"
|
||||
#include "nvim/os/input.h"
|
||||
#include "nvim/runtime.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/strings.h"
|
||||
#include "nvim/vim.h"
|
||||
|
||||
|
2706
src/nvim/drawline.c
Normal file
2706
src/nvim/drawline.c
Normal file
File diff suppressed because it is too large
Load Diff
24
src/nvim/drawline.h
Normal file
24
src/nvim/drawline.h
Normal file
@ -0,0 +1,24 @@
|
||||
#ifndef NVIM_DRAWLINE_H
|
||||
#define NVIM_DRAWLINE_H
|
||||
|
||||
#include "nvim/decoration_provider.h"
|
||||
#include "nvim/fold.h"
|
||||
#include "nvim/screen.h"
|
||||
|
||||
// Maximum columns for terminal highlight attributes
|
||||
#define TERM_ATTRS_MAX 1024
|
||||
|
||||
typedef struct {
|
||||
NS ns_id;
|
||||
uint64_t mark_id;
|
||||
int win_row;
|
||||
int win_col;
|
||||
} WinExtmark;
|
||||
EXTERN kvec_t(WinExtmark) win_extmark_arr INIT(= KV_INITIAL_VALUE);
|
||||
|
||||
EXTERN bool conceal_cursor_used INIT(= false);
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "drawline.h.generated.h"
|
||||
#endif
|
||||
#endif // NVIM_DRAWLINE_H
|
2325
src/nvim/drawscreen.c
Normal file
2325
src/nvim/drawscreen.c
Normal file
File diff suppressed because it is too large
Load Diff
25
src/nvim/drawscreen.h
Normal file
25
src/nvim/drawscreen.h
Normal file
@ -0,0 +1,25 @@
|
||||
#ifndef NVIM_DRAWSCREEN_H
|
||||
#define NVIM_DRAWSCREEN_H
|
||||
|
||||
#include "nvim/drawline.h"
|
||||
|
||||
/// flags for update_screen()
|
||||
/// The higher the value, the higher the priority
|
||||
enum {
|
||||
VALID = 10, ///< buffer not changed, or changes marked with b_mod_*
|
||||
INVERTED = 20, ///< redisplay inverted part that changed
|
||||
INVERTED_ALL = 25, ///< redisplay whole inverted part
|
||||
REDRAW_TOP = 30, ///< display first w_upd_rows screen lines
|
||||
SOME_VALID = 35, ///< like NOT_VALID but may scroll
|
||||
NOT_VALID = 40, ///< buffer needs complete redraw
|
||||
CLEAR = 50, ///< screen messed up, clear it
|
||||
};
|
||||
|
||||
/// While redrawing the screen this flag is set. It means the screen size
|
||||
/// ('lines' and 'rows') must not be changed.
|
||||
EXTERN bool updating_screen INIT(= 0);
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "drawscreen.h.generated.h"
|
||||
#endif
|
||||
#endif // NVIM_DRAWSCREEN_H
|
@ -16,6 +16,7 @@
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/digraph.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/event/loop.h"
|
||||
@ -49,7 +50,6 @@
|
||||
#include "nvim/plines.h"
|
||||
#include "nvim/popupmenu.h"
|
||||
#include "nvim/quickfix.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/spell.h"
|
||||
#include "nvim/state.h"
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "nvim/autocmd.h"
|
||||
#include "nvim/buffer.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/encode.h"
|
||||
#include "nvim/eval/funcs.h"
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "nvim/decoration.h"
|
||||
#include "nvim/diff.h"
|
||||
#include "nvim/digraph.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/ex_cmds.h"
|
||||
@ -65,7 +66,6 @@
|
||||
#include "nvim/profile.h"
|
||||
#include "nvim/quickfix.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/spell.h"
|
||||
#include "nvim/strings.h"
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "nvim/debugger.h"
|
||||
#include "nvim/diff.h"
|
||||
#include "nvim/digraph.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/userfunc.h"
|
||||
@ -69,7 +70,6 @@
|
||||
#include "nvim/profile.h"
|
||||
#include "nvim/quickfix.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/shada.h"
|
||||
#include "nvim/sign.h"
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/cursor_shape.h"
|
||||
#include "nvim/digraph.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/funcs.h"
|
||||
@ -70,7 +71,6 @@
|
||||
#include "nvim/popupmenu.h"
|
||||
#include "nvim/profile.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/sign.h"
|
||||
#include "nvim/state.h"
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/diff.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/typval.h"
|
||||
@ -49,7 +50,6 @@
|
||||
#include "nvim/path.h"
|
||||
#include "nvim/quickfix.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/sha256.h"
|
||||
#include "nvim/shada.h"
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/diff.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/ex_docmd.h"
|
||||
#include "nvim/ex_session.h"
|
||||
@ -31,7 +32,6 @@
|
||||
#include "nvim/option.h"
|
||||
#include "nvim/os/input.h"
|
||||
#include "nvim/plines.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/strings.h"
|
||||
#include "nvim/syntax.h"
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "nvim/buffer_defs.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/typval.h"
|
||||
@ -42,7 +43,6 @@
|
||||
#include "nvim/os/input.h"
|
||||
#include "nvim/os/os.h"
|
||||
#include "nvim/plines.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/state.h"
|
||||
#include "nvim/strings.h"
|
||||
#include "nvim/ui.h"
|
||||
|
131
src/nvim/grid.c
131
src/nvim/grid.c
@ -1,10 +1,19 @@
|
||||
// This is an open source non-commercial project. Dear PVS-Studio, please check
|
||||
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
|
||||
// Most of the routines in this file perform screen (grid) manipulations. The
|
||||
// given operation is performed physically on the screen. The corresponding
|
||||
// change is also made to the internal screen image. In this way, the editor
|
||||
// anticipates the effect of editing changes on the appearance of the screen.
|
||||
// That way, when we call update_screen() a complete redraw isn't usually
|
||||
// necessary. Another advantage is that we can keep adding code to anticipate
|
||||
// screen changes, and in the meantime, everything still works.
|
||||
//
|
||||
// The grid_*() functions write to the screen and handle updating grid->lines[].
|
||||
|
||||
#include "nvim/arabic.h"
|
||||
#include "nvim/grid.h"
|
||||
#include "nvim/highlight.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/ui.h"
|
||||
#include "nvim/vim.h"
|
||||
|
||||
@ -780,3 +789,123 @@ void grid_assign_handle(ScreenGrid *grid)
|
||||
grid->handle = ++last_grid_handle;
|
||||
}
|
||||
}
|
||||
|
||||
/// insert lines on the screen and move the existing lines down
|
||||
/// 'line_count' is the number of lines to be inserted.
|
||||
/// 'end' is the line after the scrolled part. Normally it is Rows.
|
||||
/// 'col' is the column from with we start inserting.
|
||||
//
|
||||
/// 'row', 'col' and 'end' are relative to the start of the region.
|
||||
void grid_ins_lines(ScreenGrid *grid, int row, int line_count, int end, int col, int width)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
unsigned temp;
|
||||
|
||||
int row_off = 0;
|
||||
grid_adjust(&grid, &row_off, &col);
|
||||
row += row_off;
|
||||
end += row_off;
|
||||
|
||||
if (line_count <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Shift line_offset[] line_count down to reflect the inserted lines.
|
||||
// Clear the inserted lines.
|
||||
for (i = 0; i < line_count; i++) {
|
||||
if (width != grid->cols) {
|
||||
// need to copy part of a line
|
||||
j = end - 1 - i;
|
||||
while ((j -= line_count) >= row) {
|
||||
linecopy(grid, j + line_count, j, col, width);
|
||||
}
|
||||
j += line_count;
|
||||
grid_clear_line(grid, grid->line_offset[j] + (size_t)col, width, false);
|
||||
grid->line_wraps[j] = false;
|
||||
} else {
|
||||
j = end - 1 - i;
|
||||
temp = (unsigned)grid->line_offset[j];
|
||||
while ((j -= line_count) >= row) {
|
||||
grid->line_offset[j + line_count] = grid->line_offset[j];
|
||||
grid->line_wraps[j + line_count] = grid->line_wraps[j];
|
||||
}
|
||||
grid->line_offset[j + line_count] = temp;
|
||||
grid->line_wraps[j + line_count] = false;
|
||||
grid_clear_line(grid, temp, grid->cols, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (!grid->throttled) {
|
||||
ui_call_grid_scroll(grid->handle, row, end, col, col + width, -line_count, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/// delete lines on the screen and move lines up.
|
||||
/// 'end' is the line after the scrolled part. Normally it is Rows.
|
||||
/// When scrolling region used 'off' is the offset from the top for the region.
|
||||
/// 'row' and 'end' are relative to the start of the region.
|
||||
void grid_del_lines(ScreenGrid *grid, int row, int line_count, int end, int col, int width)
|
||||
{
|
||||
int j;
|
||||
int i;
|
||||
unsigned temp;
|
||||
|
||||
int row_off = 0;
|
||||
grid_adjust(&grid, &row_off, &col);
|
||||
row += row_off;
|
||||
end += row_off;
|
||||
|
||||
if (line_count <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Now shift line_offset[] line_count up to reflect the deleted lines.
|
||||
// Clear the inserted lines.
|
||||
for (i = 0; i < line_count; i++) {
|
||||
if (width != grid->cols) {
|
||||
// need to copy part of a line
|
||||
j = row + i;
|
||||
while ((j += line_count) <= end - 1) {
|
||||
linecopy(grid, j - line_count, j, col, width);
|
||||
}
|
||||
j -= line_count;
|
||||
grid_clear_line(grid, grid->line_offset[j] + (size_t)col, width, false);
|
||||
grid->line_wraps[j] = false;
|
||||
} else {
|
||||
// whole width, moving the line pointers is faster
|
||||
j = row + i;
|
||||
temp = (unsigned)grid->line_offset[j];
|
||||
while ((j += line_count) <= end - 1) {
|
||||
grid->line_offset[j - line_count] = grid->line_offset[j];
|
||||
grid->line_wraps[j - line_count] = grid->line_wraps[j];
|
||||
}
|
||||
grid->line_offset[j - line_count] = temp;
|
||||
grid->line_wraps[j - line_count] = false;
|
||||
grid_clear_line(grid, temp, grid->cols, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (!grid->throttled) {
|
||||
ui_call_grid_scroll(grid->handle, row, end, col, col + width, line_count, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void linecopy(ScreenGrid *grid, int to, int from, int col, int width)
|
||||
{
|
||||
unsigned off_to = (unsigned)(grid->line_offset[to] + (size_t)col);
|
||||
unsigned off_from = (unsigned)(grid->line_offset[from] + (size_t)col);
|
||||
|
||||
memmove(grid->chars + off_to, grid->chars + off_from, (size_t)width * sizeof(schar_T));
|
||||
memmove(grid->attrs + off_to, grid->attrs + off_from, (size_t)width * sizeof(sattr_T));
|
||||
}
|
||||
|
||||
win_T *get_win_by_grid_handle(handle_T handle)
|
||||
{
|
||||
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
|
||||
if (wp->w_grid_alloc.handle == handle) {
|
||||
return wp;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@ -19,6 +19,9 @@ EXTERN ScreenGrid default_grid INIT(= SCREEN_GRID_INIT);
|
||||
|
||||
#define DEFAULT_GRID_HANDLE 1 // handle for the default_grid
|
||||
|
||||
/// While resizing the screen this flag is set.
|
||||
EXTERN bool resizing_screen INIT(= 0);
|
||||
|
||||
EXTERN schar_T *linebuf_char INIT(= NULL);
|
||||
EXTERN sattr_T *linebuf_attr INIT(= NULL);
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "nvim/api/private/defs.h"
|
||||
#include "nvim/api/private/helpers.h"
|
||||
#include "nvim/decoration_provider.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/highlight.h"
|
||||
#include "nvim/highlight_defs.h"
|
||||
#include "nvim/highlight_group.h"
|
||||
@ -14,7 +15,6 @@
|
||||
#include "nvim/message.h"
|
||||
#include "nvim/option.h"
|
||||
#include "nvim/popupmenu.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/ui.h"
|
||||
#include "nvim/vim.h"
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "nvim/autocmd.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor_shape.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/vars.h"
|
||||
#include "nvim/ex_docmd.h"
|
||||
@ -19,7 +20,6 @@
|
||||
#include "nvim/match.h"
|
||||
#include "nvim/option.h"
|
||||
#include "nvim/runtime.h"
|
||||
#include "nvim/screen.h"
|
||||
|
||||
/// \addtogroup SG_SET
|
||||
/// @{
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "nvim/change.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/typval.h"
|
||||
@ -36,7 +37,6 @@
|
||||
#include "nvim/path.h"
|
||||
#include "nvim/popupmenu.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/spell.h"
|
||||
#include "nvim/state.h"
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "nvim/buffer_defs.h"
|
||||
#include "nvim/change.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/funcs.h"
|
||||
#include "nvim/eval/typval.h"
|
||||
@ -38,7 +39,6 @@
|
||||
#include "nvim/os/os.h"
|
||||
#include "nvim/profile.h"
|
||||
#include "nvim/runtime.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/undo.h"
|
||||
#include "nvim/usercmd.h"
|
||||
#include "nvim/version.h"
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "nvim/decoration.h"
|
||||
#include "nvim/decoration_provider.h"
|
||||
#include "nvim/diff.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/ex_cmds.h"
|
||||
#include "nvim/ex_cmds2.h"
|
||||
@ -62,7 +63,6 @@
|
||||
#include "nvim/profile.h"
|
||||
#include "nvim/quickfix.h"
|
||||
#include "nvim/runtime.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/shada.h"
|
||||
#include "nvim/sign.h"
|
||||
#include "nvim/state.h"
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include "nvim/buffer_defs.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/funcs.h"
|
||||
#include "nvim/ex_docmd.h"
|
||||
@ -18,7 +19,6 @@
|
||||
#include "nvim/profile.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/runtime.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/vim.h"
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "nvim/arabic.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/fileio.h"
|
||||
#include "nvim/func_attr.h"
|
||||
@ -52,7 +53,6 @@
|
||||
#include "nvim/option.h"
|
||||
#include "nvim/os/os.h"
|
||||
#include "nvim/path.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/spell.h"
|
||||
#include "nvim/strings.h"
|
||||
|
||||
|
@ -48,6 +48,7 @@
|
||||
#include "nvim/buffer.h"
|
||||
#include "nvim/change.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/fileio.h"
|
||||
#include "nvim/func_attr.h"
|
||||
@ -66,7 +67,6 @@
|
||||
#include "nvim/os/process.h"
|
||||
#include "nvim/os_unix.h"
|
||||
#include "nvim/path.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/sha256.h"
|
||||
#include "nvim/spell.h"
|
||||
#include "nvim/strings.h"
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "nvim/ascii.h"
|
||||
#include "nvim/assert.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/ex_docmd.h"
|
||||
#include "nvim/ex_eval.h"
|
||||
@ -40,7 +41,6 @@
|
||||
#include "nvim/os/time.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/runtime.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/strings.h"
|
||||
#include "nvim/syntax.h"
|
||||
#include "nvim/ui.h"
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/diff.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/fold.h"
|
||||
#include "nvim/grid.h"
|
||||
#include "nvim/memline.h"
|
||||
@ -15,7 +16,6 @@
|
||||
#include "nvim/move.h"
|
||||
#include "nvim/os_unix.h"
|
||||
#include "nvim/plines.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/state.h"
|
||||
#include "nvim/strings.h"
|
||||
#include "nvim/syntax.h"
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/diff.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/fold.h"
|
||||
#include "nvim/getchar.h"
|
||||
@ -32,7 +33,6 @@
|
||||
#include "nvim/option.h"
|
||||
#include "nvim/plines.h"
|
||||
#include "nvim/popupmenu.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/strings.h"
|
||||
#include "nvim/window.h"
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/diff.h"
|
||||
#include "nvim/digraph.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/userfunc.h"
|
||||
@ -56,7 +57,6 @@
|
||||
#include "nvim/plines.h"
|
||||
#include "nvim/profile.h"
|
||||
#include "nvim/quickfix.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/spell.h"
|
||||
#include "nvim/spellfile.h"
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "nvim/change.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/typval.h"
|
||||
@ -46,7 +47,6 @@
|
||||
#include "nvim/os/time.h"
|
||||
#include "nvim/path.h"
|
||||
#include "nvim/plines.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/state.h"
|
||||
#include "nvim/strings.h"
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "nvim/decoration_provider.h"
|
||||
#include "nvim/diff.h"
|
||||
#include "nvim/digraph.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/typval.h"
|
||||
@ -71,7 +72,6 @@
|
||||
#include "nvim/popupmenu.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/runtime.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/spell.h"
|
||||
#include "nvim/spellfile.h"
|
||||
#include "nvim/spellsuggest.h"
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "nvim/ascii.h"
|
||||
#include "nvim/buffer.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval/typval.h"
|
||||
#include "nvim/ex_cmds.h"
|
||||
@ -25,7 +26,6 @@
|
||||
#include "nvim/move.h"
|
||||
#include "nvim/option.h"
|
||||
#include "nvim/popupmenu.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/strings.h"
|
||||
#include "nvim/ui.h"
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "nvim/buffer.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/ex_cmds.h"
|
||||
@ -39,7 +40,6 @@
|
||||
#include "nvim/path.h"
|
||||
#include "nvim/quickfix.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/strings.h"
|
||||
#include "nvim/ui.h"
|
||||
|
5223
src/nvim/screen.c
5223
src/nvim/screen.c
File diff suppressed because it is too large
Load Diff
@ -4,31 +4,10 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "nvim/buffer_defs.h"
|
||||
#include "nvim/fold.h"
|
||||
#include "nvim/grid_defs.h"
|
||||
#include "nvim/pos.h"
|
||||
#include "nvim/types.h"
|
||||
|
||||
// flags for update_screen()
|
||||
// The higher the value, the higher the priority
|
||||
#define VALID 10 // buffer not changed, or changes marked
|
||||
// with b_mod_*
|
||||
#define INVERTED 20 // redisplay inverted part that changed
|
||||
#define INVERTED_ALL 25 // redisplay whole inverted part
|
||||
#define REDRAW_TOP 30 // display first w_upd_rows screen lines
|
||||
#define SOME_VALID 35 // like NOT_VALID but may scroll
|
||||
#define NOT_VALID 40 // buffer needs complete redraw
|
||||
#define CLEAR 50 // screen messed up, clear it
|
||||
|
||||
/// corner value flags for hsep_connected and vsep_connected
|
||||
typedef enum {
|
||||
WC_TOP_LEFT = 0,
|
||||
WC_TOP_RIGHT,
|
||||
WC_BOTTOM_LEFT,
|
||||
WC_BOTTOM_RIGHT,
|
||||
} WindowCorner;
|
||||
|
||||
// Maximum columns for terminal highlight attributes
|
||||
#define TERM_ATTRS_MAX 1024
|
||||
EXTERN match_T screen_search_hl; // used for 'hlsearch' highlight matching
|
||||
|
||||
/// Array defining what should be done when tabline is clicked
|
||||
EXTERN StlClickDefinition *tab_page_click_defs INIT(= NULL);
|
||||
@ -39,13 +18,6 @@ EXTERN long tab_page_click_defs_size INIT(= 0);
|
||||
#define W_ENDCOL(wp) ((wp)->w_wincol + (wp)->w_width)
|
||||
#define W_ENDROW(wp) ((wp)->w_winrow + (wp)->w_height)
|
||||
|
||||
// While redrawing the screen this flag is set. It means the screen size
|
||||
// ('lines' and 'rows') must not be changed.
|
||||
EXTERN bool updating_screen INIT(= 0);
|
||||
|
||||
// While resizing the screen this flag is set.
|
||||
EXTERN bool resizing_screen INIT(= 0);
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "screen.h.generated.h"
|
||||
#endif
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cmdhist.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/funcs.h"
|
||||
@ -45,7 +46,6 @@
|
||||
#include "nvim/path.h"
|
||||
#include "nvim/profile.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/strings.h"
|
||||
#include "nvim/ui.h"
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "nvim/buffer.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval/funcs.h"
|
||||
#include "nvim/ex_docmd.h"
|
||||
@ -16,7 +17,6 @@
|
||||
#include "nvim/highlight_group.h"
|
||||
#include "nvim/move.h"
|
||||
#include "nvim/option.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/sign.h"
|
||||
#include "nvim/syntax.h"
|
||||
#include "nvim/vim.h"
|
||||
|
@ -72,6 +72,7 @@
|
||||
#include "nvim/change.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/ex_cmds.h"
|
||||
#include "nvim/ex_docmd.h"
|
||||
@ -92,7 +93,6 @@
|
||||
#include "nvim/os_unix.h"
|
||||
#include "nvim/path.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/spell.h"
|
||||
#include "nvim/spellfile.h"
|
||||
|
@ -234,6 +234,7 @@
|
||||
#include "nvim/ascii.h"
|
||||
#include "nvim/buffer.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/ex_cmds2.h"
|
||||
#include "nvim/fileio.h"
|
||||
#include "nvim/memline.h"
|
||||
@ -244,7 +245,6 @@
|
||||
#include "nvim/path.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/runtime.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/spell.h"
|
||||
#include "nvim/spell_defs.h"
|
||||
#include "nvim/spellfile.h"
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
#include "nvim/ascii.h"
|
||||
#include "nvim/autocmd.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/ex_docmd.h"
|
||||
#include "nvim/getchar.h"
|
||||
@ -15,7 +16,6 @@
|
||||
#include "nvim/option.h"
|
||||
#include "nvim/option_defs.h"
|
||||
#include "nvim/os/input.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/state.h"
|
||||
#include "nvim/ui.h"
|
||||
#include "nvim/vim.h"
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "nvim/buffer.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor_shape.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/vars.h"
|
||||
#include "nvim/ex_docmd.h"
|
||||
@ -43,7 +44,6 @@
|
||||
#include "nvim/path.h"
|
||||
#include "nvim/profile.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/sign.h"
|
||||
#include "nvim/strings.h"
|
||||
#include "nvim/syntax.h"
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "nvim/buffer.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/ex_cmds.h"
|
||||
@ -41,7 +42,6 @@
|
||||
#include "nvim/quickfix.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/runtime.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/strings.h"
|
||||
#include "nvim/tag.h"
|
||||
|
@ -48,6 +48,7 @@
|
||||
#include "nvim/buffer.h"
|
||||
#include "nvim/change.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/event/loop.h"
|
||||
#include "nvim/event/time.h"
|
||||
@ -69,7 +70,6 @@
|
||||
#include "nvim/move.h"
|
||||
#include "nvim/option.h"
|
||||
#include "nvim/os/input.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/state.h"
|
||||
#include "nvim/terminal.h"
|
||||
#include "nvim/ui.h"
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/cursor_shape.h"
|
||||
#include "nvim/diff.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/event/loop.h"
|
||||
#include "nvim/ex_getln.h"
|
||||
#include "nvim/fold.h"
|
||||
@ -32,7 +33,6 @@
|
||||
#include "nvim/os/time.h"
|
||||
#include "nvim/os_unix.h"
|
||||
#include "nvim/popupmenu.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/ui.h"
|
||||
#include "nvim/ui_compositor.h"
|
||||
#include "nvim/vim.h"
|
||||
|
@ -86,6 +86,7 @@
|
||||
#include "nvim/buffer_updates.h"
|
||||
#include "nvim/change.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/ex_getln.h"
|
||||
#include "nvim/extmark.h"
|
||||
@ -105,7 +106,6 @@
|
||||
#include "nvim/os_unix.h"
|
||||
#include "nvim/path.h"
|
||||
#include "nvim/pos.h" // MAXLNUM
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/sha256.h"
|
||||
#include "nvim/state.h"
|
||||
#include "nvim/strings.h"
|
||||
|
@ -14,13 +14,13 @@
|
||||
#include "nvim/ascii.h"
|
||||
#include "nvim/buffer.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/grid.h"
|
||||
#include "nvim/iconv.h"
|
||||
#include "nvim/lua/executor.h"
|
||||
#include "nvim/memline.h"
|
||||
#include "nvim/memory.h"
|
||||
#include "nvim/message.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/strings.h"
|
||||
#include "nvim/version.h"
|
||||
#include "nvim/vim.h"
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/diff.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
#include "nvim/eval/vars.h"
|
||||
@ -47,7 +48,6 @@
|
||||
#include "nvim/plines.h"
|
||||
#include "nvim/quickfix.h"
|
||||
#include "nvim/regexp.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/state.h"
|
||||
#include "nvim/strings.h"
|
||||
|
Loading…
Reference in New Issue
Block a user