aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ascii.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ascii.h')
-rw-r--r--src/nvim/ascii.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nvim/ascii.h b/src/nvim/ascii.h
index d9d9eac04d..82562b9aa5 100644
--- a/src/nvim/ascii.h
+++ b/src/nvim/ascii.h
@@ -8,6 +8,9 @@
#ifndef NVIM_ASCII_H
#define NVIM_ASCII_H
+#include <stdbool.h>
+#include "func_attr.h"
+
// Definitions of various common control characters.
#define CharOrd(x) ((x) < 'a' ? (x) - 'A' : (x) - 'a')
@@ -87,4 +90,13 @@
# define PATHSEPSTR "/"
#endif
+static inline bool ascii_iswhite(int c) FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_CONST;
+
+/// ascii_iswhite() is used for "^" and the like. It differs from isspace()
+/// because it doesn't include <CR> and <LF> and the like.
+static inline bool ascii_iswhite(int c)
+{
+ return c == ' ' || c == '\t';
+}
+
#endif /* NVIM_ASCII_H */