fix: add compatibility for Lua 5.1 (#456)

Some architectures don't support LuaJIT.
Remove the goto's from the code to be compatible
with Neovim built without LuaJIT.

Signed-off-by: Julian Ruess <julianonline+github@posteo.de>
This commit is contained in:
Julian 2024-08-17 06:33:59 +02:00 committed by GitHub
parent fcca212c2e
commit b39a78959f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 109 additions and 107 deletions

View file

@ -626,19 +626,17 @@ local function render_buffer(bufnr, opts)
end
for _, entry in ipairs(entry_list) do
if not M.should_display(entry[FIELD_NAME], bufnr) then
goto continue
end
local cols = M.format_entry_cols(entry, column_defs, col_width, adapter)
table.insert(line_table, cols)
if M.should_display(entry[FIELD_NAME], bufnr) then
local cols = M.format_entry_cols(entry, column_defs, col_width, adapter)
table.insert(line_table, cols)
local name = entry[FIELD_NAME]
if seek_after_render == name then
seek_after_render_found = true
jump_idx = #line_table
M.set_last_cursor(bufname, nil)
local name = entry[FIELD_NAME]
if seek_after_render == name then
seek_after_render_found = true
jump_idx = #line_table
M.set_last_cursor(bufname, nil)
end
end
::continue::
end
local lines, highlights = util.render_table(line_table, col_width)