summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-08-05 01:07:32 +0200
committerhut <hut@lavabit.com>2012-08-05 14:36:32 +0200
commit9fb987c29b60414588226eac24d307bfe8b7a938 (patch)
treef294ffda28a150927a82ad07740386036a22adab /ranger
parenta1be5fc881e1378d5133fa6244e9f72a3dfc5508 (diff)
downloadranger-9fb987c29b60414588226eac24d307bfe8b7a938.tar.gz
core.environment: s/fm.env.termsize/fm.ui.termsize
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py4
-rw-r--r--ranger/core/environment.py1
-rw-r--r--ranger/gui/displayable.py2
-rw-r--r--ranger/gui/ui.py5
4 files changed, 6 insertions, 6 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 0d76f2e8..31098738 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -546,7 +546,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 		cwd = self.env.cwd
 		direction = Direction(dirarg)
 		pos, selected = direction.select(lst=cwd.files, current=cwd.pointer,
-				pagesize=self.env.termsize[0])
+				pagesize=self.ui.termsize[0])
 		cwd.pointer = pos
 		cwd.correct_pointer()
 		for item in selected:
@@ -967,7 +967,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 				offset = 1
 			pos, selected = direction.select(
 					override=narg, lst=cwd.files, current=cwd.pointer,
-					pagesize=self.env.termsize[0], offset=offset)
+					pagesize=self.ui.termsize[0], offset=offset)
 			cwd.pointer = pos
 			cwd.correct_pointer()
 		if mode == 'set':
diff --git a/ranger/core/environment.py b/ranger/core/environment.py
index 171f716b..153e4f55 100644
--- a/ranger/core/environment.py
+++ b/ranger/core/environment.py
@@ -21,7 +21,6 @@ class Environment(SettingsAware, SignalDispatcher):
 	copy = None
 	cmd = None
 	cut = None
-	termsize = None
 	history = None
 	directories = None
 	last_search = None
diff --git a/ranger/gui/displayable.py b/ranger/gui/displayable.py
index 8888d8bf..a70dd2ff 100644
--- a/ranger/gui/displayable.py
+++ b/ranger/gui/displayable.py
@@ -142,7 +142,7 @@ class Displayable(EnvironmentAware, FileManagerAware, CursesShortcuts):
 		"""Resize the widget"""
 		do_move = True
 		try:
-			maxy, maxx = self.env.termsize
+			maxy, maxx = self.fm.ui.termsize
 		except TypeError:
 			pass
 		else:
diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py
index b0d3edc6..a0aa800f 100644
--- a/ranger/gui/ui.py
+++ b/ranger/gui/ui.py
@@ -57,6 +57,7 @@ class UI(DisplayableContainer):
 				os.environ['TERM'] = 'linux'
 				self.win = curses.initscr()
 		self.env.keymaps.use_keymap('browser')
+		self.termsize = self.win.getmaxyx()
 
 		DisplayableContainer.__init__(self, None)
 
@@ -259,8 +260,8 @@ class UI(DisplayableContainer):
 
 	def update_size(self):
 		"""resize all widgets"""
-		self.env.termsize = self.win.getmaxyx()
-		y, x = self.env.termsize
+		self.termsize = self.win.getmaxyx()
+		y, x = self.termsize
 
 		self.browser.resize(1, 0, y - 2, x)
 		self.taskview.resize(1, 0, y - 2, x)