Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
runtime: ~/.local/share/nvim/site/pack/vendor/start
minidoc-git: https://github.com/echasnovski/mini.doc
minidoc-path: ~/.local/share/nvim/site/pack/vendor/start/mini.doc
nvim_url: https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz
nvim_url: https://github.com/neovim/neovim/releases/download/nightly/nvim-linux-x86_64.tar.gz

jobs:
docs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:

include:
- os: ubuntu-latest
nvim_url: https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz
nvim_url: https://github.com/neovim/neovim/releases/download/nightly/nvim-linux-x86_64.tar.gz
packages: luarocks ripgrep
manager: sudo apt-get

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed an edge case with collecting backlinks.
- Fixed typo in `ObsidianPasteImg`'s command description
- Fixed the case when `opts.attachments` is `nil`.
- Fixed reference creation in case the line has Unicode characters.

## [v3.9.0](https://github.com/epwalsh/obsidian.nvim/releases/tag/v3.9.0) - 2024-07-11

Expand Down
8 changes: 4 additions & 4 deletions lua/obsidian/completion/refs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ M.can_complete = function(request)

if vim.startswith(input, "[[") then
local suffix = string.sub(request.context.cursor_after_line, 1, 2)
local cursor_col = request.context.cursor.col
local cursor_char = request.context.cursor.character
local insert_end_offset = suffix == "]]" and 1 or -1
return true, search, cursor_col - 1 - #input, cursor_col + insert_end_offset, M.RefType.Wiki
return true, search, cursor_char - #input, cursor_char + 1 + insert_end_offset, M.RefType.Wiki
elseif vim.startswith(input, "[") then
local suffix = string.sub(request.context.cursor_after_line, 1, 1)
local cursor_col = request.context.cursor.col
local cursor_char = request.context.cursor.character
local insert_end_offset = suffix == "]" and 0 or -1
return true, search, cursor_col - 1 - #input, cursor_col + insert_end_offset, M.RefType.Markdown
return true, search, cursor_char - #input, cursor_char + 1 + insert_end_offset, M.RefType.Markdown
else
return false
end
Expand Down
Loading