summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2020-02-07 07:37:29 +1100
committerMaxime Coste <mawww@kakoune.org>2020-02-07 07:37:29 +1100
commite9cf0f23f23d5d683af7dab8843353be6c0ccda3 (patch)
treefc4b784d355ff0d99c237c20a16600004a677208 /src
parent8eb84c6f5d04195a1375487aba93b9e5f5f0bf59 (diff)
Fix regex start desc computation for case insensitive ranges
Fixes #3345
Diffstat (limited to 'src')
-rw-r--r--src/regex_impl.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/regex_impl.cc b/src/regex_impl.cc
index 7148980b..a4457bcc 100644
--- a/src/regex_impl.cc
+++ b/src/regex_impl.cc
@@ -952,7 +952,9 @@ private:
case ParsedRegex::Class:
{
auto& character_class = m_parsed_regex.character_classes[node.value];
- if (character_class.ctypes == CharacterType::None and not character_class.negative)
+ if (character_class.ctypes == CharacterType::None and
+ not character_class.negative and
+ not character_class.ignore_case)
{
for (auto& range : character_class.ranges)
{
@@ -1441,6 +1443,11 @@ auto test_regex = UnitTest{[]{
}
{
+ TestVM<> vm{R"((?i)[a-z]+)"};
+ kak_assert(vm.exec("ABC"));
+ }
+
+ {
TestVM<> vm{R"([^\]]+)"};
kak_assert(not vm.exec("a]c"));
kak_assert(vm.exec("abc"));