aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2005-03-20 01:37:22 +0000
committernyamatongwe <unknown>2005-03-20 01:37:22 +0000
commit0eeee7531d739c2fc06e54eb56d27f361ece0503 (patch)
tree8395a920bd832f73b878b22182452e5fc86f45c0 /src
parent6007ca5bf84031f6e353d05907f195ef448769ca (diff)
downloadscintilla-mirror-0eeee7531d739c2fc06e54eb56d27f361ece0503.tar.gz
Patch from nissl in RFE 1164540 adds WrapCount method.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx15
-rw-r--r--src/Editor.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 9211335df..5eb384bb2 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -5572,6 +5572,18 @@ int Editor::CodePage() const {
return 0;
}
+int Editor::WrapCount(int line) {
+ AutoSurface surface(this);
+ AutoLineLayout ll(llc, RetrieveLineLayout(line));
+
+ if (surface && ll) {
+ LayoutLine(line, surface, vs, ll, wrapWidth);
+ return ll->lines;
+ } else {
+ return 1;
+ }
+}
+
static bool ValidMargin(unsigned long wParam) {
return wParam < ViewStyle::margins;
}
@@ -6642,6 +6654,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_DOCLINEFROMVISIBLE:
return cs.DocFromDisplay(wParam);
+ case SCI_WRAPCOUNT:
+ return WrapCount(wParam);
+
case SCI_SETFOLDLEVEL: {
int prev = pdoc->SetLevel(wParam, lParam);
if (prev != lParam)
diff --git a/src/Editor.h b/src/Editor.h
index bace500bd..76e79e7e7 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -516,6 +516,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
void GetHotSpotRange(int& hsStart, int& hsEnd);
int CodePage() const;
+ int WrapCount(int line);
virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0;