aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-02-10 11:03:59 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2018-06-13 10:11:11 +0200
commitd8e18c96a904667ce60366be22dbdf248006ff2e (patch)
treed4d71e26b159e59b15ef2b210453baae4be0b3c8 /src/nvim/eval.c
parent315b7f8632076d882d498fc0bfab21a87ca75acb (diff)
downloadrneovim-d8e18c96a904667ce60366be22dbdf248006ff2e.tar.gz
rneovim-d8e18c96a904667ce60366be22dbdf248006ff2e.tar.bz2
rneovim-d8e18c96a904667ce60366be22dbdf248006ff2e.zip
screen: use UTF-8 representation
Store text in ScreenLines as UTF-8, so it can be sent as-is to the UI layer. `utfc_char2bytes(off,buf)` is removed, as `ScreenLines[off]` now already contains this representation. To recover the codepoints that the screen arrays previously contained, use utfc_ptr2char (or utf_ptr2char to ignore composing chars). NB: This commit does NOT change how screen.c processes incoming UTF-8 data from buffers, cmdline, messages etc. Any algorithm that operates on UCS-4 (like arabic shaping, treatment of non-printable chars) is left unchanged for now.
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 30c17af8c9..9ce354a0c5 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -13994,10 +13994,7 @@ static void f_screenchar(typval_T *argvars, typval_T *rettv, FunPtr fptr)
c = -1;
} else {
off = LineOffset[row] + col;
- if (enc_utf8 && ScreenLinesUC[off] != 0)
- c = ScreenLinesUC[off];
- else
- c = ScreenLines[off];
+ c = utf_ptr2char(ScreenLines[off]);
}
rettv->vval.v_number = c;
}