From 7beb54f1a15bac443b0bac88440a3ceda88c2fc0 Mon Sep 17 00:00:00 2001 From: jstenar <> Date: Tue, 29 May 2007 18:04:51 +0000 Subject: [PATCH] pyreadline: fix bug in copy_selection_to_clipboard. Didn't work when selection started at beginning of line. --- doc/ChangeLog | 4 ++++ pyreadline/lineeditor/lineobj.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8da7488..7306b39 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2007-05-24 Jörgen Stenarson + * Fixing bug in copy_selection_to_clipboard. Didn't work + when selection started at beginning of line + 2007-05-24 Jörgen Stenarson * Additions to manual diff --git a/pyreadline/lineeditor/lineobj.py b/pyreadline/lineeditor/lineobj.py index 3969e39..fdbcd4d 100644 --- a/pyreadline/lineeditor/lineobj.py +++ b/pyreadline/lineeditor/lineobj.py @@ -717,7 +717,7 @@ class ReadLineTextBuffer(TextLine): def copy_selection_to_clipboard(self): # () '''Copy the text in the region to the windows clipboard.''' - if self.enable_win32_clipboard and self.enable_selection and self.selection_mark>0: + if self.enable_win32_clipboard and self.enable_selection and self.selection_mark>=0: selection_mark=min(self.selection_mark,len(self.line_buffer)) cursor=min(self.point,len(self.line_buffer)) if self.selection_mark==-1: