From 899fb177e0e3a308fe6fa9e27b38160952ce74f4 Mon Sep 17 00:00:00 2001 From: kyazdani42 Date: Mon, 8 Jun 2020 12:33:42 +0200 Subject: [PATCH] use path to matching str in lua/tree.lua --- lua/tree.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/tree.lua b/lua/tree.lua index fff830b4..99c7872f 100644 --- a/lua/tree.lua +++ b/lua/tree.lua @@ -3,6 +3,7 @@ local lib = require'lib.lib' local colors = require'lib.colors' local renderer = require'lib.renderer' local fs = require'lib.fs' +local utils = require'lib.utils' local api = vim.api local M = {} @@ -110,7 +111,7 @@ local function update_root_dir() -- this logic is a hack -- depending on vim-rooter or autochdir, it would not behave the same way when those two are not enabled -- until i implement multiple workspaces/project, it should stay like this - if bufname:match(lib.Tree.cwd:gsub('(%-)', '(%%-)'):gsub('(%.)', '(%%.)')) ~= nil then + if bufname:match(utils.path_to_matching_str(lib.Tree.cwd)) then return end local new_cwd = luv.cwd()