nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
88d4535
)
text/flat: FlatText::char_to_byte_index do the +1 first (and 0 last)
author
Jean Privat
<jean@pryen.org>
Fri, 4 Mar 2016 02:40:27 +0000
(21:40 -0500)
committer
Jean Privat
<jean@pryen.org>
Fri, 4 Mar 2016 02:59:15 +0000
(21:59 -0500)
Because stats!
Signed-off-by: Jean Privat <jean@pryen.org>
lib/core/text/flat.nit
patch
|
blob
|
history
diff --git
a/lib/core/text/flat.nit
b/lib/core/text/flat.nit
index
34e3ef5
..
200fdcf
100644
(file)
--- a/
lib/core/text/flat.nit
+++ b/
lib/core/text/flat.nit
@@
-54,7
+54,6
@@
redef class FlatText
var b = _bytepos
var its = _items
- if dpos == 0 then return b
if dpos == 1 then
b += _items.length_of_char_at(b)
_bytepos = b
@@
-67,6
+66,7
@@
redef class FlatText
_position = index
return b
end
+ if dpos == 0 then return b
var ln = _length
var pos = _position