summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-12-25 18:25:18 +0100
committerhut <hut@lavabit.com>2009-12-25 18:25:18 +0100
commit4e01caf19cfbc798862e6b8b2dbd77328c8f99a2 (patch)
treeb0cc500dda15fc7ecd8451d164e503d382ca1fe7
parent5599636da56d7948c1918778f771217778d4129e (diff)
downloadranger-4e01caf19cfbc798862e6b8b2dbd77328c8f99a2.tar.gz
bugfixes
-rw-r--r--ranger/actions.py6
-rw-r--r--ranger/defaults/keys.py6
-rw-r--r--ranger/gui/widgets/filelist.py8
-rw-r--r--ranger/gui/widgets/process_manager.py3
-rw-r--r--ranger/gui/widgets/titlebar.py5
5 files changed, 18 insertions, 10 deletions
diff --git a/ranger/actions.py b/ranger/actions.py
index ebd5ac02..a43d366f 100644
--- a/ranger/actions.py
+++ b/ranger/actions.py
@@ -132,9 +132,9 @@ class Actions(EnvironmentAware, SettingsAware):
 			factor = len(self.env.pwd) / 100.0
 		except:
 			return
-		self.env.cf = self.env.pwd.move( \
-				relative=int(relative * factor), \
-				absolute=int(absolute * factor) )
+		self.env.pwd.move(
+				relative=int(relative * factor),
+				absolute=int(absolute * factor))
 
 	def scroll(self, relative):
 		"""Scroll down by <relative> lines"""
diff --git a/ranger/defaults/keys.py b/ranger/defaults/keys.py
index 8f74756b..683214f7 100644
--- a/ranger/defaults/keys.py
+++ b/ranger/defaults/keys.py
@@ -197,7 +197,7 @@ def initialize_process_manager_commands(command_list):
 		return lambda widget, n: getattr(widget, method)(*args, **kw)
 
 	def do_fm(method, *args, **kw):
-		return lambda widget, n: getattr(con.fm, method)(*args, **kw)
+		return lambda widget, n: getattr(widget.fm, method)(*args, **kw)
 
 	bind('j', KEY_DOWN, wdg.move(relative=1))
 	bind('k', KEY_UP, wdg.move(relative=-1))
@@ -207,6 +207,8 @@ def initialize_process_manager_commands(command_list):
 	bind('J', lambda wdg, n: wdg.process_move(-1))
 
 	bind('dd', do('process_remove'))
-	bind('w', ESC, ctrl('d'), lambda wdg, n: wdg.fm.ui.close_pman())
+	bind('w', ESC, ctrl('d'), ctrl('c'),
+			lambda wdg, n: wdg.fm.ui.close_pman())
+	bind(KEY_RESIZE, do_fm('resize'))
 
 	command_list.rebuild_paths()
diff --git a/ranger/gui/widgets/filelist.py b/ranger/gui/widgets/filelist.py
index 4973ae4f..457c9856 100644
--- a/ranger/gui/widgets/filelist.py
+++ b/ranger/gui/widgets/filelist.py
@@ -30,7 +30,7 @@ class FileList(Widget):
 					self.fm.enter_dir(self.target.path)
 
 				if index < len(self.target):
-					self.fm.move(absolute = index)
+					self.fm.move_pointer(absolute = index)
 			elif event.pressed(3):
 				try:
 					clicked_file = self.target[index]
@@ -191,8 +191,10 @@ class FileList(Widget):
 
 			string = drawed.basename
 			if self.main_display:
-				self.win.addnstr(
-						self.y + line, self.x + 1, drawed.basename, self.wid - 2)
+				if self.wid > 2:
+					self.win.addnstr(
+							self.y + line, self.x + 1,
+							drawed.basename, self.wid - 2)
 			else:
 				self.win.addnstr(
 						self.y + line, self.x, drawed.basename, self.wid)
diff --git a/ranger/gui/widgets/process_manager.py b/ranger/gui/widgets/process_manager.py
index a9c44640..138c70c1 100644
--- a/ranger/gui/widgets/process_manager.py
+++ b/ranger/gui/widgets/process_manager.py
@@ -45,6 +45,9 @@ class ProcessManager(Widget, Accumulator):
 		if not self.pointer_is_synced():
 			self.sync_index()
 
+		if self.hei <= 0:
+			return
+
 		self.win.addnstr(self.y, self.x, "Process Manager", self.wid)
 		self.color_at(self.y, self.x, self.wid, base_clr, 'title')
 
diff --git a/ranger/gui/widgets/titlebar.py b/ranger/gui/widgets/titlebar.py
index 2004163e..9e370b72 100644
--- a/ranger/gui/widgets/titlebar.py
+++ b/ranger/gui/widgets/titlebar.py
@@ -20,8 +20,9 @@ class TitleBar(Widget):
 			self.old_cf = self.env.cf
 			self._calc_bar()
 		self._print_result(self.result)
-		self.color('in_titlebar', 'throbber')
-		self.win.addnstr(self.y, self.wid - 2, self.throbber, 1)
+		if self.wid > 2:
+			self.color('in_titlebar', 'throbber')
+			self.win.addnstr(self.y, self.wid - 2, self.throbber, 1)
 
 	def _calc_bar(self):
 		bar = Bar()