fix nvim open in file browser
This commit is contained in:
parent
9b12307e94
commit
48ca6b1861
1 changed files with 5 additions and 5 deletions
|
|
@ -375,12 +375,12 @@ in
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Unicode-safe file operations
|
-- Unicode-safe file operations (async to prevent blocking)
|
||||||
function open_file_with_system_app()
|
function open_file_with_system_app()
|
||||||
local filepath = vim.fn.expand('%:p')
|
local filepath = vim.fn.expand('%:p')
|
||||||
if filepath ~= "" then
|
if filepath ~= "" then
|
||||||
local escaped_path = vim.fn.shellescape(filepath)
|
-- Use jobstart for async execution (detach = true prevents blocking)
|
||||||
vim.fn.system('xdg-open ' .. escaped_path)
|
vim.fn.jobstart({'xdg-open', filepath}, {detach = true})
|
||||||
else
|
else
|
||||||
print("No file to open")
|
print("No file to open")
|
||||||
end
|
end
|
||||||
|
|
@ -389,8 +389,8 @@ in
|
||||||
function show_file_in_file_manager()
|
function show_file_in_file_manager()
|
||||||
local filepath = vim.fn.expand('%:p')
|
local filepath = vim.fn.expand('%:p')
|
||||||
if filepath ~= "" then
|
if filepath ~= "" then
|
||||||
local escaped_path = vim.fn.shellescape(filepath)
|
-- Use jobstart for async execution (detach = true prevents blocking)
|
||||||
vim.fn.system('nautilus --select ' .. escaped_path)
|
vim.fn.jobstart({'nautilus', '--select', filepath}, {detach = true})
|
||||||
else
|
else
|
||||||
print("No file to show")
|
print("No file to show")
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue