From 35b20395ceb6ec91e58b537288006cc6a597761b Mon Sep 17 00:00:00 2001 From: Matthew Scott Date: Sat, 21 Dec 2024 11:19:03 -0800 Subject: [PATCH] Mark before jumping. --- CHANGELOG.md | 1 + lua/obsidian/commands/follow_link.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b585ed0e2..d5e14767c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added `opts.follow_img_func` option for customizing how to handle image paths. - Added better handling for undefined template fields, which will now be prompted for. +- The follow-link function now marks the current position in the jump list before moving. ### Changed diff --git a/lua/obsidian/commands/follow_link.lua b/lua/obsidian/commands/follow_link.lua index 8b7023cbd..541d4dcb4 100644 --- a/lua/obsidian/commands/follow_link.lua +++ b/lua/obsidian/commands/follow_link.lua @@ -4,6 +4,6 @@ return function(client, data) if data.args and string.len(data.args) > 0 then opts.open_strategy = data.args end - + vim.cmd [[normal! m']] client:follow_link_async(nil, opts) end