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 | ac309ede33a5f5f8ccd1e322953c15c2551be50b (patch) | |
| tree | 61be2c4ed505c4e1e47e85d09c5718d9ff4fb94e /src | |
| parent | 229b48f2c385130502a82f1f7fc994d04060e616 (diff) | |
| download | scintilla-mirror-ac309ede33a5f5f8ccd1e322953c15c2551be50b.tar.gz | |
Feature [feature-requests:#1215]. Use std::clamp to shorten code.
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 e869886fe..8c57ca5b3 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -7260,12 +7260,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 = std::clamp(static_cast<int>(wParam), 0, 3);  		InvalidateStyleRedraw();  		break; | 
