aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mbyte.h
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2015-06-26 12:49:14 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2016-11-05 14:49:24 +0100
commit5072ab9e5b75963d2fa831a6eb84ac04a4182659 (patch)
treee46907e20ba1c09d6d55b8da2341c89eb0066a18 /src/nvim/mbyte.h
parent4804001aff408558b8dd60ae3ba4cd9b84a5b949 (diff)
downloadrneovim-5072ab9e5b75963d2fa831a6eb84ac04a4182659.tar.gz
rneovim-5072ab9e5b75963d2fa831a6eb84ac04a4182659.tar.bz2
rneovim-5072ab9e5b75963d2fa831a6eb84ac04a4182659.zip
encoding: cleanup mbyte.c given fixed encoding=utf-8
Eliminate mb_init(): Set "enc_utf" and "has_mbyte" early. Eliminate "enc_unicode" and "enc_latin1like". init_chartab() and screenalloc() are already invoked elsewhere in the initialization process. The EncodingChanged autocmd cannot be triggered. At initialization, there is no spellfiles to reload
Diffstat (limited to 'src/nvim/mbyte.h')
-rw-r--r--src/nvim/mbyte.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/nvim/mbyte.h b/src/nvim/mbyte.h
index 0cfe2c4bab..2c92a0fbb2 100644
--- a/src/nvim/mbyte.h
+++ b/src/nvim/mbyte.h
@@ -9,8 +9,8 @@
* MB_BYTE2LEN_CHECK() can be used to count a special key as one byte.
* Don't call MB_BYTE2LEN(b) with b < 0 or b > 255!
*/
-#define MB_BYTE2LEN(b) mb_bytelen_tab[b]
-#define MB_BYTE2LEN_CHECK(b) (((b) < 0 || (b) > 255) ? 1 : mb_bytelen_tab[b])
+#define MB_BYTE2LEN(b) utf8len_tab[b]
+#define MB_BYTE2LEN_CHECK(b) (((b) < 0 || (b) > 255) ? 1 : utf8len_tab[b])
/* properties used in enc_canon_table[] (first three mutually exclusive) */
#define ENC_8BIT 0x01
@@ -28,6 +28,18 @@
#define ENC_LATIN9 0x400 /* Latin9 */
#define ENC_MACROMAN 0x800 /* Mac Roman (not Macro Man! :-) */
+// TODO(bfredl): eventually we should keep only one of the namings
+#define mb_ptr2len utfc_ptr2len
+#define mb_ptr2len_len utfc_ptr2len_len
+#define mb_char2len utf_char2len
+#define mb_char2bytes utf_char2bytes
+#define mb_ptr2cells utf_ptr2cells
+#define mb_ptr2cells_len utf_ptr2cells_len
+#define mb_char2cells utf_char2cells
+#define mb_off2cells utf_off2cells
+#define mb_ptr2char utf_ptr2char
+#define mb_head_off utf_head_off
+
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "mbyte.h.generated.h"
#endif