From 0a153e2eb3329b9fab4645bff7b492e21a4eff7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Fri, 9 Dec 2005 01:34:32 +0000 Subject: [PATCH] added sci_get_current_line() git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@37 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- src/sciwrappers.c | 12 ++++++++++++ src/sciwrappers.h | 1 + 2 files changed, 13 insertions(+) diff --git a/src/sciwrappers.c b/src/sciwrappers.c index 4f4c156e..09b2c2d2 100644 --- a/src/sciwrappers.c +++ b/src/sciwrappers.c @@ -808,3 +808,15 @@ void sci_cmd(ScintillaObject * sci, gint cmd) { SSM(sci, cmd, 0, 0); } + +gint sci_get_current_line(ScintillaObject *sci, gint pos) +{ + if (pos >= 0) + { + return SSM(sci, SCI_LINEFROMPOSITION, pos, 0); + } + else + { + return SSM(sci, SCI_LINEFROMPOSITION, SSM(sci, SCI_GETCURRENTPOS, 0, 0), 0); + } +} diff --git a/src/sciwrappers.h b/src/sciwrappers.h index 9b12cf04..0d9c88ce 100644 --- a/src/sciwrappers.h +++ b/src/sciwrappers.h @@ -156,3 +156,4 @@ void sci_set_readonly (ScintillaObject * sci, gboolean readonly); gboolean sci_get_readonly (ScintillaObject * sci); gint sci_get_zoom (ScintillaObject * sci); void sci_cmd (ScintillaObject * sci, gint cmd); +gint sci_get_current_line (ScintillaObject * sci, gint pos);