Skip to content

Commit

Permalink
fix(#13): correctly calculate width of unicode ZF_PROMPT
Browse files Browse the repository at this point in the history
Correctly calculate the display width of the ZF_PROMPT by using ziglyph.

Closes #13
  • Loading branch information
natecraddock committed Feb 1, 2023
1 parent 1b76bc5 commit c426ace
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui.zig
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ pub fn run(
var query = ArrayList(u8).init(allocator);
defer query.deinit();

const prompt_width = (try escapeANSI(allocator, prompt_str)).len;
const prompt_width = try dw.strWidth(try escapeANSI(allocator, prompt_str), .half);

var state = State{
.cursor = 0,
Expand Down

0 comments on commit c426ace

Please sign in to comment.