mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 23:06:14 +00:00
perf: cache breakindent/showbreak width in win_lbr_chartabsize
breakindent was recomputed on every call to win_lbr_charbabsize() when the character is past the end of the first row of a wrapped line. Even though the function for computing breakindent cached the last result, reusing the cached value required strcmp of the cached line with the given line.
This commit is contained in:
@@ -12,15 +12,16 @@ typedef struct {
|
||||
win_T *cts_win;
|
||||
char *cts_line; ///< start of the line
|
||||
char *cts_ptr; ///< current position in line
|
||||
int cts_row;
|
||||
int cts_vcol; ///< virtual column at current position
|
||||
int indent_width; ///< width of showbreak and breakindent on wrapped lines
|
||||
/// INT_MIN if not yet calculated
|
||||
|
||||
bool cts_has_virt_text; ///< true if if there is inline virtual text
|
||||
int virt_row; ///< line number, -1 if no virtual text
|
||||
int cts_cur_text_width_left; ///< width of virtual text left of cursor
|
||||
int cts_cur_text_width_right; ///< width of virtual text right of cursor
|
||||
MarkTreeIter cts_iter[1];
|
||||
|
||||
int cts_vcol; ///< virtual column at current position
|
||||
int cts_max_head_vcol; ///< see win_lbr_chartabsize()
|
||||
MarkTreeIter cts_iter[1];
|
||||
} chartabsize_T;
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
|
Reference in New Issue
Block a user