diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-12-08 20:46:33 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-12-08 20:46:33 +0000 |
| commit | ef96c53019228c616e8ba6d99f8a45dfeff9918e (patch) | |
| tree | 4f9b9b7412c4c8d755662180e5c1d27c45a2da98 /src/Fl_Text_Display.cxx | |
| parent | 64f2cc0635008f63a97601035618c40c75482b6a (diff) | |
Fix infinite loop problem in Fl_Text_Editor - was resizing before we
updated the number of lines in the buffer.
Carl, please make sure this fix gets added to 2.0 CVS, if necessary.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1824 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Text_Display.cxx')
| -rw-r--r-- | src/Fl_Text_Display.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index f6fbf8cd2..2bb26c5e5 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.6 2001/12/07 16:27:54 easysw Exp $" +// "$Id: Fl_Text_Display.cxx,v 1.12.2.7 2001/12/08 20:46:33 easysw Exp $" // // Copyright Mark Edel. Permission to distribute under the LGPL for // the FLTK library granted by Mark Edel. @@ -760,9 +760,6 @@ void Fl_Text_Display::buffer_modified_cb( int pos, int nInserted, int nDeleted, Fl_Text_Buffer *buf = textD->mBuffer; int scrolled, origCursorPos = textD->mCursorPos; - // refigure scrollbars & stuff - textD->resize(textD->x(), textD->y(), textD->w(), textD->h()); - /* buffer modification cancels vertical cursor motion column */ if ( nInserted != 0 || nDeleted != 0 ) textD->mCursorPreferredCol = -1; @@ -793,6 +790,9 @@ void Fl_Text_Display::buffer_modified_cb( int pos, int nInserted, int nDeleted, textD->mCursorPos += nInserted - nDeleted; } + // refigure scrollbars & stuff + textD->resize(textD->x(), textD->y(), textD->w(), textD->h()); + // don't need to do anything else if not visible? if (!textD->visible_r()) return; @@ -1649,6 +1649,7 @@ int Fl_Text_Display::measure_vline( int visLineNum ) { int charCount = 0, lineStartPos = mLineStarts[ visLineNum ]; char expandedChar[ FL_TEXT_MAX_EXP_CHAR_LEN ]; + if (lineStartPos < 0) return 0; if ( mStyleBuffer == NULL ) { for ( i = 0; i < lineLen; i++ ) { len = mBuffer->expand_character( lineStartPos + i, @@ -1955,5 +1956,5 @@ int Fl_Text_Display::handle(int event) { // -// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.6 2001/12/07 16:27:54 easysw Exp $". +// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.7 2001/12/08 20:46:33 easysw Exp $". // |
