Skip to content

Commit 89a2568

Browse files
committed
Use absolute path to get bufnr when using select() issue #563
1 parent da326d0 commit 89a2568

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: lua/harpoon/config.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ local Path = require("plenary.path")
44
local function normalize_path(buf_name, root)
55
return Path:new(buf_name):make_relative(root)
66
end
7-
local function to_exact_name(value)
8-
return "^" .. value .. "$"
7+
local function to_absolute_path(value)
8+
return vim.loop.fs_realpath(value)
99
end
1010

1111
local M = {}
@@ -106,7 +106,7 @@ function M.get_default_config()
106106

107107
options = options or {}
108108

109-
local bufnr = vim.fn.bufnr(to_exact_name(list_item.value))
109+
local bufnr = vim.fn.bufnr(to_absolute_path(list_item.value))
110110
local set_position = false
111111
if bufnr == -1 then -- must create a buffer!
112112
set_position = true

0 commit comments

Comments
 (0)