|
|
Author: matt
Date: 2005-08-17 08:07:34 -0400 (Wed, 17 Aug 2005)
New Revision: 4523
Modified:
branches/branch-1.1/CHANGES
branches/branch-1.1/src/Fl_Input_.cxx
Log:
Fixed redraw range in Multiline Input with wordwrapping for space characters and for undo.
Modified: branches/branch-1.1/CHANGES
===================================================================
--- branches/branch-1.1/CHANGES 2005-08-17 11:33:12 UTC (rev 4522)
+++ branches/branch-1.1/CHANGES 2005-08-17 12:07:34 UTC (rev 4523)
@@ -3,6 +3,8 @@
- Documentation fixes (STR #571, STR #648, STR #692, STR
#730, STR #744, STR #745, STR #931, STR #942, STR #960,
STR #969)
+ - Multiline Input will update right if a space character is
+ inserted in word wrap mode (STR #981)
- FLUID group labels redraw correctly (STR #959)
- FLUID now updates color of Fl_Tabs children (STR #979)
- FLUID now supports 'size_range()' (STR #851)
Modified: branches/branch-1.1/src/Fl_Input_.cxx
===================================================================
--- branches/branch-1.1/src/Fl_Input_.cxx 2005-08-17 11:33:12 UTC (rev 4522)
+++ branches/branch-1.1/src/Fl_Input_.cxx 2005-08-17 12:07:34 UTC (rev 4523)
@@ -592,8 +592,15 @@
// right after the whitespace before the current word. This will
// result in sub-optimal update when such wrapping does not happen
// but it is too hard to figure out for now...
- if (wrap())
- while (b > 0 && !isspace(index(b) & 255)) b--;
+ if (wrap()) {
+ // if there is a space in the pasted text, the whole line may have rewrapped
+ for (int i=0; i<ilen; i++)
+ if (text[i]==' ') break;
+ if (i==ilen)
+ while (b > 0 && !isspace(index(b) & 255) && index(b)!='\n') b--;
+ else
+ while (b > 0 && index(b)!='\n') b--;
+ }
// make sure we redraw the old selection or cursor:
if (mark_ < b) b = mark_;
@@ -640,6 +647,8 @@
mark_ = b /* -ilen */;
position_ = b;
+ if (wrap())
+ while (b1 > 0 && index(b1)!='\n') b1--;
minimal_update(b1);
set_changed();
if (when()&FL_WHEN_CHANGED) do_callback();
[ Direct Link to Message ] | |
|
| |