FUEL: Electric indentation for ] and } fixed.
parent
608352f313
commit
4543590ca9
|
@ -111,7 +111,7 @@ code in the buffer."
|
|||
(= (- be (point)) (current-indentation))
|
||||
(= ln (line-number-at-pos be)))
|
||||
(fuel-syntax--indentation-at bs))
|
||||
((or (fuel-syntax--is-eol bs)
|
||||
((or (fuel-syntax--is-last-char bs)
|
||||
(not (eq ?\ (char-after (1+ bs)))))
|
||||
(fuel-syntax--increased-indentation
|
||||
(fuel-syntax--indentation-at bs)))
|
||||
|
@ -238,15 +238,17 @@ code in the buffer."
|
|||
|
||||
;;; Keymap:
|
||||
|
||||
(defun factor-mode-insert-and-indent (n)
|
||||
(defun factor-mode--insert-and-indent (n)
|
||||
(interactive "*p")
|
||||
(self-insert-command n)
|
||||
(let ((start (point)))
|
||||
(self-insert-command n)
|
||||
(save-excursion (font-lock-fontify-region start (point))))
|
||||
(indent-according-to-mode))
|
||||
|
||||
(defvar factor-mode-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(define-key map [?\]] 'factor-mode-insert-and-indent)
|
||||
(define-key map [?}] 'factor-mode-insert-and-indent)
|
||||
(define-key map [?\]] 'factor-mode--insert-and-indent)
|
||||
(define-key map [?}] 'factor-mode--insert-and-indent)
|
||||
(define-key map "\C-m" 'newline-and-indent)
|
||||
(define-key map "\C-co" 'factor-mode-visit-other-file)
|
||||
(define-key map "\C-c\C-o" 'factor-mode-visit-other-file)
|
||||
|
|
|
@ -107,7 +107,6 @@
|
|||
(list (cons 'font-lock-syntactic-keywords
|
||||
fuel-syntax--syntactic-keywords))))))
|
||||
|
||||
|
||||
|
||||
;;; Fontify strings as Factor code:
|
||||
|
||||
|
|
|
@ -260,7 +260,7 @@
|
|||
(defsubst fuel-syntax--looking-at-emptiness ()
|
||||
(looking-at "^[ ]*$\\|$"))
|
||||
|
||||
(defsubst fuel-syntax--is-eol (pos)
|
||||
(defsubst fuel-syntax--is-last-char (pos)
|
||||
(save-excursion
|
||||
(goto-char (1+ pos))
|
||||
(fuel-syntax--looking-at-emptiness)))
|
||||
|
|
Loading…
Reference in New Issue