summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDavid Pugnasse <david.pugnasse@gmail.com>2011-10-25 02:15:53 +0200
committerDavid Pugnasse <david.pugnasse@gmail.com>2011-10-25 02:15:53 +0200
commit9ab9f65217df8dd75e171702bee2943ca295e956 (patch)
treee8ad067e88684068c40443b27fc09ca9f30f5843
parent8a2d5352480629aeb7a983ea4ddadf7005223907 (diff)
downloadranger-9ab9f65217df8dd75e171702bee2943ca295e956.tar.gz
core.main: fix --selectfile with relative paths
-rw-r--r--ranger/core/actions.py8
-rw-r--r--ranger/core/main.py1
2 files changed, 3 insertions, 6 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 3300a534..5364f391 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -344,12 +344,8 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 
 	def select_file(self, path):
 		path = path.strip()
-		dirname = os.path.dirname(path)
-		if dirname:
-			if self.enter_dir(dirname):
-				self.env.cwd.move_to_obj(path)
-		else:
-			self.env.cwd.move_to_obj(join(self.env.cwd.path, path))
+		if self.enter_dir(os.path.dirname(path)):
+			self.env.cwd.move_to_obj(path)
 
 	def history_go(self, relative):
 		"""Move back and forth in the history"""
diff --git a/ranger/core/main.py b/ranger/core/main.py
index 49513125..14e4b1f6 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -50,6 +50,7 @@ def main():
 	SettingsAware._setup(clean=arg.clean)
 
 	if arg.selectfile:
+		arg.selectfile = os.path.abspath(arg.selectfile)
 		arg.targets.insert(0, os.path.dirname(arg.selectfile))
 
 	targets = arg.targets or ['.']
ight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: package ranger.gui</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="ranger.html"><font color="#ffffff">ranger</font></a>.gui</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/hut/ranger/ranger/gui/__init__.py">/home/hut/ranger/ranger/gui/__init__.py</a></font></td></tr></table>
    <p></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="ranger.gui.bar.html">bar</a><br>
<a href="ranger.gui.color.html">color</a><br>
<a href="ranger.gui.colorscheme.html">colorscheme</a><br>
</td><td width="25%" valign=top><a href="ranger.gui.context.html">context</a><br>
<a href="ranger.gui.curses_shortcuts.html">curses_shortcuts</a><br>
<a href="ranger.gui.defaultui.html">defaultui</a><br>
</td><td width="25%" valign=top><a href="ranger.gui.displayable.html">displayable</a><br>
<a href="ranger.gui.mouse_event.html">mouse_event</a><br>
<a href="ranger.gui.ui.html">ui</a><br>
</td><td width="25%" valign=top><a href="ranger.gui.widgets.html"><strong>widgets</strong>&nbsp;(package)</a><br>
</td></tr></table></td></tr></table>
</body></html>