aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2010-03-06 09:50:03 +0000
committernyamatongwe <devnull@localhost>2010-03-06 09:50:03 +0000
commit61a88fe139b0f8ea258612856f2c7261eac750b4 (patch)
treea22bbbeb3e4d770f856c9a963eec5e120dbdcebb /src
parent0d5897c3cd5c7ae8aea8a054a1886fbb0f253a6a (diff)
downloadscintilla-mirror-61a88fe139b0f8ea258612856f2c7261eac750b4.tar.gz
Optimized setting wrap attributes by only calling ReconfigureScrollBars if
the attribute has changed value since ReconfigureScrollBars is unexpectedly slow on GTK+.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index d25099c1a..7afd3e563 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -7142,9 +7142,11 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
return wrapState;
case SCI_SETWRAPVISUALFLAGS:
- wrapVisualFlags = wParam;
- InvalidateStyleRedraw();
- ReconfigureScrollBars();
+ if (wrapVisualFlags != static_cast<int>(wParam)) {
+ wrapVisualFlags = wParam;
+ InvalidateStyleRedraw();
+ ReconfigureScrollBars();
+ }
break;
case SCI_GETWRAPVISUALFLAGS:
@@ -7159,18 +7161,22 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
return wrapVisualFlagsLocation;
case SCI_SETWRAPSTARTINDENT:
- wrapVisualStartIndent = wParam;
- InvalidateStyleRedraw();
- ReconfigureScrollBars();
+ if (wrapVisualStartIndent != static_cast<int>(wParam)) {
+ wrapVisualStartIndent = wParam;
+ InvalidateStyleRedraw();
+ ReconfigureScrollBars();
+ }
break;
case SCI_GETWRAPSTARTINDENT:
return wrapVisualStartIndent;
case SCI_SETWRAPINDENTMODE:
- wrapIndentMode = wParam;
- InvalidateStyleRedraw();
- ReconfigureScrollBars();
+ if (wrapIndentMode != static_cast<int>(wParam)) {
+ wrapIndentMode = wParam;
+ InvalidateStyleRedraw();
+ ReconfigureScrollBars();
+ }
break;
case SCI_GETWRAPINDENTMODE: