diff options
author | Neil <nyamatongwe@gmail.com> | 2018-04-30 07:57:38 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-04-30 07:57:38 +1000 |
commit | bbf4be9b34bc774eb9fc723ad3ef197198849ba0 (patch) | |
tree | 3b5d91ef6e2977de67730f06ac5a111b64877044 /src | |
parent | 40bab3e66ee2630458ca3d5fab20a94351308849 (diff) | |
download | scintilla-mirror-bbf4be9b34bc774eb9fc723ad3ef197198849ba0.tar.gz |
Backport: Feature [feature-requests:#1215]. Use Sci::clamp to shorten code.
Backport of changeset 6760:e94cd333a5a9.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 9bf949a37..07c3c4087 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -7251,12 +7251,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return vs.caretStyle; case SCI_SETCARETWIDTH: - if (static_cast<int>(wParam) <= 0) - vs.caretWidth = 0; - else if (wParam >= 3) - vs.caretWidth = 3; - else - vs.caretWidth = static_cast<int>(wParam); + vs.caretWidth = Sci::clamp(static_cast<int>(wParam), 0, 3); InvalidateStyleRedraw(); break; |