Compare commits
No commits in common. "c1707b132eb3781c9ea85299bf1ebe99b4db9d84" and "29231ad87add8eb2b9dca01271a311a31c3dc3b2" have entirely different histories.
c1707b132e
...
29231ad87a
2 changed files with 2 additions and 16 deletions
|
|
@ -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 = .{
|
var ctx: Ctx = .{
|
||||||
.allocator = allocator,
|
.allocator = allocator,
|
||||||
.pattern = pattern_,
|
.pattern = pattern,
|
||||||
.data = data,
|
.data = data,
|
||||||
.callback = callback,
|
.callback = callback,
|
||||||
.buf = try allocator.alloc(u8, pattern.len * 2),
|
.buf = try allocator.alloc(u8, pattern.len * 2),
|
||||||
|
|
|
||||||
|
|
@ -180,11 +180,7 @@ const cmds = struct {
|
||||||
pub fn toggle_find_mode(self: *Self, _: Ctx) Result {
|
pub fn toggle_find_mode(self: *Self, _: Ctx) Result {
|
||||||
const new_find_mode: Buffer.FindMode = switch (self.find_mode) {
|
const new_find_mode: Buffer.FindMode = switch (self.find_mode) {
|
||||||
.exact => .case_folded,
|
.exact => .case_folded,
|
||||||
.case_folded => .exact,
|
.auto, .case_folded => .exact,
|
||||||
.auto => if (Buffer.unicode.is_lowercase(self.input_.items))
|
|
||||||
.exact
|
|
||||||
else
|
|
||||||
.case_folded,
|
|
||||||
};
|
};
|
||||||
const allocator = self.allocator;
|
const allocator = self.allocator;
|
||||||
const query = try allocator.dupe(u8, self.input_.items);
|
const query = try allocator.dupe(u8, self.input_.items);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue