diff options
author | luukvbaal <31730729+luukvbaal@users.noreply.github.com> | 2022-11-15 21:57:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-15 20:57:30 +0000 |
commit | fd54194a4fd477d15a12c69106126514952eb563 (patch) | |
tree | 8442659592fd8e3ef53b3c97f6761303e0f39ff2 | |
parent | c70d90dbfdf67bb009d2976a5d0760be4010e533 (diff) | |
download | rneovim-fd54194a4fd477d15a12c69106126514952eb563.tar.gz rneovim-fd54194a4fd477d15a12c69106126514952eb563.tar.bz2 rneovim-fd54194a4fd477d15a12c69106126514952eb563.zip |
refactor: convert drawline.c draw states to enum (#21067)
-rw-r--r-- | src/nvim/drawline.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index 9d6c95e20a..93f3ea569e 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -53,6 +53,18 @@ #define MB_FILLER_CHAR '<' // character used when a double-width character // doesn't fit. +/// possible draw states in win_line(), drawn in sequence. +typedef enum { + WL_START = 0, // nothing done yet + WL_CMDLINE, // cmdline window column + WL_FOLD, // 'foldcolumn' + WL_SIGN, // column for signs + WL_NR, // line number + WL_BRI, // 'breakindent' + WL_SBR, // 'showbreak' or 'diff' + WL_LINE, // text in the line +} LineDrawState; + /// for line_putchar. Contains the state that needs to be remembered from /// putting one character to the next. typedef struct { @@ -604,16 +616,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange, int left_curline_col = 0; int right_curline_col = 0; - // draw_state: items that are drawn in sequence: -#define WL_START 0 // nothing done yet -#define WL_CMDLINE (WL_START + 1) // cmdline window column -#define WL_FOLD (WL_CMDLINE + 1) // 'foldcolumn' -#define WL_SIGN (WL_FOLD + 1) // column for signs -#define WL_NR (WL_SIGN + 1) // line number -#define WL_BRI (WL_NR + 1) // 'breakindent' -#define WL_SBR (WL_BRI + 1) // 'showbreak' or 'diff' -#define WL_LINE (WL_SBR + 1) // text in the line - int draw_state = WL_START; // what to draw next + LineDrawState draw_state = WL_START; // what to draw next int syntax_flags = 0; int syntax_seqnr = 0; |