mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-13 17:40:25 +00:00
Merge pull request #405 from willothy/deprecations
refactor: remove uses of deprecated `buf_set_option`
This commit is contained in:
commit
f7d3c7360d
@ -45,7 +45,9 @@ function M.setup_autocmds_and_keymaps(bufnr)
|
||||
vim.api.nvim_buf_set_name(bufnr, get_harpoon_menu_name())
|
||||
end
|
||||
|
||||
vim.api.nvim_buf_set_option(bufnr, "filetype", "harpoon")
|
||||
vim.api.nvim_set_option_value("filetype", "harpoon", {
|
||||
buf = bufnr,
|
||||
})
|
||||
vim.keymap.set("n", "q", function()
|
||||
M.run_toggle_command("q")
|
||||
end, { buffer = bufnr, silent = true })
|
||||
|
@ -114,7 +114,9 @@ function M.get_default_config()
|
||||
end
|
||||
if not vim.api.nvim_buf_is_loaded(bufnr) then
|
||||
vim.fn.bufload(bufnr)
|
||||
vim.api.nvim_buf_set_option(bufnr, "buflisted", true)
|
||||
vim.api.nvim_set_option_value("buflisted", true, {
|
||||
buf = bufnr,
|
||||
})
|
||||
end
|
||||
|
||||
if options.vsplit then
|
||||
|
@ -55,7 +55,9 @@ end
|
||||
---@param contents string[]
|
||||
function M.create_file(name, contents, row, col)
|
||||
local bufnr = vim.fn.bufnr(name, true)
|
||||
vim.api.nvim_buf_set_option(bufnr, "bufhidden", "hide")
|
||||
vim.api.nvim_set_option_value("bufhidden", "hide", {
|
||||
buf = bufnr,
|
||||
})
|
||||
vim.api.nvim_set_current_buf(bufnr)
|
||||
vim.api.nvim_buf_set_text(0, 0, 0, 0, 0, contents)
|
||||
if row then
|
||||
|
@ -97,7 +97,9 @@ function HarpoonUI:_create_window(toggle_opts)
|
||||
Buffer.setup_autocmds_and_keymaps(bufnr)
|
||||
|
||||
self.win_id = win_id
|
||||
vim.api.nvim_win_set_option(win_id, "number", true)
|
||||
vim.api.nvim_set_option_value("number", true, {
|
||||
win = win_id
|
||||
})
|
||||
|
||||
Listeners.listeners:emit(Listeners.event_names.UI_CREATE, {
|
||||
win_id = win_id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user