diff options
-rw-r--r-- | doc/ScintillaDoc.html | 10 | ||||
-rw-r--r-- | include/Scintilla.h | 2 | ||||
-rw-r--r-- | include/Scintilla.iface | 4 | ||||
-rw-r--r-- | include/ScintillaMessages.h | 2 | ||||
-rw-r--r-- | src/Editor.cxx | 2 | ||||
-rw-r--r-- | test/simpleTests.py | 4 |
6 files changed, 13 insertions, 11 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 01ec3e3ad..300ae0208 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -128,7 +128,7 @@ <h1>Scintilla Documentation</h1> - <p>Last edited 28 May 2021 NH</p> + <p>Last edited 10 June 2021 NH</p> <p style="background:#90F0C0">Scintilla 5 has moved the lexers from Scintilla into a new <a href="Lexilla.html">Lexilla</a> project.<br /> @@ -1107,7 +1107,7 @@ struct Sci_TextToFind { <a class="message" href="#SCI_COPYALLOWLINE">SCI_COPYALLOWLINE</a><br /> <a class="message" href="#SCI_SETPASTECONVERTENDINGS">SCI_SETPASTECONVERTENDINGS(bool convert)</a><br /> <a class="message" href="#SCI_GETPASTECONVERTENDINGS">SCI_GETPASTECONVERTENDINGS → bool</a><br /> - <a class="message" href="#SCI_PASTERECTANGULAR">SCI_PASTERECTANGULAR(position length, const char *text)</a><br /> + <a class="message" href="#SCI_REPLACERECTANGULAR">SCI_REPLACERECTANGULAR(position length, const char *text)</a><br /> </code> <p><b id="SCI_CUT">SCI_CUT</b><br /> @@ -1148,8 +1148,10 @@ struct Sci_TextToFind { <a class="seealso" href="#SCI_SETEOLMODE">SCI_SETEOLMODE</a>. Defaults to true.</p> - <p><b id="SCI_PASTERECTANGULAR">SCI_PASTERECTANGULAR(position length, const char *text)</b><br/> - Pastes the given text into the existing rectangular or empty selection, overwriting any selected text.</p> + <p><b id="SCI_REPLACERECTANGULAR">SCI_REPLACERECTANGULAR(position length, const char *text)</b><br/> + Replaces the selected text or empty selection with the given text. + The insertion is performed similarly to rectangular pastes: new lines in the given text are interpreted as + moving to the next line without inserting new lines unless at the end of the document.</p> <h2 id="ErrorHandling">Error handling</h2> diff --git a/include/Scintilla.h b/include/Scintilla.h index c74332dc3..de96d81d8 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -885,7 +885,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_TOGGLECARETSTICKY 2459 #define SCI_SETPASTECONVERTENDINGS 2467 #define SCI_GETPASTECONVERTENDINGS 2468 -#define SCI_PASTERECTANGULAR 2771 +#define SCI_REPLACERECTANGULAR 2771 #define SCI_SELECTIONDUPLICATE 2469 #define SCI_SETCARETLINEBACKALPHA 2470 #define SCI_GETCARETLINEBACKALPHA 2471 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index d8e8fc21a..4cb76e3b3 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -2439,8 +2439,8 @@ set void SetPasteConvertEndings=2467(bool convert,) # Get convert-on-paste setting get bool GetPasteConvertEndings=2468(,) -# Paste into a rectangular selection. -fun void PasteRectangular=2771(position length, string text) +# Replace the selection with text like a rectangular paste. +fun void ReplaceRectangular=2771(position length, string text) # Duplicate the selection. If selection empty duplicate the line containing the caret. fun void SelectionDuplicate=2469(,) diff --git a/include/ScintillaMessages.h b/include/ScintillaMessages.h index b5792d809..861981574 100644 --- a/include/ScintillaMessages.h +++ b/include/ScintillaMessages.h @@ -581,7 +581,7 @@ enum class Message { ToggleCaretSticky = 2459, SetPasteConvertEndings = 2467, GetPasteConvertEndings = 2468, - PasteRectangular = 2771, + ReplaceRectangular = 2771, SelectionDuplicate = 2469, SetCaretLineBackAlpha = 2470, GetCaretLineBackAlpha = 2471, diff --git a/src/Editor.cxx b/src/Editor.cxx index da22161c6..71aaeae53 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -5940,7 +5940,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { EnsureCaretVisible(); break; - case Message::PasteRectangular: { + case Message::ReplaceRectangular: { UndoGroup ug(pdoc); if (!sel.Empty()) { ClearSelection(); // want to replace rectangular selection contents diff --git a/test/simpleTests.py b/test/simpleTests.py index 82ed84810..2d8b25e68 100644 --- a/test/simpleTests.py +++ b/test/simpleTests.py @@ -535,10 +535,10 @@ class TestSimple(unittest.TestCase): self.ed.Clear() self.assertEquals(self.ed.Contents(), b"1c") - def testPasteRectangular(self): + def testReplaceRectangular(self): self.ed.AddText(5, b"a\nb\nc") self.ed.SetSel(0,0) - self.ed.PasteRectangular(3, b"1\n2") + self.ed.ReplaceRectangular(3, b"1\n2") self.assertEquals(self.ed.Contents(), b"1a\n2b\nc") def testCopyAllowLine(self): |