aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/grid_defs.h
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-09-19 12:32:41 +0200
committerGitHub <noreply@github.com>2023-09-19 12:32:41 +0200
commit1db45a9c1fd68e57611829a9363212a39f3c55d6 (patch)
tree512daeff103353e06d8c82deaad4d5040b99d468 /src/nvim/grid_defs.h
parent2de5cddeb197502c8b3ecf5e7eb1ac929cc2307f (diff)
parent8da986ea877b07a5eb117446f410f2a7fc8cd9cb (diff)
downloadrneovim-1db45a9c1fd68e57611829a9363212a39f3c55d6.tar.gz
rneovim-1db45a9c1fd68e57611829a9363212a39f3c55d6.tar.bz2
rneovim-1db45a9c1fd68e57611829a9363212a39f3c55d6.zip
Merge pull request #25214 from bfredl/glyphcache
refactor(grid): change schar_T representation to be more compact
Diffstat (limited to 'src/nvim/grid_defs.h')
-rw-r--r--src/nvim/grid_defs.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/nvim/grid_defs.h b/src/nvim/grid_defs.h
index 4ad7d4cdb4..b0d1dafd29 100644
--- a/src/nvim/grid_defs.h
+++ b/src/nvim/grid_defs.h
@@ -9,9 +9,13 @@
#include "nvim/types.h"
#define MAX_MCO 6 // fixed value for 'maxcombine'
+// Includes final NUL. at least 4*(MAX_MCO+1)+1
+#define MAX_SCHAR_SIZE 32
-// The characters and attributes drawn on grids.
-typedef char schar_T[(MAX_MCO + 1) * 4 + 1];
+// if data[0] is 0xFF, then data[1..4] is a 24-bit index (in machine endianess)
+// otherwise it must be a UTF-8 string of length maximum 4 (no NUL when n=4)
+
+typedef uint32_t schar_T;
typedef int sattr_T;
enum {
@@ -41,6 +45,9 @@ enum {
///
/// vcols[] contains the virtual columns in the line. -1 means not available
/// (below last line), MAXCOL means after the end of the line.
+/// -2 or -3 means in fold column and a mouse click should:
+/// -2: open a fold
+/// -3: close a fold
///
/// line_offset[n] is the offset from chars[], attrs[] and vcols[] for the start
/// of line 'n'. These offsets are in general not linear, as full screen scrolling