Skip to content

Commit

Permalink
fix(neo-tree): For keymap "Y": use vim.ui.select instead of vim.fn.in…
Browse files Browse the repository at this point in the history
…putlist

And popup the Copied window after selection
  • Loading branch information
adoyle-h committed Sep 30, 2023
1 parent e8f0285 commit 1c14ee1
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lua/one/plugins/neo-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,19 @@ local function keymapCopy(state)
}

-- absolute path to clipboard
local i = vim.fn.inputlist({
'Choose to copy to clipboard:',
vim.ui.select({
'1. Absolute path: ' .. results[1],
'2. Path relative to CWD: ' .. results[2],
'3. Path relative to HOME: ' .. results[3],
'4. Filename: ' .. results[4],
'5. Filename without extension: ' .. results[5],
'6. Extension of the filename: ' .. results[6],
})

if i > 0 then
}, { prompt = 'Choose to copy to clipboard:' }, function(choice)
local i = tonumber(choice:sub(1, 1))
local result = results[i]
if not result then return print('Invalid choice: ' .. i) end
vim.fn.setreg('"', result)
end
vim.notify('Copied: ' .. result)
end)
end

local moveToLastSibling = function(state)
Expand Down

0 comments on commit 1c14ee1

Please sign in to comment.