From 1da92e82c03b517c9c814fce343d86d382a90a0a Mon Sep 17 00:00:00 2001 From: Prakash Sahni Date: Fri, 12 Jun 2020 09:34:59 +1000 Subject: Bug [#2141]. Implement end of line annotations. --- doc/ScintillaDoc.html | 95 ++++++++++++++++++++++++++++++++++++++++++++++ doc/ScintillaHistory.html | 5 +++ doc/eolannotation.png | Bin 0 -> 21161 bytes 3 files changed, 100 insertions(+) create mode 100644 doc/eolannotation.png (limited to 'doc') diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 6ec941395..786b6f27f 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -457,6 +457,8 @@ ○ Building Scintilla + ○ End of Line Annotations + @@ -3725,6 +3727,99 @@ struct Sci_TextToFind { before SCI_ANNOTATIONSETSTYLEOFFSET and use the result as the argument to SCI_ANNOTATIONSETSTYLEOFFSET.

+

End of Line Annotations

+ +

End of Line Annotations are read-only lines of text at the end of each line of editable text. + End of Line Annotations can be used to display an assembler version of code for debugging or to show diagnostic messages inline or to + line up different versions of text in a merge tool.

+ +

End of Line Annotations used to display an assembler version of code for debugging

+

End of Line Annotations used to display an assembler version of code for debugging

+ + + SCI_EOLANNOTATIONSETTEXT(line line, const char *text)
+ SCI_EOLANNOTATIONGETTEXT(line line, char *text) → int
+ SCI_EOLANNOTATIONSETSTYLE(line line, int style)
+ SCI_EOLANNOTATIONGETSTYLE(line line) → int
+ SCI_EOLANNOTATIONCLEARALL
+ SCI_EOLANNOTATIONSETVISIBLE(int visible)
+ SCI_EOLANNOTATIONGETVISIBLE → int
+ SCI_EOLANNOTATIONSETSTYLEOFFSET(int style)
+ SCI_EOLANNOTATIONGETSTYLEOFFSET → int
+
+ +

+ SCI_EOLANNOTATIONSETTEXT(line line, const char *text)
+ SCI_EOLANNOTATIONGETTEXT(line line, char *text) → int
+ SCI_EOLANNOTATIONSETSTYLE(line line, int style)
+ SCI_EOLANNOTATIONGETSTYLE(line line) → int
+ SCI_EOLANNOTATIONCLEARALL
+ A different string may be set for each line with SCI_EOLANNOTATIONSETTEXT. + To clear end of line annotations call SCI_EOLANNOTATIONSETTEXT with a NULL pointer. + The whole of the text EOLANNOTATION on a line may be displayed in a particular style with + SCI_EOLANNOTATIONSETSTYLE or each character may be individually styled with + of the corresponding text byte similar to SCI_SETSTYLINGEX. The text must be set first as it + specifies how long the end of line annotation is so how many bytes of styling to read. + Setting an end of line annotation will cause a + SC_MOD_CHANGEEOLANNOTATION + notification to be sent. +

+

+ All the lines can be cleared of end of line annotations with SCI_EOLANNOTATIONCLEARALL + which is equivalent to clearing each line (setting to 0) and then deleting other memory used for this feature. +

+

+ Only some style attributes are active in end of line annotations: font, size/sizeFractional, bold/weight, italics, fore, back, and characterSet. +

+

+ SCI_EOLANNOTATIONSETVISIBLE(int visible)
+ SCI_EOLANNOTATIONGETVISIBLE → int
+ End of Line Annotations can be made visible in a view and there is a choice of display style when visible. + The two messages set and get the annotation display mode. The visible + argument can be one of:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EOLANNOTATION_HIDDEN0End of Line Annotations are not displayed.
EOLANNOTATION_STANDARD1End of Line Annotations are drawn left justified with no adornment.
EOLANNOTATION_BOXED2End of Line Annotations are indented to match the text and are surrounded by a box.
+ +

+ SCI_EOLANNOTATIONSETSTYLEOFFSET(int style)
+ SCI_EOLANNOTATIONGETSTYLEOFFSET → int
+ End of Line Annotation styles may be completely separated from standard text styles by setting a style offset. For example, + SCI_EOLANNOTATIONSETSTYLEOFFSET(512) would allow the end of line annotation styles to be numbered from + 512 up to 767 so they do not overlap styles set by lexers (or margins if margins offset is 256). + Each style number set with SCI_EOLANNOTATIONSETSTYLE + or SCI_EOLANNOTATIONSETSTYLES has the offset added before looking up the style. +

+

+ Always call SCI_ALLOCATEEXTENDEDSTYLES + before SCI_EOLANNOTATIONSETSTYLEOFFSET and use the result as the argument to SCI_EOLANNOTATIONSETSTYLEOFFSET. +

Other settings

SCI_SETBUFFEREDDRAW(bool buffered)
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index c6d5b0539..10e88fd2a 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -555,6 +555,7 @@ Shmuel Zeigerman Chris Graham Hugues Larrive + Prakash Sahni

@@ -574,6 +575,10 @@ Released 3 June 2020.

  • + End of line annotations implemented. + Bug #2141. +
  • +
  • The latex lexer supports lstlisting environment that is similar to verbatim. Feature #1358.
  • diff --git a/doc/eolannotation.png b/doc/eolannotation.png new file mode 100644 index 000000000..5dacbf569 Binary files /dev/null and b/doc/eolannotation.png differ -- cgit v1.2.3