Skip to content

Commit

Permalink
fix(buffers): fix 'ctrl-d' interactions in Windows (#600)
Browse files Browse the repository at this point in the history
  • Loading branch information
linrongbin16 authored Feb 9, 2024
1 parent 603d0a5 commit dc33749
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 7 additions & 0 deletions lua/fzfx/cfg/buffers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ local paths = require("fzfx.commons.paths")
local constants = require("fzfx.lib.constants")
local bufs = require("fzfx.lib.bufs")
local switches = require("fzfx.lib.switches")
local log = require("fzfx.lib.log")

local parsers_helper = require("fzfx.helper.parsers")
local actions_helper = require("fzfx.helper.actions")
Expand Down Expand Up @@ -121,11 +122,17 @@ M._delete_buffer = function(line)
local filenames = {}
for _, bufnr in ipairs(bufnrs) do
local bufpath = paths.reduce(vim.api.nvim_buf_get_name(bufnr))
bufpath = paths.normalize(bufpath, { double_backslash = true, expand = true })
filenames[bufpath] = bufnr
end
if strings.not_empty(line) then
local parsed = parsers_helper.parse_find(line)
local bufnr = filenames[parsed.filename]
-- log.debug(
-- "|_delete_buffer| parsed:%s, filenames:%s",
-- vim.inspect(parsed.filename),
-- vim.inspect(filenames)
-- )
if type(bufnr) == "number" and bufs.buf_is_valid(bufnr) then
vim.api.nvim_buf_delete(bufnr, {})
end
Expand Down
5 changes: 1 addition & 4 deletions lua/fzfx/detail/general.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1263,10 +1263,7 @@ local function general(name, query, bang, pipeline_configs, default_pipeline)
local action = interaction_opts.interaction

local function interaction_rpc(line_params)
-- log.debug(
-- "|general.interaction_rpc| line_params:%s",
-- vim.inspect(line_params)
-- )
-- log.debug("|general.interaction_rpc| line_params:%s", vim.inspect(line_params))
action(line_params, context)
end

Expand Down

0 comments on commit dc33749

Please sign in to comment.