aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-16 23:44:10 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-16 23:44:10 +0100
commita07db0b055b4289e6480b9f45072858c97d4969a (patch)
treea0269fcb071977f4d665f8f0763de0fc52cd17a6
parent8f3e18e12c8e85ad635dc765020327477668a131 (diff)
downloadsciteco-a07db0b055b4289e6480b9f45072858c97d4969a.tar.gz
scroll caret into view after text insertion
-rw-r--r--parser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/parser.cpp b/parser.cpp
index 7e4da4a..ea3a9a9 100644
--- a/parser.cpp
+++ b/parser.cpp
@@ -1108,6 +1108,7 @@ StateInsert::initial(void) throw (Error)
}
for (int i = args; i > 0; i--)
expressions.pop_num_calc();
+ interface.ssm(SCI_SCROLLCARET);
interface.ssm(SCI_ENDUNDOACTION);
undo.push_msg(SCI_UNDO);
@@ -1118,7 +1119,8 @@ StateInsert::process(const gchar *str, gint new_chars) throw (Error)
{
interface.ssm(SCI_BEGINUNDOACTION);
interface.ssm(SCI_ADDTEXT, new_chars,
- (sptr_t)(str + strlen(str) - new_chars));
+ (sptr_t)(str + strlen(str) - new_chars));
+ interface.ssm(SCI_SCROLLCARET);
interface.ssm(SCI_ENDUNDOACTION);
undo.push_msg(SCI_UNDO);