File tree Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -203,30 +203,33 @@ endfunc
203
203
" ----------------------------------------------------------------------
204
204
function ! navigator#charname#mapname (content) abort
205
205
let content = a: content
206
- let xcount = 1000
206
+ let output = []
207
+ let pos = 0
207
208
while 1
208
- let p1 = stridx (content, ' <' )
209
+ let p1 = stridx (content, ' <' , pos )
209
210
if p1 < 0
211
+ call add (output, strpart (content, pos))
210
212
break
211
213
endif
212
214
let p2 = stridx (content, ' >' , p1)
213
215
if p2 < 0
216
+ call add (output, strpart (content, pos))
214
217
break
215
218
endif
216
219
let text = strpart (content, p1 + 1 , p2 - p1 - 1 )
217
220
let mark = ' <' . text . ' >'
218
- try
219
- let replace = eval (' "\' . mark . ' "' )
220
- catch
221
- break
222
- endtry
223
- let content = s: replace (content, mark , replace)
224
- let xcount -= 1
225
- if xcount <= 0
226
- break
221
+ let replace = mark
222
+ if len (mark ) > 2
223
+ try
224
+ let replace = eval (' "\' . mark . ' "' )
225
+ catch
226
+ endtry
227
227
endif
228
+ call add (output, strpart (content, pos, p1 - pos))
229
+ call add (output, replace)
230
+ let pos = p2 + 1
228
231
endwhile
229
- return content
232
+ return join (output, ' ' )
230
233
endfunc
231
234
232
235
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ function! navigator#utils#create_buffer() abort
67
67
call setbufvar (bid, ' noswapfile' , 1 )
68
68
endif
69
69
call setbufvar (bid, ' &modifiable' , 1 )
70
- call deletebufline (bid, 1 , ' $' )
70
+ silent call deletebufline (bid, 1 , ' $' )
71
71
call setbufvar (bid, ' &modified' , 0 )
72
72
call setbufvar (bid, ' &filetype' , ' ' )
73
73
return bid
You can’t perform that action at this time.
0 commit comments