Skip to content

Commit

Permalink
cdable to ~ or ~/foo/bar now
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda committed Oct 9, 2013
1 parent 31296f4 commit 1ddb037
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rfd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def move_cursor(row = nil)

# Change the current directory.
def cd(dir, pushd: true)
target = File.expand_path(dir.is_a?(Rfd::Item) ? dir.path : dir.start_with?('/') ? dir : current_dir ? File.join(current_dir, dir) : dir)
target = File.expand_path(dir.is_a?(Rfd::Item) ? dir.path : dir.start_with?('/') || dir.start_with?('~') ? dir : current_dir ? File.join(current_dir, dir) : dir)
if File.readable? target
Dir.chdir target
(@dir_history ||= []) << current_dir if current_dir && pushd
Expand Down

0 comments on commit 1ddb037

Please sign in to comment.