Skip to content

Commit

Permalink
fix bug when nvim-cmp not installed (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh authored Mar 24, 2023
1 parent 3750b91 commit 4bc10b8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Gracefully handle invalid aliases / tags in frontmatter (i.e. values that aren't strings). We'll warn about them and ignore the invalid values.
- Fixed `nvim-cmp` completion for notes that have no `aliases` specified.
- `nvim-cmp` completion will search based on file names now too, not just contents.
- Fixed bug when `nvim-cmp` is not installed.

## [v1.8.0](https://github.com/epwalsh/obsidian.nvim/releases/tag/v1.8.0) - 2023-02-16

Expand Down
5 changes: 4 additions & 1 deletion after/plugin/cmp_obsidian.lua
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
require("cmp").register_source("obsidian", require("cmp_obsidian").new())
local has_cmp, cmp = pcall(require, "cmp")
if has_cmp then
cmp.register_source("obsidian", require("cmp_obsidian").new())
end
5 changes: 4 additions & 1 deletion after/plugin/cmp_obsidian_new.lua
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
require("cmp").register_source("obsidian_new", require("cmp_obsidian_new").new())
local has_cmp, cmp = pcall(require, "cmp")
if has_cmp then
cmp.register_source("obsidian_new", require("cmp_obsidian_new").new())
end

0 comments on commit 4bc10b8

Please sign in to comment.