From cb8cd73d839a96f98bb1ce887c694271f9c24788 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 22 Nov 2022 09:24:07 +1100 Subject: Add SCI_REPLACETARGETMINIMAL to change text without causing unchanged prefix and suffix to be marked as modified in change history. --- doc/ScintillaDoc.html | 25 +++++++++++++++++++------ doc/ScintillaHistory.html | 4 ++++ 2 files changed, 23 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index cab6e397c..8fe205014 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -129,7 +129,7 @@

Scintilla Documentation

-

Last edited 26 October 2022 NH

+

Last edited 15 November 2022 NH

Scintilla 5 has moved the lexers from Scintilla into a new Lexilla project.
@@ -821,6 +821,7 @@ struct Sci_TextRangeFull { SCI_SEARCHINTARGET(position length, const char *text) → position
SCI_GETTARGETTEXT(<unused>, char *text) → position
SCI_REPLACETARGET(position length, const char *text) → position
+ SCI_REPLACETARGETMINIMAL(position length, const char *text) → position
SCI_REPLACETARGETRE(position length, const char *text) → position
SCI_GETTAG(int tagNumber, char *tagValue) → int
@@ -870,9 +871,21 @@ struct Sci_TextRangeFull {

SCI_REPLACETARGET(position length, const char *text) → position
If length is -1, text is a zero terminated string, otherwise length sets the number of character to replace the target with. - After replacement, the target range refers to the replacement text. - The return value - is the length of the replacement string.
+ After replacement, the target range refers to the replacement text. + The return value is the length of the replacement string.
+ Note that the recommended way to delete text in the document is to set the target to the text to be removed, + and to perform a replace target with an empty string.

+ +

SCI_REPLACETARGETMINIMAL(position length, const char *text) → position
+ This is similar to SCI_REPLACETARGET + but tries to minimize change history when the current target text shares a common prefix or suffix with the replacement. + Only the text that is actually different is marked as changed. + This might be used when automatically reformatting some text + so that the whole area formatted doesn't show change marks. + If length is -1, text is a zero terminated string, otherwise + length sets the number of character to replace the target with. + After replacement, the target range refers to the replacement text. + The return value is the length of the replacement string.
Note that the recommended way to delete text in the document is to set the target to the text to be removed, and to perform a replace target with an empty string.

@@ -882,8 +895,8 @@ struct Sci_TextRangeFull { characters to use. The replacement string is formed from the text string with any sequences of \1 through \9 replaced by tagged matches from the most recent regular expression search. \0 is replaced with all the matched text from the most recent search. - After replacement, the target range refers to the replacement text. - The return value is the length of the replacement string.

+ After replacement, the target range refers to the replacement text. + The return value is the length of the replacement string.

SCI_GETTAG(int tagNumber, char *tagValue NUL-terminated) → int
Discover what text was matched by tagged expressions in a regular expression search. diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 87303cb4f..d3787329c 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -585,6 +585,10 @@ Released 12 October 2022.

  • + Add SCI_REPLACETARGETMINIMAL to change text without causing unchanged prefix and suffix + to be marked as modified in change history. +
  • +
  • Draw background colour for EOL annotations with standard and boxed visuals.
  • -- cgit v1.2.3