BREAKING: Unify lua and plug API mappings
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Made the names of the functions to invoke the plugin the same. This is a BREAKING change if using the lua mappings. On the other hand, it should stay pretty stable for the foreseeable future, with only new ones added and possibly vim commands added.
This commit is contained in:
parent
49f0b10fde
commit
0e77624689
3 changed files with 23 additions and 21 deletions
|
|
@ -17,26 +17,26 @@ end
|
|||
function ZK.get_anchor() return anchor.create() end
|
||||
|
||||
-- Open link under cursor, or next on line
|
||||
function ZK.open_link() return action.open_selected() end
|
||||
function ZK.link_open() return action.open_selected() end
|
||||
|
||||
-- Create a new link under cursor
|
||||
function ZK.make_link(visual) return action.make_link(visual) end
|
||||
function ZK.link_make(visual) return action.make_link(visual) end
|
||||
|
||||
-- If invoked in reach of a valid link will try to follow said link.
|
||||
-- Otherwise will take the current context and make a link out of it.
|
||||
function ZK.open_or_make_link(visual)
|
||||
if not ZK.open_link() then ZK.make_link(visual) end
|
||||
function ZK.link_follow(visual)
|
||||
if not ZK.link_open() then ZK.link_make(visual) end
|
||||
end
|
||||
|
||||
-- Open index file at zettel root directory. If title is passed in opens
|
||||
-- `title`.<extension> file, otherwise defaults to `index`.<extension>.
|
||||
function ZK.open_index(title) return action.open_index_file(title) end
|
||||
function ZK.index_open(title) return action.open_index_file(title) end
|
||||
|
||||
return {
|
||||
get_zettel_list = ZK.get_zettel_list,
|
||||
get_anchor = ZK.get_anchor,
|
||||
open_link = ZK.open_link,
|
||||
make_link = ZK.make_link,
|
||||
open_or_make_link = ZK.open_or_make_link,
|
||||
open_index = ZK.open_index
|
||||
link_open = ZK.link_open,
|
||||
link_make = ZK.link_make,
|
||||
link_follow = ZK.link_follow,
|
||||
index_open = ZK.index_open
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue