summaryrefslogtreecommitdiff
path: root/tex/context/base/buff-ini.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/buff-ini.lua')
-rw-r--r--tex/context/base/buff-ini.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/tex/context/base/buff-ini.lua b/tex/context/base/buff-ini.lua
index 4ae4df699..a590cf81a 100644
--- a/tex/context/base/buff-ini.lua
+++ b/tex/context/base/buff-ini.lua
@@ -153,6 +153,9 @@ end
function buffers.range(lines,first,last,range) -- 1,3 1,+3 fromhere,tothere
local first, last = first or 1, last or #lines
+ if last < 0 then
+ last = #lines + last
+ end
local what = settings_to_array(range)
local r_first, r_last = what[1], what[2]
local f, l = tonumber(r_first), tonumber(r_last)
@@ -172,6 +175,9 @@ function buffers.range(lines,first,last,range) -- 1,3 1,+3 fromhere,tothere
end
if r_last then
if l then
+ if l < 0 then
+ l = #lines + l
+ end
if find(r_last,"^[%+]") then -- 1,+3
l = first + l
end