mirror of
https://github.com/neovim/neovim.git
synced 2025-10-13 13:26:06 +00:00
refactor(plines): use a struct for chartabsize state
This is a refactor extracted from vim-patch 9.0.0067: cannot show virtual text The logic for inline virtual text is going to be different in nvim than text property based text in vim, but this refactor is still useful, as calculation of displayed linesize is going to be stateful in a similar way.
This commit is contained in:
@@ -3,6 +3,20 @@
|
||||
|
||||
#include "nvim/vim.h"
|
||||
|
||||
// Argument for lbr_chartabsize().
|
||||
typedef struct {
|
||||
win_T *cts_win;
|
||||
linenr_T cts_lnum; // zero when not using text properties
|
||||
char *cts_line; // start of the line
|
||||
char *cts_ptr; // current position in line
|
||||
|
||||
bool cts_has_virt_text; // true if if a property inserts text
|
||||
int cts_cur_text_width; // width of current inserted text
|
||||
// TODO(bfredl): iterator in to the marktree for scanning virt text
|
||||
|
||||
int cts_vcol; // virtual column at current position
|
||||
} chartabsize_T;
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "plines.h.generated.h"
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user