aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx21
-rw-r--r--src/Editor.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index e5623b542..61d10bd6a 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -6377,6 +6377,24 @@ void Editor::EnsureLineVisible(int lineDoc, bool enforcePolicy) {
}
}
+int Editor::GetTag(char *tagValue, int tagNumber) {
+ char name[3] = "\\?";
+ const char *text = 0;
+ int length = 0;
+ if ((tagNumber >= 1) && (tagNumber <= 9)) {
+ name[1] = tagNumber + '0';
+ length = 2;
+ text = pdoc->SubstituteByPosition(name, &length);
+ }
+ if (tagValue) {
+ if (text)
+ memcpy(tagValue, text, length + 1);
+ else
+ *tagValue = '\0';
+ }
+ return length;
+}
+
int Editor::ReplaceTarget(bool replacePatterns, const char *text, int length) {
UndoGroup ug(pdoc);
if (length == -1)
@@ -6761,6 +6779,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_GETSEARCHFLAGS:
return searchFlags;
+ case SCI_GETTAG:
+ return GetTag(CharPtrFromSPtr(lParam), wParam);
+
case SCI_POSITIONBEFORE:
return pdoc->MovePositionOutsideChar(wParam - 1, -1, true);
diff --git a/src/Editor.h b/src/Editor.h
index 180db571a..4ffba827c 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -473,6 +473,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
void Expand(int &line, bool doExpand);
void ToggleContraction(int line);
void EnsureLineVisible(int lineDoc, bool enforcePolicy);
+ int GetTag(char *tagValue, int tagNumber);
int ReplaceTarget(bool replacePatterns, const char *text, int length=-1);
bool PositionIsHotspot(int position);