aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2024-05-02 17:55:26 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2024-05-02 22:15:39 +0200
commit3cf4097332fc45f42b15acaa2f7b399a7e86e64c (patch)
tree0daf9387402a7531d3cc11ad0e581012e4d01cde
parent18519a95d62da4c83adf015e622f71bcc7407e06 (diff)
downloadvis-lspc-3cf4097332fc45f42b15acaa2f7b399a7e86e64c.tar.gz
vis-lspc-3cf4097332fc45f42b15acaa2f7b399a7e86e64c.zip
replace // operator with math.floor and regular division
lua52 does not support the // arithemtic operator. Reported-By: avery havaniceday <shitpostalotl@unix.dog>
-rw-r--r--init.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 95d280d..4ef447a 100644
--- a/init.lua
+++ b/init.lua
@@ -625,7 +625,7 @@ local function file_lineno_to_viewport_lineno(win, file_lineno)
view_lineno = view_lineno + 1
-- Wrapped line this shifts our displayed line down
if #win.file.lines[n] > win.viewport.width then
- view_lineno = view_lineno + #win.file.lines[n] // win.viewport.width
+ view_lineno = view_lineno + math.floor(#win.file.lines[n] / win.viewport.width)
end
end
return view_lineno