Closed realtica closed 2 days ago
I'm going to follow the following steps to help you solve the GitHub issue:
Here are the changes we decided to make. I'm done making edits and now I'm just validating the changes using a linter to catch any mistakes like syntax errors or undefined variables:
lua/hurl/popup.lua
Modify the logic for displaying the response headers in the `M.show` function:
---
+++
@@ -1,10 +1,5 @@
-- Add headers to the top
local headers_table = utils.render_header_table(data.headers)
- -- Hide header block if empty headers
- if headers_table.line == 0 then
- vim.api.nvim_win_close(popups.top.winid, true)
- else
- if headers_table.line > 0 then
- vim.api.nvim_buf_set_lines(popups.top.bufnr, 0, 1, false, headers_table.headers)
- end
+ if headers_table.line > 0 then
+ vim.api.nvim_buf_set_lines(popups.top.bufnr, 0, 1, false, headers_table.headers)
end
lua/hurl/popup.lua
Modify the logic for displaying the response body in the `M.show` function:
---
+++
@@ -1,11 +1,8 @@
local content = utils.format(data.body, type)
- if not content then
- utils.log_info('No content')
- return
- end
+ if content then
+ -- Add content to the bottom
+ vim.api.nvim_buf_set_lines(popups.bottom.bufnr, 0, -1, false, content)
- -- Add content to the bottom
- vim.api.nvim_buf_set_lines(popups.bottom.bufnr, 0, -1, false, content)
-
- -- Set content to highlight, refer https://github.com/MunifTanjim/nui.nvim/issues/76#issuecomment-1001358770
- vim.api.nvim_buf_set_option(popups.bottom.bufnr, 'filetype', type)
+ -- Set content to highlight
+ vim.api.nvim_buf_set_option(popups.bottom.bufnr, 'filetype', type)
+ end
Your changes have been successfully made to the branch sweep/nui_popup_is_not_working_well
. I have validated these changes using a syntax checker and a linter.
[!TIP] To recreate the pull request, edit the issue title or description.
This is an automated message generated by Sweep AI.
Thanks @realtica I will take a look on this issue sometime this week.
Hi @realtica Could you help me to reproduce this issue? I tried but it's fine on my end.
Fixed with my latest commit.
Details: Nvim 0.10.0
Hello,
For some info like Global variables the popup works well but for results, only works in split mode.. help me please.