Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhuster committed Nov 28, 2024
1 parent 86a0d90 commit 03b1ee5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lua/dirvish-do/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ require('dirvish-do.compat')
local M = {}

local lsp = vim.lsp
local sep = vim.fn.exists('+shellslash') == 1 and not vim.o.shellslash and '\\' or '/'
local fn = vim.fn
local sep = fn.exists('+shellslash') == 1 and not vim.o.shellslash and '\\' or '/'

---@param method string
---@param params table
Expand Down Expand Up @@ -42,11 +43,13 @@ local function send_rename(method, old_path, new_path)
send(method, params)
end
if old_path:sub(-1) == sep then
local old_path_list = vim.fn.globpath(old_path, '*', true, true)
local new_path_list = vim.fn.globpath(new_path, '*', true, true)
local old_path_list = fn.globpath(old_path, '*', true, true)
local new_path_list = fn.globpath(new_path, '*', true, true)
for i, old in ipairs(old_path_list) do
local new = new_path_list[i]
send_rename_request(old, new)
if fn.isdirectory(old) == 0 then
local new = new_path_list[i]
send_rename_request(old, new)
end
end
else
send_rename_request(old_path, new_path)
Expand Down

0 comments on commit 03b1ee5

Please sign in to comment.