mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-12-23 05:44:52 +01:00
fix: normalize share path on windows
This commit is contained in:
parent
add4ff2879
commit
b80d1898be
2 changed files with 12 additions and 1 deletions
|
@ -92,7 +92,8 @@ local joined_actions = {
|
|||
if path == nil then
|
||||
local cwd = vim.fn.getcwd()
|
||||
local full_path = vim.fn.expand("%:p")
|
||||
path = string.gsub(full_path, cwd .. "/", "")
|
||||
path = string.gsub(full_path, cwd .. utils.sep(), "")
|
||||
path = string.gsub(path, '\\', '/')
|
||||
end
|
||||
if #path > 0 then
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
|
|
|
@ -193,6 +193,15 @@ local function buffer_len(buf)
|
|||
return count
|
||||
end
|
||||
|
||||
---@return string
|
||||
local function separator()
|
||||
if vim.uv.os_uname().sysname == "Windows_NT" then
|
||||
return '\\'
|
||||
else
|
||||
return '/'
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
multiline_highlight = multiline_highlight,
|
||||
cursor = {
|
||||
|
@ -207,4 +216,5 @@ return {
|
|||
available_colors = available_colors,
|
||||
color = color,
|
||||
poller = async_poller,
|
||||
sep = separator,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue