mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-22 07:24: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
|
if path == nil then
|
||||||
local cwd = vim.fn.getcwd()
|
local cwd = vim.fn.getcwd()
|
||||||
local full_path = vim.fn.expand("%:p")
|
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
|
end
|
||||||
if #path > 0 then
|
if #path > 0 then
|
||||||
local buf = vim.api.nvim_get_current_buf()
|
local buf = vim.api.nvim_get_current_buf()
|
||||||
|
|
|
@ -193,6 +193,15 @@ local function buffer_len(buf)
|
||||||
return count
|
return count
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@return string
|
||||||
|
local function separator()
|
||||||
|
if vim.uv.os_uname().sysname == "Windows_NT" then
|
||||||
|
return '\\'
|
||||||
|
else
|
||||||
|
return '/'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
multiline_highlight = multiline_highlight,
|
multiline_highlight = multiline_highlight,
|
||||||
cursor = {
|
cursor = {
|
||||||
|
@ -207,4 +216,5 @@ return {
|
||||||
available_colors = available_colors,
|
available_colors = available_colors,
|
||||||
color = color,
|
color = color,
|
||||||
poller = async_poller,
|
poller = async_poller,
|
||||||
|
sep = separator,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue