summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/helper.py3
-rw-r--r--ranger/gui/widgets/pager.py16
-rw-r--r--ranger/help/console.py6
3 files changed, 15 insertions, 10 deletions
diff --git a/ranger/core/helper.py b/ranger/core/helper.py
index cb0afefe..ad5541f5 100644
--- a/ranger/core/helper.py
+++ b/ranger/core/helper.py
@@ -15,6 +15,7 @@
 
 """Helper functions"""
 
+from errno import EEXIST
 import os.path
 import sys
 from ranger import *
@@ -150,7 +151,7 @@ def allow_access_to_confdir(confdir, allow):
 		try:
 			os.makedirs(confdir)
 		except OSError as err:
-			if err.errno != 17:  # 17 means it already exists
+			if err.errno != EEXIST:  # EEXIST means it already exists
 				print("This configuration directory could not be created:")
 				print(confdir)
 				print("To run ranger without the need for configuration")
diff --git a/ranger/gui/widgets/pager.py b/ranger/gui/widgets/pager.py
index 05485189..d1bf5918 100644
--- a/ranger/gui/widgets/pager.py
+++ b/ranger/gui/widgets/pager.py
@@ -111,12 +111,16 @@ class Pager(Widget):
 			if TITLE_REGEXP.match(line):
 				self.color_at(i, 0, -1, 'title', *baseclr)
 		elif self.markup == 'ansi':
-			self.win.move(i, 0)
-			for chunk in ansi.text_with_fg_bg_attr(line):
-				if isinstance(chunk, tuple):
-					self.set_fg_bg_attr(*chunk)
-				else:
-					self.addstr(chunk)
+			try:
+				self.win.move(i, 0)
+			except:
+				pass
+			else:
+				for chunk in ansi.text_with_fg_bg_attr(line):
+					if isinstance(chunk, tuple):
+						self.set_fg_bg_attr(*chunk)
+					else:
+						self.addstr(chunk)
 
 	def move(self, narg=None, **kw):
 		direction = Direction(kw)
diff --git a/ranger/help/console.py b/ranger/help/console.py
index 716740b9..2f3a75c8 100644
--- a/ranger/help/console.py
+++ b/ranger/help/console.py
@@ -133,13 +133,13 @@ are in different directories:
 ==============================================================================
 3.4. The more complicated Commands in Detail
 
-3.3.1. "find"
+3.4.1. "find"
 The find command is different than others: it doesn't require you to
 press <RETURN>.  To speed things up, it tries to guess when you're
 done typing and executes the command right away.
 The key "f" opens the console with ":find "
 
-3.3.2. "shell"
+3.4.2. "shell"
 The shell command accepts flags |25?| as the first argument. This example
 will use the "p"-flag, which pipes the output to the pager:
 	:shell -p cat somefile.txt
@@ -149,7 +149,7 @@ There are some shortcuts which open the console with the shell command:
 	"@" opens ":shell  %s"
 	"#" opens ":shell -p "
 
-3.3.3. "open_with"
+3.4.3. "open_with"
 The open_with command is explained in detail in chapter 2.2. |22?|
 
 ==============================================================================