File tree Expand file tree Collapse file tree 2 files changed +19
-17
lines changed Expand file tree Collapse file tree 2 files changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -192,7 +192,11 @@ M.parse = function(bufnr)
192
192
seen_names [name ] = true
193
193
end
194
194
end
195
+
195
196
for i , line in ipairs (lines ) do
197
+ -- hack to be compatible with Lua 5.1
198
+ -- use return instead of goto
199
+ (function ()
196
200
if line :match (" ^/%d+" ) then
197
201
-- Parse the line for an existing entry
198
202
local result , err = M .parse_line (adapter , line , column_defs )
@@ -203,10 +207,10 @@ M.parse = function(bufnr)
203
207
end_lnum = i ,
204
208
col = 0 ,
205
209
})
206
- goto continue
210
+ return
207
211
elseif result .data .id == 0 then
208
212
-- Ignore entries with ID 0 (typically the "../" entry)
209
- goto continue
213
+ return
210
214
end
211
215
local parsed_entry = result .data
212
216
local entry = result .entry
@@ -226,7 +230,7 @@ M.parse = function(bufnr)
226
230
end_lnum = i ,
227
231
col = 0 ,
228
232
})
229
- goto continue
233
+ return
230
234
end
231
235
assert (entry )
232
236
@@ -281,7 +285,7 @@ M.parse = function(bufnr)
281
285
end_lnum = i ,
282
286
col = 0 ,
283
287
})
284
- goto continue
288
+ return
285
289
end
286
290
if name ~= " " then
287
291
local link_pieces = vim .split (name , " -> " , { plain = true })
@@ -300,7 +304,7 @@ M.parse = function(bufnr)
300
304
})
301
305
end
302
306
end
303
- :: continue ::
307
+ end )()
304
308
end
305
309
306
310
for name , child_id in pairs (original_entries ) do
Original file line number Diff line number Diff line change @@ -618,19 +618,17 @@ local function render_buffer(bufnr, opts)
618
618
end
619
619
620
620
for _ , entry in ipairs (entry_list ) do
621
- if not M .should_display (entry [FIELD_NAME ], bufnr ) then
622
- goto continue
623
- end
624
- local cols = M .format_entry_cols (entry , column_defs , col_width , adapter )
625
- table.insert (line_table , cols )
626
-
627
- local name = entry [FIELD_NAME ]
628
- if seek_after_render == name then
629
- seek_after_render_found = true
630
- jump_idx = # line_table
631
- M .set_last_cursor (bufname , nil )
621
+ if M .should_display (entry [FIELD_NAME ], bufnr ) then
622
+ local cols = M .format_entry_cols (entry , column_defs , col_width , adapter )
623
+ table.insert (line_table , cols )
624
+
625
+ local name = entry [FIELD_NAME ]
626
+ if seek_after_render == name then
627
+ seek_after_render_found = true
628
+ jump_idx = # line_table
629
+ M .set_last_cursor (bufname , nil )
630
+ end
632
631
end
633
- :: continue::
634
632
end
635
633
636
634
local lines , highlights = util .render_table (line_table , col_width )
You can’t perform that action at this time.
0 commit comments