summaryrefslogtreecommitdiff
path: root/lib/key.ml
diff options
context:
space:
mode:
authorFederico Igne <undyamon@disroot.org>2024-01-22 23:46:37 +0100
committerFederico Igne <undyamon@disroot.org>2024-01-22 23:46:37 +0100
commit7d009e0ca4a1af10cc6d31fb5982e38dcab9ee71 (patch)
tree0eeecddcdcc34abc199aba3af3e25be151c9e3e2 /lib/key.ml
parent0b2c183dbf275fbca3f9e0522cc583f85edccab5 (diff)
downloadsandy-7d009e0ca4a1af10cc6d31fb5982e38dcab9ee71.tar.gz
sandy-7d009e0ca4a1af10cc6d31fb5982e38dcab9ee71.zip
feat: add support for rendering text (i.e. tabs)
This allows to have differences between the "raw" content of the buffer and its visualization on screen. At the time of writing this handles the rendering of tabs (i.e. '\t') as a fixed amount of spaces, but will be useful for syntax highlighting as well.
Diffstat (limited to 'lib/key.ml')
-rw-r--r--lib/key.ml2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/key.ml b/lib/key.ml
index 85aa282..d6656c5 100644
--- a/lib/key.ml
+++ b/lib/key.ml
@@ -16,6 +16,7 @@ type key =
16 | Nul 16 | Nul
17 | Page_down 17 | Page_down
18 | Page_up 18 | Page_up
19 | Tab
19 20
20type t = key 21type t = key
21 22
@@ -24,6 +25,7 @@ let key c = Key c
24 25
25let of_char = function 26let of_char = function
26 | '\000' -> Nul 27 | '\000' -> Nul
28 | '\009' -> Tab
27 | '\013' -> Enter 29 | '\013' -> Enter
28 | '\027' -> Esc 30 | '\027' -> Esc
29 | '\127' -> Backspace 31 | '\127' -> Backspace