Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hurl): add buffer name for split response window #163

Merged
merged 1 commit into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lua/hurl/split.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ M.show = function(data, type)
-- mount/open the component
split:mount()

vim.api.nvim_buf_set_name(split.bufnr, 'hurl-response')

if _HURL_GLOBAL_CONFIG.auto_close then
-- unmount component when buffer is closed
split:on(event.BufLeave, function()
Expand Down Expand Up @@ -51,6 +53,8 @@ M.show = function(data, type)
vim.api.nvim_buf_set_lines(split.bufnr, headers_table.line, -1, false, content)

local function quit()
-- set buffer name to empty string so it wouldn't conflict when next time buffer opened
vim.api.nvim_buf_set_name(split.bufnr, '')
vim.cmd('q')
split:unmount()
end
Expand Down