diff options
| author | Prakash Sahni <unknown> | 2020-06-12 09:34:59 +1000 | 
|---|---|---|
| committer | Prakash Sahni <unknown> | 2020-06-12 09:34:59 +1000 | 
| commit | 1da92e82c03b517c9c814fce343d86d382a90a0a (patch) | |
| tree | 6a25f06b19774f48cf73fdaac8e8e48fdcec2c54 /src/Editor.cxx | |
| parent | e1421b5feaff77e9a047a53a7859c577616fae2b (diff) | |
| download | scintilla-mirror-1da92e82c03b517c9c814fce343d86d382a90a0a.tar.gz | |
Bug [#2141]. Implement end of line annotations.
Diffstat (limited to 'src/Editor.cxx')
| -rw-r--r-- | src/Editor.cxx | 50 | 
1 files changed, 50 insertions, 0 deletions
| diff --git a/src/Editor.cxx b/src/Editor.cxx index 234a2aaa6..12688da66 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2126,6 +2126,7 @@ void Editor::ClearAll() {  		if (!pdoc->IsReadOnly()) {  			pcs->Clear();  			pdoc->AnnotationClearAll(); +			pdoc->EOLAnnotationClearAll();  			pdoc->MarginClearAll();  		}  	} @@ -2661,6 +2662,11 @@ void Editor::NotifyModified(Document *, DocModification mh, void *) {  				Redraw();  			}  		} +		if (mh.modificationType & SC_MOD_CHANGEEOLANNOTATION) { +			if (vs.eolAnnotationVisible) { +				Redraw(); +			} +		}  		CheckModificationForWrap(mh);  		if (mh.linesAdded != 0) {  			// Avoid scrolling of display if change before current display @@ -5303,6 +5309,13 @@ void Editor::SetAnnotationVisible(int visible) {  	}  } +void Editor::SetEOLAnnotationVisible(int visible) { +	if (vs.eolAnnotationVisible != visible) { +		vs.eolAnnotationVisible = visible; +		Redraw(); +	} +} +  /**   * Recursively expand a fold, making lines visible except where they have an unexpanded parent.   */ @@ -8069,6 +8082,43 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {  	case SCI_ANNOTATIONGETSTYLEOFFSET:  		return vs.annotationStyleOffset; +	case SCI_EOLANNOTATIONSETTEXT: +		pdoc->EOLAnnotationSetText(static_cast<Sci::Line>(wParam), CharPtrFromSPtr(lParam)); +		break; + +	case SCI_EOLANNOTATIONGETTEXT: { +			const StyledText st = pdoc->EOLAnnotationStyledText(static_cast<Sci::Line>(wParam)); +			return BytesResult(lParam, reinterpret_cast<const unsigned char *>(st.text), st.length); +		} + +	case SCI_EOLANNOTATIONGETSTYLE: { +			const StyledText st = pdoc->EOLAnnotationStyledText(static_cast<Sci::Line>(wParam)); +			return st.style; +		} + +	case SCI_EOLANNOTATIONSETSTYLE: +		pdoc->EOLAnnotationSetStyle(static_cast<Sci::Line>(wParam), static_cast<int>(lParam)); +		break; + +	case SCI_EOLANNOTATIONCLEARALL: +		pdoc->EOLAnnotationClearAll(); +		break; + +	case SCI_EOLANNOTATIONSETVISIBLE: +		SetEOLAnnotationVisible(static_cast<int>(wParam)); +		break; + +	case SCI_EOLANNOTATIONGETVISIBLE: +		return vs.eolAnnotationVisible; + +	case SCI_EOLANNOTATIONSETSTYLEOFFSET: +		vs.eolAnnotationStyleOffset = static_cast<int>(wParam); +		InvalidateStyleRedraw(); +		break; + +	case SCI_EOLANNOTATIONGETSTYLEOFFSET: +		return vs.eolAnnotationStyleOffset; +  	case SCI_RELEASEALLEXTENDEDSTYLES:  		vs.ReleaseAllExtendedStyles();  		break; | 
