fix: smart select next find mode if find mode is .auto

This commit is contained in:
CJ van den Berg 2025-11-26 12:52:23 +01:00
parent 891b80e5bb
commit c1707b132e
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -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);