aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/Scintilla.h1
-rw-r--r--include/Scintilla.iface4
-rw-r--r--src/Editor.cxx7
3 files changed, 12 insertions, 0 deletions
diff --git a/include/Scintilla.h b/include/Scintilla.h
index c452d3f20..34c1f75b3 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -55,6 +55,7 @@ void Scintilla_RegisterClasses(HINSTANCE hInstance);
#define SCI_GETVIEWWS SCI_START + 20
#define SCI_SETVIEWWS SCI_START + 21
+#define SCI_POSITIONFROMPOINT SCI_START + 22
#define SCI_GOTOLINE SCI_START + 24
#define SCI_GOTOPOS SCI_START + 25
#define SCI_SETANCHOR SCI_START + 26
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index df63dd387..4d53f35b5 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -118,6 +118,10 @@ get int GetViewWS=2020(,)
# Make white space characters invisible, always visible or visible outside indentation.
set void SetViewWS=2021(int viewWS,)
+# Find the position and line from a point within the window.
+
+# Find the position from a point within the window.
+fun int PositionFromPoint=2022(,point pt)
# Set caret to start of a line and ensure it is visible.
fun void GotoLine=2024(int line,)
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 3f721d57e..cec634363 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -3476,6 +3476,13 @@ LRESULT Editor::WndProc(UINT iMessage, WPARAM wParam, LPARAM lParam) {
Redraw();
break;
+ case SCI_POSITIONFROMPOINT: {
+ if (lParam == 0)
+ return 0;
+ Point *ppt = reinterpret_cast<Point *>(lParam);
+ return PositionFromLocation(*ppt);
+ }
+
case SCI_GOTOLINE:
GoToLine(wParam);
break;