Skip to content

Commit d9e48c4

Browse files
authored
Open file hyperlinks starting with ~ (#575)
Co-authored-by: maidlover <N/A>
1 parent 2737ef2 commit d9e48c4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lua/orgmode/org/hyperlinks.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ end
148148
function Hyperlinks.get_file_real_path(url_path)
149149
local path = url_path
150150
path = path:gsub('^file:', '')
151+
if path:match('^~/') then
152+
path = path:gsub('^~', os.getenv('HOME'))
153+
end
151154
if path:match('^/') then
152155
return path
153156
end

0 commit comments

Comments
 (0)