Skip to content

Commit

Permalink
feat(hurl): add buffer name for split response window (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
wenjinnn authored May 28, 2024
1 parent 6d40061 commit fbc1377
Showing 1 changed file with 4 additions and 0 deletions.
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

0 comments on commit fbc1377

Please sign in to comment.