From be91092e21673dbdd9eab959a385532f73f64bbc Mon Sep 17 00:00:00 2001 From: Adriano Correa Date: Wed, 13 Jul 2022 09:28:56 -0300 Subject: [PATCH] fix: Remove CleanPath function, which is causing errors on Windows machines (fixes #151) --- lua/telekasten.lua | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/lua/telekasten.lua b/lua/telekasten.lua index a945f32..737c3f5 100644 --- a/lua/telekasten.lua +++ b/lua/telekasten.lua @@ -23,35 +23,10 @@ local Path = require("plenary.path") -- declare locals for the nvim api stuff to avoid more lsp warnings local vim = vim --- Cleans home path for Windows users --- Needs to be before default config, else with no user config --- home will not be cleaned and issues will still occur -local function CleanPath(path) - -- File path delimeter for Windows machines - local windows_delim = "\\" - -- Returns the path delimeter for the machine - -- '\\' for Windows, '/' for Unix - local system_delim = package.config:sub(1, 1) - local new_path_start - - -- Removes portion of path before '\\' for Windows machines - -- since Telescope does not like that - if system_delim == windows_delim then - new_path_start = path:find(windows_delim) -- Find the first '\\' - if new_path_start ~= nil then - path = path:sub(new_path_start) -- Start path at the first '\\' - end - end - - -- Returns cleaned path - return path -end - -- ---------------------------------------------------------------------------- -- DEFAULT CONFIG -- ---------------------------------------------------------------------------- local home = vim.fn.expand("~/zettelkasten") -home = CleanPath(home) local M = {} M.Cfg = { @@ -2831,7 +2806,7 @@ local function Setup(cfg) -- they will be merged later if k ~= "calendar_opts" then if k == "home" then - v = CleanPath(v) + v = v end M.Cfg[k] = v if debug then