diff options
author | Georgi Kirilov <> | 2020-11-22 15:10:50 +0200 |
---|---|---|
committer | Georgi Kirilov <> | 2023-10-04 18:24:59 +0800 |
commit | 80980dd364b2e845dd474558cd3a820e7e32cec7 (patch) | |
tree | 75f806b5be091b0b2c7ab34000063ec16cd7c7a4 | |
parent | adfb9800b111680a5b023ccda90d7f2b18e85244 (diff) | |
download | vis-pairs-80980dd364b2e845dd474558cd3a820e7e32cec7.tar.gz |
Fix off-by-one excessive newline barfage
-rw-r--r-- | pairs.lua | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -180,8 +180,8 @@ local function barf_linewise(content, start, finish) if vis.mode == vis.modes.VISUAL_LINE then local block = content:sub(start + 1, finish) local newlines = l.match(l.Ct((l.Cp() * l.P"\n" + 1)^0), block) - if #newlines > 1 then - return start + newlines[1] + 1, start + newlines[#newlines] + if #newlines > 0 then + return start + newlines[1], start + newlines[#newlines] end end return start, finish |