Skip to content

Commit

Permalink
Prevent crash when using numbers as labels
Browse files Browse the repository at this point in the history
  • Loading branch information
luk3yx committed Sep 14, 2024
1 parent e0626bd commit 4563382
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ local ceil, floor, min, max = math.ceil, math.floor, math.min, math.max
-- Estimates the width of a valid UTF-8 string, ignoring any escape sequences.
-- This function hopefully works with most (but not all) scripts, maybe it
-- could still be improved.
local byte = string.byte
local byte, strlen = string.byte, string.len
local LPAREN = byte("(")
local function naive_str_width(str)
local w = 0
local prev_w = 0
local line_count = 1
local i = 1
local str_length = #str
local str_length = strlen(str)
while i <= str_length do
local char = byte(str, i)
if char == 0x1b then
Expand Down

0 comments on commit 4563382

Please sign in to comment.