aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.h
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2022-11-22 09:24:07 +1100
committerNeil <nyamatongwe@gmail.com>2022-11-22 09:24:07 +1100
commitcb8cd73d839a96f98bb1ce887c694271f9c24788 (patch)
tree1920fae848da38e7942ea9a36c21f87272254e23 /src/Editor.h
parentb3e46461ce564d295b629a1d16dc4cee60722e66 (diff)
downloadscintilla-mirror-cb8cd73d839a96f98bb1ce887c694271f9c24788.tar.gz
Add SCI_REPLACETARGETMINIMAL to change text without causing unchanged prefix and
suffix to be marked as modified in change history.
Diffstat (limited to 'src/Editor.h')
-rw-r--r--src/Editor.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Editor.h b/src/Editor.h
index 128abf234..85d95e21d 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -581,7 +581,8 @@ protected: // ScintillaBase subclass needs access to much of Editor
void FoldAll(Scintilla::FoldAction action);
Sci::Position GetTag(char *tagValue, int tagNumber);
- Sci::Position ReplaceTarget(bool replacePatterns, const char *text, Sci::Position length=-1);
+ enum class ReplaceType {basic, patterns, minimal};
+ Sci::Position ReplaceTarget(ReplaceType replaceType, std::string_view text);
bool PositionIsHotspot(Sci::Position position) const noexcept;
bool PointIsHotspot(Point pt);
@@ -625,6 +626,12 @@ protected: // ScintillaBase subclass needs access to much of Editor
static unsigned char *UCharPtrFromSPtr(Scintilla::sptr_t lParam) noexcept {
return static_cast<unsigned char *>(PtrFromSPtr(lParam));
}
+ static std::string_view ViewFromParams(Scintilla::sptr_t lParam, Scintilla::uptr_t wParam) noexcept {
+ if (SPtrFromUPtr(wParam) == -1) {
+ return std::string_view(CharPtrFromSPtr(lParam));
+ }
+ return std::string_view(CharPtrFromSPtr(lParam), wParam);
+ }
static void *PtrFromUPtr(Scintilla::uptr_t wParam) noexcept {
return reinterpret_cast<void *>(wParam);
}