aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/Scintilla.h5
-rw-r--r--include/Scintilla.iface7
-rw-r--r--src/Document.cxx2
-rw-r--r--src/Editor.cxx10
-rw-r--r--win32/ScintillaWin.cxx2
5 files changed, 18 insertions, 8 deletions
diff --git a/include/Scintilla.h b/include/Scintilla.h
index 8e52ba59e..d1cb759f7 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -349,8 +349,9 @@ extern "C" {
#define SCI_SETZOOM SCI_START + 373
#define SCI_GETZOOM SCI_START + 374
-#define SCI_ADDREFDOC SCI_START + 375
-#define SCI_RELEASEDOC SCI_START + 376
+#define SCI_CREATEDOCUMENT SCI_START + 375
+#define SCI_ADDREFDOCUMENT SCI_START + 376
+#define SCI_RELEASEDOCUMENT SCI_START + 377
// GTK+ Specific
#define SCI_GRABFOCUS SCI_START + 400
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 5187070c5..acbad39df 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -704,10 +704,13 @@ set void SetZoom=2373(int zoom,)
# Retrieve the zoom level.
get int GetZoom=2374(,)
+# Create a new document object.
+# Starts with reference count of 1 and not selected into editor.
+fun int CreateDocument=2375(,)
# Extend life of document.
-fun void AddRefDoc=2375(, int doc)
+fun void AddRefDocument=2376(, int doc)
# Release a reference to the document, deleting document if it fades to black.
-fun void ReleaseDoc=2376(, int doc)
+fun void ReleaseDocument=2377(, int doc)
# Set the focus to this Scintilla widget.
fun void GrabFocus=2400(,)
diff --git a/src/Document.cxx b/src/Document.cxx
index de06756a5..0f71231b6 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -54,7 +54,7 @@ int Document::AddRef() {
return refCount++;
}
-// Decrease reference count and return its provius value.
+// Decrease reference count and return its previous value.
// Delete the document if reference count reaches zero.
int Document::Release() {
int curRefCount = --refCount;
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 25ccf97cd..f753e35ce 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -3893,11 +3893,17 @@ LRESULT Editor::WndProc(UINT iMessage, WPARAM wParam, LPARAM lParam) {
SetDocPointer(reinterpret_cast<Document *>(lParam));
return 0;
- case SCI_ADDREFDOC:
+ case SCI_CREATEDOCUMENT: {
+ Document *doc = new Document();
+ doc->AddRef();
+ return reinterpret_cast<LRESULT>(doc);
+ }
+
+ case SCI_ADDREFDOCUMENT:
(reinterpret_cast<Document *>(lParam))->AddRef();
break;
- case SCI_RELEASEDOC:
+ case SCI_RELEASEDOCUMENT:
(reinterpret_cast<Document *>(lParam))->Release();
break;
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index 6b5e2cad4..829b973fa 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -324,7 +324,7 @@ LRESULT ScintillaWin::WndProc(UINT iMessage, WPARAM wParam, LPARAM lParam) {
break;
case WM_SIZE: {
- //Platform::DebugPrintf("S start wnd proc %d %d %d\n",iMessage, wParam, lParam);
+ //Platform::DebugPrintf("Scintilla WM_SIZE %d %d\n", LoWord(lParam), HiWord(lParam));
PRectangle rsClient(0, 0, LoWord(lParam), HiWord(lParam));
SetScrollBarsTo(rsClient);
DropGraphics();