Merge pull request #106 from brttbndr/master

expand_path only if the match starts with ~
This commit is contained in:
Morantron 2023-10-23 13:45:27 +02:00 committed by GitHub
commit cb64f9b859
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -124,9 +124,14 @@ module Fingers
# This takes care of some path expansion weirdness when opening paths that start with ~ in MacOS
def expanded_match
return match unless action == ":open:"
return match unless should_expand_match?
Path[match].expand(base: original_pane.pane_current_path, home: Path.home)
end
private def should_expand_match?
action == ":open:" && match.starts_with?("~")
end
end
end