aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CellBuffer.cxx4
-rw-r--r--src/CellBuffer.h1
-rw-r--r--src/Document.h1
-rw-r--r--src/Editor.cxx3
-rw-r--r--src/SplitVector.h6
5 files changed, 15 insertions, 0 deletions
diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx
index 85bf43552..0e9ae6950 100644
--- a/src/CellBuffer.cxx
+++ b/src/CellBuffer.cxx
@@ -587,6 +587,10 @@ char CellBuffer::StyleAt(int position) {
return style.ValueAt(position);
}
+const char *CellBuffer::BufferPointer() {
+ return substance.BufferPointer();
+}
+
// The char* returned is to an allocation owned by the undo history
const char *CellBuffer::InsertString(int position, const char *s, int insertLength, bool &startSequence) {
char *data = 0;
diff --git a/src/CellBuffer.h b/src/CellBuffer.h
index 4f654a8fd..4b83f48e0 100644
--- a/src/CellBuffer.h
+++ b/src/CellBuffer.h
@@ -171,6 +171,7 @@ public:
char CharAt(int position) const;
void GetCharRange(char *buffer, int position, int lengthRetrieve);
char StyleAt(int position);
+ const char *BufferPointer();
int Length() const;
void Allocate(int newSize);
diff --git a/src/Document.h b/src/Document.h
index a36c4aafe..04bbd5c74 100644
--- a/src/Document.h
+++ b/src/Document.h
@@ -159,6 +159,7 @@ public:
void EndUndoAction() { cb.EndUndoAction(); }
void SetSavePoint();
bool IsSavePoint() { return cb.IsSavePoint(); }
+ const char *BufferPointer() { return cb.BufferPointer(); }
int GetLineIndentation(int line);
void SetLineIndentation(int line, int indent);
diff --git a/src/Editor.cxx b/src/Editor.cxx
index af60624ff..3b6e7a2c3 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -7579,6 +7579,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_GETPASTECONVERTENDINGS:
return convertPastes ? 1 : 0;
+ case SCI_GETCHARACTERPOINTER:
+ return reinterpret_cast<sptr_t>(pdoc->BufferPointer());
+
default:
return DefWndProc(iMessage, wParam, lParam);
}
diff --git a/src/SplitVector.h b/src/SplitVector.h
index 9d62aef72..76f9a8f36 100644
--- a/src/SplitVector.h
+++ b/src/SplitVector.h
@@ -238,6 +238,12 @@ public:
DeleteRange(0, lengthBody);
}
+ T* BufferPointer() {
+ RoomFor(1);
+ GapTo(lengthBody);
+ body[lengthBody] = 0;
+ return body;
+ }
};
#endif