Make sci_goto_line_scroll work better with line wrapping and folding
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@534 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
58efd38deb
commit
7c3ff94fc7
@ -1,3 +1,9 @@
|
||||
2006-07-05 Nick Treleaven <nick.treleaven@btinternet.com>
|
||||
|
||||
* src/sciwrappers.c: Make sci_goto_line_scroll work better with
|
||||
line wrapping and folding.
|
||||
|
||||
|
||||
2006-07-03 Nick Treleaven <nick.treleaven@btinternet.com>
|
||||
|
||||
* src/utils.c, src/dialogs.c:
|
||||
|
@ -512,9 +512,9 @@ gboolean sci_get_line_is_visible(ScintillaObject* sci, gint line)
|
||||
}
|
||||
|
||||
|
||||
void sci_ensure_line_is_visible( ScintillaObject* sci, gint line)
|
||||
void sci_ensure_line_is_visible(ScintillaObject* sci, gint line)
|
||||
{
|
||||
SSM(sci,SCI_ENSUREVISIBLE,line,0);
|
||||
SSM(sci,SCI_ENSUREVISIBLE,line,0);
|
||||
}
|
||||
|
||||
|
||||
@ -671,12 +671,16 @@ void sci_goto_line(ScintillaObject *sci, gint line, gboolean ensure_visibility)
|
||||
|
||||
void sci_goto_line_scroll(ScintillaObject *sci, gint line, gdouble percent_of_view)
|
||||
{
|
||||
gint vis1, los;
|
||||
SSM(sci, SCI_GOTOLINE, line, 0);
|
||||
gint vis1, los, delta;
|
||||
|
||||
sci_goto_line(sci, line, TRUE);
|
||||
// sci 'visible line' != file line number
|
||||
vis1 = SSM(sci, SCI_GETFIRSTVISIBLELINE, 0, 0);
|
||||
vis1 = SSM(sci, SCI_DOCLINEFROMVISIBLE, vis1, 0);
|
||||
los = SSM(sci, SCI_LINESONSCREEN, 0, 0);
|
||||
sci_scroll_lines(sci, (line - los * percent_of_view) - vis1);
|
||||
delta = (line - vis1) - los * percent_of_view;
|
||||
sci_scroll_lines(sci, delta);
|
||||
sci_scroll_caret(sci); //ensure visible, in case of excessive folding/wrapping
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user