aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/ScintillaDoc.html2
-rw-r--r--src/Editor.cxx4
-rw-r--r--src/PositionCache.cxx3
3 files changed, 5 insertions, 4 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index d28b8f859..e24a7a9ad 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -7450,7 +7450,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
<td align="center">1</td>
- <td>The line containing the text caret. This is the default.</td>
+ <td>One line is cached. This is the default.</td>
</tr>
<tr>
diff --git a/src/Editor.cxx b/src/Editor.cxx
index a2a2377ef..234e40700 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -6763,7 +6763,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
return vs.wrap.indentMode;
case SCI_SETLAYOUTCACHE:
- view.llc.SetLevel(static_cast<LineLayoutCache::Cache>(wParam));
+ if (wParam <= SC_CACHE_DOCUMENT) {
+ view.llc.SetLevel(static_cast<LineLayoutCache::Cache>(wParam));
+ }
break;
case SCI_GETLAYOUTCACHE:
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx
index c1e0a77bd..1839f2072 100644
--- a/src/PositionCache.cxx
+++ b/src/PositionCache.cxx
@@ -463,8 +463,7 @@ void LineLayoutCache::Invalidate(LineLayout::ValidLevel validity_) noexcept {
}
void LineLayoutCache::SetLevel(Cache level_) noexcept {
- allInvalidated = false;
- if ((static_cast<int>(level_) != -1) && (level != level_)) {
+ if (level != level_) {
level = level_;
allInvalidated = false;
cache.clear();