Skip to content

Commit

Permalink
hotfix(result): fix result pane content render in subsequent requests…
Browse files Browse the repository at this point in the history
… when not closing the results window, small cleanup
  • Loading branch information
NTBBloodbath committed Jan 31, 2024
1 parent 4a49dc0 commit 3e2dca8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lua/rest-nvim/result.lua
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function result.write_block(bufnr, block, rewrite, newline)
vim.api.nvim_set_option_value("modifiable", false, { buf = bufnr })
end

function result.display_buf(bufnr, res_code, stats)
function result.display_buf(bufnr)
local is_result_displayed = false

-- Check if the results buffer is already displayed
Expand Down Expand Up @@ -236,6 +236,9 @@ function result.display_buf(bufnr, res_code, stats)
vim.wo[winnr].winbar = winbar
end

-- Set winbar pane contents
---@diagnostic disable-next-line undefined-field
result.write_block(bufnr, result.pane_map[result.current_pane_index].contents, true, false)
move_cursor(bufnr, 1, 1)
end

Expand Down Expand Up @@ -359,7 +362,7 @@ function result.write_res(bufnr, res)
result.pane_map[1].contents = body
end)

result.display_buf(bufnr, res.code, res.statistics)
result.display_buf(bufnr)
end

return result

0 comments on commit 3e2dca8

Please sign in to comment.