fix: smart select next find mode if find mode is .auto
This commit is contained in:
parent
891b80e5bb
commit
c1707b132e
1 changed files with 5 additions and 1 deletions
|
|
@ -180,7 +180,11 @@ 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,
|
||||||
.auto, .case_folded => .exact,
|
.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