summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2004-11-23 23:10:26 +0000
committerMatthias Melcher <fltk@matthiasm.com>2004-11-23 23:10:26 +0000
commit7aca1565649965855bda64b7a14dca4cfe29f982 (patch)
treec986420761044b7dae5f8c55f197730913a7704e
parentf26b5336a0d650b462149e566c148b54ab48205d (diff)
Fl_Text_Display would hang if the user pressed Ctrl-left with the cursor
in the first columna and line (pos 0) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3921 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES2
-rw-r--r--src/Fl_Text_Display.cxx5
2 files changed, 5 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 1d8251b35..1a96e094c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.6
+ - Fl_Text_Display::word_left would hang if cursor was
+ at pos 0
- Documentation updates (STR #552, STR #608)
- Added the 2.0 Fl_Widget::copy_label() method to
allow FLTK 1.x applications to have their label
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index d7c9447dd..58f644f9b 100644
--- a/src/Fl_Text_Display.cxx
+++ b/src/Fl_Text_Display.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Text_Display.cxx,v 1.12.2.58 2004/11/20 03:44:17 easysw Exp $"
+// "$Id: Fl_Text_Display.cxx,v 1.12.2.59 2004/11/23 23:10:26 matthiaswm Exp $"
//
// Copyright 2001-2004 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
@@ -1154,6 +1154,7 @@ void Fl_Text_Display::next_word() {
void Fl_Text_Display::previous_word() {
int pos = insert_position();
+ if (pos==0) return;
pos--;
while (pos && fl_isseparator(buffer()->character(pos))) {
pos--;
@@ -3148,5 +3149,5 @@ int Fl_Text_Display::handle(int event) {
//
-// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.58 2004/11/20 03:44:17 easysw Exp $".
+// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.59 2004/11/23 23:10:26 matthiaswm Exp $".
//