aboutsummaryrefslogtreecommitdiff
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/pg-user.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/generic/pg-user.el b/generic/pg-user.el
index af1a53cf..650cfc11 100644
--- a/generic/pg-user.el
+++ b/generic/pg-user.el
@@ -537,11 +537,15 @@ This is intended as a value for `proof-activate-scripting-hook'"
proof-electric-terminator-toggle)
(defun proof-electric-terminator ()
- "Insert the terminator, perhaps sending the command to the assistant.
-If variable `proof-electric-terminator-enable' is non-nil, the command will be
-sent to the assistant."
+ "Insert terminator char, maybe sending the command to the assistant.
+If we are inside a comment or string, insert the terminator.
+Otherwise, if the variable `proof-electric-terminator-enable'
+is non-nil, the command will be sent to the assistant."
(interactive)
- (if proof-electric-terminator-enable
+ (if (and
+ proof-electric-terminator-enable
+ (not (proof-inside-comment (point)))
+ (not (proof-inside-string (point))))
(proof-assert-electric-terminator)
(self-insert-command 1)))