Skip to content

Commit

Permalink
fix: uses terse style for setting buftype and updates readme
Browse files Browse the repository at this point in the history
  • Loading branch information
catgoose authored and igorlfs committed Jan 29, 2025
1 parent 2877987 commit 75845f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ They are linked to (somewhat) reasonable defaults, but they may look odd with yo
These filetypes can be used to override buffer and window options set by `nvim-dap-view`

<details>
<summary>Example autocommands</summary>
<summary>Example autocommand</summary>

Map q to quit in `nvim-dap-view` filetypes:

```lua
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "dap-view", "dap-view-term", "dap-repl" }, -- dap-repl is set by `dap`
pattern = { "dap-view", "dap-view-term", "dap-repl" }, -- dap-repl is set by `nvim-dap`
callback = function(evt)
vim.api.nvim_buf_set_keymap(evt.buf, "n", "q", "<cmd>q<CR>", { noremap = true, silent = true })
vim.keymap.set("n", "q", "<C-w>q", { silent = true, buffer = evt.buf })
end,
})
```
Expand Down
2 changes: 1 addition & 1 deletion lua/dap-view/term/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ M.set_options = function()

local buf = vim.bo[state.term_bufnr]
buf.filetype = "dap-view-term"
vim.api.nvim_set_option_value("buftype", "nofile", { scope = "local", buf = state.term_bufnr })
buf.buftype = "nofile"
end

return M

0 comments on commit 75845f4

Please sign in to comment.