patch 9.1.0037: Calling get_breakindent_win() repeatedly when computing virtcol
Problem: Calling get_breakindent_win() repeatedly when computing
virtual column, and get_breakindent_win() does a STRCMP() on
the whole line since patch 9.0.0016.
Solution: Cache the result, since the line doesn't change.
(zeertzjq)
closes: #13879
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/structs.h b/src/structs.h
index da8c2e2..76f1433 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -4909,6 +4909,10 @@
win_T *cts_win;
char_u *cts_line; // start of the line
char_u *cts_ptr; // current position in line
+#ifdef FEAT_LINEBREAK
+ int cts_bri_size; // cached size of 'breakindent', or -1
+ // if not computed yet
+#endif
#ifdef FEAT_PROP_POPUP
int cts_text_prop_count; // number of text props; when zero
// cts_text_props is not used