Compare commits

..

No commits in common. "c1707b132eb3781c9ea85299bf1ebe99b4db9d84" and "29231ad87add8eb2b9dca01271a311a31c3dc3b2" have entirely different histories.

2 changed files with 2 additions and 16 deletions

View file

@ -1039,19 +1039,9 @@ const Node = union(enum) {
}
}
};
const pattern_ = switch (mode) {
.exact => pattern,
.case_folded => unicode.case_fold(allocator, pattern) catch
allocator.dupe(u8, pattern) catch
@panic("OOM find_all_ranges"),
};
defer switch (mode) {
.exact => {},
.case_folded => allocator.free(pattern_),
};
var ctx: Ctx = .{
.allocator = allocator,
.pattern = pattern_,
.pattern = pattern,
.data = data,
.callback = callback,
.buf = try allocator.alloc(u8, pattern.len * 2),

View file

@ -180,11 +180,7 @@ const cmds = struct {
pub fn toggle_find_mode(self: *Self, _: Ctx) Result {
const new_find_mode: Buffer.FindMode = switch (self.find_mode) {
.exact => .case_folded,
.case_folded => .exact,
.auto => if (Buffer.unicode.is_lowercase(self.input_.items))
.exact
else
.case_folded,
.auto, .case_folded => .exact,
};
const allocator = self.allocator;
const query = try allocator.dupe(u8, self.input_.items);