summaryrefslogtreecommitdiff
path: root/src/core/wee-string.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-09-18 23:26:49 +0200
committerSébastien Helleu <flashcode@flashtux.org>2022-09-18 23:26:49 +0200
commit01cf98e8fbd8411464fcedd97d7400d961f7e1f5 (patch)
treee806dd11db677e788e4991383fedc4c0c1ee02bc /src/core/wee-string.c
parentd7c0e896b2d00e215cf3616edc16afeaeb60196f (diff)
downloadweechat-01cf98e8fbd8411464fcedd97d7400d961f7e1f5.zip
core: add key alt+backspace, change behavior of key ctrl+w (closes #559)
The key ctrl+w now deletes one word until whitespace. The new key alt+backspace deletes one word (same behavior as ctrl+w in previous releases).
Diffstat (limited to 'src/core/wee-string.c')
-rw-r--r--src/core/wee-string.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/wee-string.c b/src/core/wee-string.c
index e0f3af037..523d0fdff 100644
--- a/src/core/wee-string.c
+++ b/src/core/wee-string.c
@@ -1110,6 +1110,20 @@ string_convert_escaped_chars (const char *string)
}
/*
+ * Checks if first char of string is a whitespace (space or tab).
+ *
+ * Returns:
+ * 1: first char is whitespace
+ * 0: first char is not whitespace
+ */
+
+int
+string_is_whitespace_char (const char *string)
+{
+ return (string && ((string[0] == ' ') || string[0] == '\t')) ? 1 : 0;
+}
+
+/*
* Checks if first char of string is a "word char".
*
* The word chars are customizable with options "weechat.look.word_chars_*".