From 2fd2dbb354c0d2f4f1c57e6ead9d17d7c2d29d3e Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Mon, 10 Feb 2003 10:47:37 +0000 Subject: [PATCH] Upgraded to cope with pygtk-1.99.15. git-svn-id: https://rox.svn.sourceforge.net/svnroot/rox/trunk/Edit@2410 66de3db3-b00d-0410-b41b-f4738ad19bea --- EditWindow.py | 5 ++++- Help/Changes | 4 ++++ buffer.py | 5 ++++- process.py | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/EditWindow.py b/EditWindow.py index 8b75a55..f3b6699 100644 --- a/EditWindow.py +++ b/EditWindow.py @@ -317,7 +317,10 @@ class EditWindow(g.Window, XDSLoader, Saveable): "Data is not valid %s. Please select the file's encoding." "Turn on 'ignore errors' to try and load it anyway." % encoding) - self.buffer.insert_at_cursor(data, -1) + try: + self.buffer.insert_at_cursor(data) + except TypeError: + self.buffer.insert_at_cursor(data, -1) return 1 def load_file(self, path): diff --git a/Help/Changes b/Help/Changes index a50878d..dce3592 100644 --- a/Help/Changes +++ b/Help/Changes @@ -4,6 +4,10 @@ Dnd loading: Loads to cursor, not indicated point. +10-Feb-2003 +~~~~~~~~~~~ +Upgraded to cope with pygtk-1.99.15. + 02-Feb-2003 ~~~~~~~~~~~ Fixed problem with wheel mouse scrolling (Stuart Langridge). diff --git a/buffer.py b/buffer.py index 51dc040..72fccf1 100644 --- a/buffer.py +++ b/buffer.py @@ -37,7 +37,10 @@ class Buffer(g.TextBuffer): self.delete(start, end) elif op[0] == INSERT: start = self.get_iter_at_offset(op[1]) - self.insert(start, op[2], -1) + try: + self.insert(start, op[2]) + except TypeError: + self.insert(start, op[2], -1) else: rox.alert('Unknown entry in undo buffer!\n' + `op`) diff --git a/process.py b/process.py index 37d0760..2982a9d 100644 --- a/process.py +++ b/process.py @@ -68,6 +68,6 @@ class Process(Minibuffer): if not line_start.forward_line(): break buffer.delete(start, end) - buffer.insert_at_cursor('\n'.join(replacements), -1) + buffer.insert_at_cursor('\n'.join(replacements)) self.window.set_minibuffer(None) -- 2.11.4.GIT