Skip to content

Commit 9504c22

Browse files
authored
Merge branch 'master' into fix/fuzzy-autocompletion-with-blink
2 parents 8a3c4e8 + 468570f commit 9504c22

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ body:
88
attributes:
99
label: Describe the bug
1010
description: A clear description of what the bug is.
11+
- type: textarea
12+
validations:
13+
required: true
14+
attributes:
15+
label: checkhealth
16+
description: Run `:checkhealth orgmode` and paste the output here
1117
- type: textarea
1218
validations:
1319
required: true

lua/orgmode/api/file.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ end
113113
--- @return string
114114
function OrgFile:get_link()
115115
local filename = self.filename
116-
local bufnr = vim.fn.bufnr(filename)
116+
local bufnr = vim.fn.bufnr('^' .. filename .. '$')
117117

118118
if bufnr == -1 or not vim.api.nvim_buf_is_loaded(bufnr) then
119119
-- do remote edit

lua/orgmode/api/headline.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ end
276276
--- @return string
277277
function OrgHeadline:get_link()
278278
local filename = self.file.filename
279-
local bufnr = vim.fn.bufnr(filename)
279+
local bufnr = vim.fn.bufnr('^' .. filename .. '$')
280280

281281
if bufnr == -1 or not vim.api.nvim_buf_is_loaded(bufnr) then
282282
-- do remote edit

lua/orgmode/api/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function OrgApi.refile(opts)
8181
refile_opts.destination_headline = opts.destination._section
8282
end
8383

84-
local source_bufnr = vim.fn.bufnr(opts.source.file.filename) or -1
84+
local source_bufnr = vim.fn.bufnr('^' .. opts.source.file.filename .. '$') or -1
8585
local is_capture = source_bufnr > -1 and vim.b[source_bufnr].org_capture
8686

8787
if is_capture and orgmode.capture._window then

lua/orgmode/files/file.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ end
6060
---Load the file
6161
---@return OrgPromise<OrgFile | false>
6262
function OrgFile.load(filename)
63-
local bufnr = vim.fn.bufnr(filename) or -1
63+
local bufnr = vim.fn.bufnr('^' .. filename .. '$') or -1
6464

6565
if
6666
bufnr > -1
@@ -534,7 +534,7 @@ end
534534

535535
---@return number
536536
function OrgFile:bufnr()
537-
local bufnr = vim.fn.bufnr(self.filename) or -1
537+
local bufnr = vim.fn.bufnr('^' .. self.filename .. '$') or -1
538538
-- Do not consider unloaded buffers as valid
539539
-- Treesitter is not working in them
540540
if bufnr > -1 and vim.api.nvim_buf_is_loaded(bufnr) then
@@ -546,7 +546,7 @@ end
546546
---Return valid buffer handle or throw an error if it's not valid
547547
---@return number
548548
function OrgFile:get_valid_bufnr()
549-
local bufnr = vim.fn.bufnr(self.filename) or -1
549+
local bufnr = vim.fn.bufnr('^' .. self.filename .. '$') or -1
550550
if bufnr < 0 then
551551
error('[orgmode] No valid buffer for file ' .. self.filename .. ' to edit', 0)
552552
end

0 commit comments

Comments
 (0)