mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
LunaCON: patch up off-by-one line numbering problem. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4381 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
c797298b6a
commit
2d35d93f38
1 changed files with 7 additions and 0 deletions
|
@ -3083,6 +3083,13 @@ function getlinecol(pos) -- local
|
||||||
local line = bsearch(g_newlineidxs, pos)
|
local line = bsearch(g_newlineidxs, pos)
|
||||||
assert(line and g_newlineidxs[line]<=pos and pos<g_newlineidxs[line+1])
|
assert(line and g_newlineidxs[line]<=pos and pos<g_newlineidxs[line+1])
|
||||||
local col = pos-g_newlineidxs[line]
|
local col = pos-g_newlineidxs[line]
|
||||||
|
if (col == 0) then
|
||||||
|
-- XXX: we probably have an off-by-one error somewhere and it would
|
||||||
|
-- need to be fixed instead of doing these ugly workarounds.
|
||||||
|
line = line-1
|
||||||
|
col = pos-g_newlineidxs[line]
|
||||||
|
end
|
||||||
|
assert(col >= 1)
|
||||||
return line+1, col-1
|
return line+1, col-1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue