diff options
author | Zufu Liu <unknown> | 2021-06-04 20:27:18 +1000 |
---|---|---|
committer | Zufu Liu <unknown> | 2021-06-04 20:27:18 +1000 |
commit | 879f0c4c60bd3ba9c75a0f83495eebc7aee66860 (patch) | |
tree | 7aa7a1d1485a0ccd131c428d28400a1f4b2dabe0 /src/Editor.h | |
parent | b88a820dee352c68e1bf9616d54c1804bf8a15a0 (diff) | |
download | scintilla-mirror-879f0c4c60bd3ba9c75a0f83495eebc7aee66860.tar.gz |
Bug [#2260]. Fix bug with SCI_GETLASTCHILD when lParam is -1.
Fixed cast on SCI_FOLDCHILDREN to use correct type.
Diffstat (limited to 'src/Editor.h')
-rw-r--r-- | src/Editor.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Editor.h b/src/Editor.h index 08e7d134b..9af2add43 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -624,6 +624,13 @@ protected: // ScintillaBase subclass needs access to much of Editor return static_cast<const char *>(PtrFromUPtr(wParam)); } + constexpr std::optional<FoldLevel> OptionalFoldLevel(Scintilla::sptr_t lParam) { + if (lParam >= 0) { + return static_cast<FoldLevel>(lParam); + } + return std::nullopt; + } + static Scintilla::sptr_t StringResult(Scintilla::sptr_t lParam, const char *val) noexcept; static Scintilla::sptr_t BytesResult(Scintilla::sptr_t lParam, const unsigned char *val, size_t len) noexcept; |