[geany/geany-plugins] 196fc6: Merge pull request #918 from techee/vimode_o

Frank Lanitz git-noreply at xxxxx
Sat Oct 5 08:36:26 UTC 2019


Branch:      refs/heads/master
Author:      Frank Lanitz <frank at frank.uvena.de>
Committer:   GitHub <noreply at github.com>
Date:        Sat, 05 Oct 2019 08:36:26 UTC
Commit:      196fc650b90de8c4c493db1f3d3f7fe3152fdac0
             https://github.com/geany/geany-plugins/commit/196fc650b90de8c4c493db1f3d3f7fe3152fdac0

Log Message:
-----------
Merge pull request #918 from techee/vimode_o

vimode: Make o/O respect auto indentation


Modified Paths:
--------------
    vimode/src/cmds/changemode.c

Modified: vimode/src/cmds/changemode.c
16 lines changed, 12 insertions(+), 4 deletions(-)
===================================================================
@@ -120,7 +120,6 @@ void cmd_enter_insert_next_line(CmdContext *c, CmdParams *p)
 {
 	SSM(p->sci, SCI_LINEEND, 0, 0);
 	SSM(p->sci, SCI_NEWLINE, 0, 0);
-	SSM(p->sci, SCI_DELLINELEFT, 0, 0);
 	c->num = p->num;
 	c->newline_insert = TRUE;
 	vi_set_mode(VI_MODE_INSERT);
@@ -129,9 +128,18 @@ void cmd_enter_insert_next_line(CmdContext *c, CmdParams *p)
 
 void cmd_enter_insert_prev_line(CmdContext *c, CmdParams *p)
 {
-	SSM(p->sci, SCI_HOME, 0, 0);
-	SSM(p->sci, SCI_NEWLINE, 0, 0);
-	SSM(p->sci, SCI_LINEUP, 0, 0);
+	if (p->line == 0)
+	{
+		SSM(p->sci, SCI_HOME, 0, 0);
+		SSM(p->sci, SCI_NEWLINE, 0, 0);
+		SSM(p->sci, SCI_LINEUP, 0, 0);
+	}
+	else
+	{
+		SSM(p->sci, SCI_LINEUP, 0, 0);
+		SSM(p->sci, SCI_LINEEND, 0, 0);
+		SSM(p->sci, SCI_NEWLINE, 0, 0);
+	}
 	c->num = p->num;
 	c->newline_insert = TRUE;
 	vi_set_mode(VI_MODE_INSERT);



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list