Skip to content

Commit

Permalink
fix: pos maybe wrong if wild-width chars
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane-XB-Qian committed Jul 7, 2023
1 parent a066c2a commit f65177f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,17 @@ func filter(fuzzy bool) {
break
}
}
poss := -1
if pos != -1 {
poss = len([]rune(f[:pos]))
}
pos1 := len([]rune(f[:pos_s]))
pos2 := len([]rune(f[:pos_e]))
tmp = append(tmp, matched{
name: f,
pos1: pos1,
pos2: pos2 + 1,
pseq: pos,
pseq: poss,
selected: prevSelected,
index: len(tmp),
})
Expand Down

0 comments on commit f65177f

Please sign in to comment.