[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemacs-commit] qemacs clang.c
From: |
Charlie Gordon |
Subject: |
[Qemacs-commit] qemacs clang.c |
Date: |
Fri, 23 Dec 2016 07:05:22 -0500 (EST) |
CVSROOT: /sources/qemacs
Module name: qemacs
Changes by: Charlie Gordon <chqrlie> 16/12/23 07:05:22
Modified files:
. : clang.c
Log message:
clang: prevent auto indentation on electric keys if auto-indent is
disabled
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/clang.c?cvsroot=qemacs&r1=1.109&r2=1.110
Patches:
Index: clang.c
===================================================================
RCS file: /sources/qemacs/qemacs/clang.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -b -r1.109 -r1.110
--- clang.c 13 Dec 2016 09:10:47 -0000 1.109
+++ clang.c 23 Dec 2016 12:05:22 -0000 1.110
@@ -987,7 +987,7 @@
if (was_preview)
return;
/* reindent line at original point */
- if (s->mode->indent_func)
+ if (s->mode->auto_indent && s->mode->indent_func)
(s->mode->indent_func)(s, eb_goto_bol(s->b, offset));
}
@@ -996,13 +996,14 @@
int offset = s->offset;
int was_preview = s->b->flags & BF_PREVIEW;
+ /* XXX: should also remove trailing spaces on current line */
do_return(s, 1);
if (was_preview)
return;
+
/* reindent line to remove indent on blank line */
- if (s->mode->indent_func) {
+ if (s->mode->auto_indent && s->mode->indent_func) {
(s->mode->indent_func)(s, eb_goto_bol(s->b, offset));
- if (s->mode->auto_indent)
(s->mode->indent_func)(s, s->offset);
}
}