aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mbyte.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/mbyte.h')
-rw-r--r--src/nvim/mbyte.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/mbyte.h b/src/nvim/mbyte.h
index 68acc5075e..be632ee834 100644
--- a/src/nvim/mbyte.h
+++ b/src/nvim/mbyte.h
@@ -110,3 +110,11 @@ static inline StrCharInfo utfc_next(StrCharInfo cur)
next += next_len;
}
}
+
+static inline StrCharInfo utf_ptr2StrCharInfo(char *ptr)
+ REAL_FATTR_NONNULL_ALL REAL_FATTR_ALWAYS_INLINE REAL_FATTR_PURE;
+
+static inline StrCharInfo utf_ptr2StrCharInfo(char *ptr)
+{
+ return (StrCharInfo){ .ptr = ptr, .chr = utf_ptr2CharInfo(ptr) };
+}