aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2010-03-26 06:31:57 +0000
committernyamatongwe <devnull@localhost>2010-03-26 06:31:57 +0000
commitc6de3de1530c4bd4067cd6533de4a3a8c4092a5c (patch)
tree9d553d3004fc4fc9de5aa2de943d11fbd35dfffc /src
parent9d3b3ebfd5cc7f84e4afe5dc9ecab9d44055eee8 (diff)
downloadscintilla-mirror-c6de3de1530c4bd4067cd6533de4a3a8c4092a5c.tar.gz
Added SCI_GETTAG.
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);