summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2020-09-26 10:41:43 -0400
committerTJ DeVries <devries.timothyj@gmail.com>2020-09-26 10:42:19 -0400
commit059ccd33af511a128d2ad3bf51cfee5e07a2f191 (patch)
treede7e4c27d06f1c47ed1d735fe1292a9c5db909f9 /lua
parent6b23ef988b0f469917ede79c8a61c31456d0a8b0 (diff)
fix: use os sep
Diffstat (limited to 'lua')
-rw-r--r--lua/telescope/make_entry.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua
index ede729b..1d159be 100644
--- a/lua/telescope/make_entry.lua
+++ b/lua/telescope/make_entry.lua
@@ -3,6 +3,7 @@ local has_devicons, devicons = pcall(require, 'nvim-web-devicons')
local utils = require('telescope.utils')
local get_default = utils.get_default
+local os_sep = utils.get_separator()
local make_entry = {}
@@ -213,8 +214,8 @@ function make_entry.gen_from_buffer(opts)
-- if bufname is inside the cwd, trim that part of the string
if bufname:sub(1, #cwd) == cwd then
local offset = 0
- -- if cwd does ends in '/', we need to take it off
- if cwd:sub(#cwd, #cwd) ~= '/' then
+ -- if cwd does ends in the os separator, we need to take it off
+ if cwd:sub(#cwd, #cwd) ~= os_sep then
offset = 1
end
bufname = bufname:sub(#cwd + 1 + offset, #bufname)