From e938326eee9781d340ae3704a742d5e3bad95cb6 Mon Sep 17 00:00:00 2001 From: Evan Gates Date: Fri, 18 Sep 2020 12:05:27 -0700 Subject: Add ignorecase option Add a global ignorecase boolean option. When set add REG_ICASE to cflags when calling text_regex_compile(). --- vis.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vis.c') diff --git a/vis.c b/vis.c index c4e8fa1..d84622c 100644 --- a/vis.c +++ b/vis.c @@ -1685,7 +1685,8 @@ Regex *vis_regex(Vis *vis, const char *pattern) { Regex *regex = text_regex_new(); if (!regex) return NULL; - if (text_regex_compile(regex, pattern, REG_EXTENDED|REG_NEWLINE) != 0) { + int cflags = REG_EXTENDED|REG_NEWLINE|(REG_ICASE*vis->ignorecase); + if (text_regex_compile(regex, pattern, cflags) != 0) { text_regex_free(regex); return NULL; } -- cgit v1.2.3