Skip to content

Commit

Permalink
fix: menu crash after ctrl+backspace with only one character in inp…
Browse files Browse the repository at this point in the history
…ut field

closes #847
  • Loading branch information
tomasklaen committed Feb 20, 2024
1 parent 2370cb4 commit 35699d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/uosc/elements/Menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ end
function Menu:search_backspace(event, word_mode)
local pos, old_query = #self.current.search.query, self.current.search.query
local is_palette = self.current.search_style == 'palette'
if word_mode then
if word_mode and #old_query > 1 then
local word_pat, other_pat = '[^%c%s%p]+$', '[%c%s%p]+$'
local init_pat = old_query:sub(#old_query):match(word_pat) and word_pat or other_pat
-- First we match all same type consecutive chars at the end
Expand Down

0 comments on commit 35699d3

Please # to comment.