diff options
author | Neil <nyamatongwe@gmail.com> | 2021-05-15 17:18:59 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-05-15 17:18:59 +1000 |
commit | 98e6b6ff51e05ae08e31c81954ff10dfb7191be5 (patch) | |
tree | e64b38e41d43bdfc37f69daeb600f7e7b0371e91 /src/Editor.cxx | |
parent | ad7f10a29853beb17663e72e6fd18e8977ebec42 (diff) | |
download | scintilla-mirror-98e6b6ff51e05ae08e31c81954ff10dfb7191be5.tar.gz |
Protect against out-of-bounds layout cache level and remove unnecessary code.
Make documentation more accurate.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
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: |