diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0be5a8b0..e1313d5b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 11692f71..0cfa36eb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index b585ed0e..fa65c9cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lua/obsidian/completion/refs.lua b/lua/obsidian/completion/refs.lua index 70e009c1..5eb29ea6 100644 --- a/lua/obsidian/completion/refs.lua +++ b/lua/obsidian/completion/refs.lua @@ -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