@@ -3768,15 +3768,13 @@ endfunction
37683768function ! s: StringReader .__init__ (lines )
37693769 let self .buf = []
37703770 let self .pos = []
3771- let self .offset = []
37723771 let lnum = 0
37733772 let offset = 0
37743773 while lnum < len (a: lines )
37753774 let col = 0
37763775 for c in split (a: lines [lnum], ' \zs' )
37773776 call add (self .buf , c )
3778- call add (self .pos, [lnum + 1 , col + 1 ])
3779- call add (self .offset, offset)
3777+ call add (self .pos, [lnum + 1 , col + 1 , offset])
37803778 let col += len (c )
37813779 let offset += len (c )
37823780 endfor
@@ -3790,8 +3788,7 @@ function! s:StringReader.__init__(lines)
37903788 endif
37913789 else
37923790 call add (self .buf , c )
3793- call add (self .pos, [lnum + 2 , col + 1 ])
3794- call add (self .offset, offset)
3791+ call add (self .pos, [lnum + 2 , col + 1 , offset])
37953792 endif
37963793 let col += len (c )
37973794 let offset += len (c )
@@ -3800,14 +3797,12 @@ function! s:StringReader.__init__(lines)
38003797 let offset += 1
38013798 endwhile
38023799 call add (self .buf , ' <EOL>' )
3803- call add (self .pos, [lnum + 1 , col + 1 ])
3804- call add (self .offset, offset)
3800+ call add (self .pos, [lnum + 1 , col + 1 , offset])
38053801 let lnum += 1
38063802 let offset += 1
38073803 endwhile
38083804 " for <EOF>
3809- call add (self .pos, [lnum + 1 , 0 ])
3810- call add (self .offset, offset)
3805+ call add (self .pos, [lnum + 1 , 0 , offset])
38113806 let self .i = 0
38123807endfunction
38133808
@@ -3901,8 +3896,8 @@ function! s:StringReader.getstr(begin, end)
39013896endfunction
39023897
39033898function ! s: StringReader .getpos ()
3904- let [lnum, col ] = self .pos[self .i ]
3905- return {' i' : self .i , ' lnum' : lnum, ' col' : col , ' offset' : self . offset[ self . i ] }
3899+ let [lnum, col , offset ] = self .pos[self .i ]
3900+ return {' i' : self .i , ' lnum' : lnum, ' col' : col , ' offset' : offset}
39063901endfunction
39073902
39083903function ! s: StringReader .setpos (pos)
0 commit comments