Merge pull request #260 from ThePrimeagen/fix_buf_with_style

Fix buf with style
This commit is contained in:
ThePrimeagen 2023-02-22 20:00:08 -07:00 committed by GitHub
commit f7040fd0c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 49 additions and 41 deletions

View File

@ -10,8 +10,10 @@ local cache_config = string.format("%s/harpoon.json", data_path)
local M = {}
local the_primeagen_harpoon =
vim.api.nvim_create_augroup("THE_PRIMEAGEN_HARPOON", { clear = true })
local the_primeagen_harpoon = vim.api.nvim_create_augroup(
"THE_PRIMEAGEN_HARPOON",
{ clear = true }
)
vim.api.nvim_create_autocmd({ "BufLeave, VimLeave" }, {
callback = function()
@ -50,7 +52,7 @@ vim.api.nvim_create_autocmd("FileType", {
vim.cmd("tabnew")
vim.cmd("e " .. working_directory .. curline)
end, { buffer = true, noremap = true, silent = true })
end
end,
})
--[[
{

View File

@ -7,8 +7,10 @@ local M = {}
local tmux_windows = {}
if global_config.tmux_autoclose_windows then
local harpoon_tmux_group =
vim.api.nvim_create_augroup("HARPOON_TMUX", { clear = true })
local harpoon_tmux_group = vim.api.nvim_create_augroup(
"HARPOON_TMUX",
{ clear = true }
)
vim.api.nvim_create_autocmd("VimLeave", {
callback = function()

View File

@ -205,7 +205,9 @@ function M.nav_file(id)
)
end
local old_bufinfo = vim.fn.getbufinfo(old_bufnr)[1]
local old_bufinfo = vim.fn.getbufinfo(old_bufnr)
if type(old_bufinfo) == "table" and #old_bufinfo >= 1 then
old_bufinfo = old_bufinfo[1]
local no_name = old_bufinfo.name == ""
local one_line = old_bufinfo.linecount == 1
local unchanged = old_bufinfo.changed == 0
@ -213,6 +215,7 @@ function M.nav_file(id)
vim.api.nvim_buf_delete(old_bufnr, {})
end
end
end
function M.location_window(options)
local default_options = {

View File

@ -38,14 +38,16 @@ function M.get_os_command_output(cmd, cwd)
end
local command = table.remove(cmd, 1)
local stderr = {}
local stdout, ret = Job:new({
local stdout, ret = Job
:new({
command = command,
args = cmd,
cwd = cwd,
on_stderr = function(_, data)
table.insert(stderr, data)
end,
}):sync()
})
:sync()
return stdout, ret, stderr
end

View File

@ -51,8 +51,9 @@ local generate_new_finder = function()
end
local delete_harpoon_mark = function(prompt_bufnr)
local confirmation =
vim.fn.input(string.format("Delete current mark(s)? [y/n]: "))
local confirmation = vim.fn.input(
string.format("Delete current mark(s)? [y/n]: ")
)
if
string.len(confirmation) == 0
or string.sub(string.lower(confirmation), 0, 1) ~= "y"
@ -113,8 +114,7 @@ end
return function(opts)
opts = opts or {}
pickers
.new(opts, {
pickers.new(opts, {
prompt_title = "harpoon marks",
finder = generate_new_finder(),
sorter = conf.generic_sorter(opts),
@ -130,6 +130,5 @@ return function(opts)
map("n", "<c-n>", move_mark_down)
return true
end,
})
:find()
}):find()
end