aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGit Rookie <mail@example.com>2020-12-16 09:05:06 +0400
committerGit Rookie <mail@example.com>2020-12-16 09:06:36 +0400
commit8798f44e5933354106df1ee9e9cb644b5862bdb9 (patch)
tree5da0c93502dac2ecf6d43c2285cc3a8412f0db98
parentae41a3699521239579dc36acb5e8e6f3a9c98eb1 (diff)
downloadvis-commentary-8798f44e5933354106df1ee9e9cb644b5862bdb9.tar.gz
Move `lines` definition out of the loop
-rw-r--r--vis-commentary.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/vis-commentary.lua b/vis-commentary.lua
index a9c61c4..a483ac5 100644
--- a/vis-commentary.lua
+++ b/vis-commentary.lua
@@ -123,6 +123,7 @@ end, "Toggle comment on a the current line")
local function visual_f(i)
return function()
local win = vis.win
+ local lines = win.file.lines
local comment = comment_string[win.syntax]
if not comment then return end
@@ -141,7 +142,6 @@ local function visual_f(i)
sel.pos = r.finish
local b = sel.line - i
- local lines = win.file.lines
block_comment(lines, a, b, prefix, suffix)
sel:to(lnum, col) -- restore cursor position