insert vs highlight.
This commit is contained in:
parent
bfdc884708
commit
ea915993fa
@ -35,8 +35,8 @@
|
|||||||
(save-excursion
|
(save-excursion
|
||||||
(ghc-goto-module-position)
|
(ghc-goto-module-position)
|
||||||
(if prefix
|
(if prefix
|
||||||
(insert "import qualified " mod " as " prefix "\n")
|
(insert-before-markers "import qualified " mod " as " prefix "\n")
|
||||||
(insert "import " mod " (" (ghc-enclose expr) ")\n")))))))
|
(insert-before-markers "import " mod " (" (ghc-enclose expr) ")\n")))))))
|
||||||
|
|
||||||
(defun ghc-completing-read (fmt lst)
|
(defun ghc-completing-read (fmt lst)
|
||||||
(let* ((def (car lst))
|
(let* ((def (car lst))
|
||||||
@ -48,14 +48,15 @@
|
|||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
(if (re-search-backward "^import" nil t)
|
(if (re-search-backward "^import" nil t)
|
||||||
(ghc-goto-empty-line)
|
(ghc-goto-empty-line)
|
||||||
(if (re-search-backward "^module" nil t)
|
(if (not (re-search-backward "^module" nil t))
|
||||||
(progn
|
(goto-char (point-min))
|
||||||
(ghc-goto-empty-line)
|
(ghc-goto-empty-line)
|
||||||
(forward-line)
|
(forward-line)
|
||||||
(unless (eolp)
|
(unless (eolp)
|
||||||
(save-excursion
|
;; save-excursion is not proper due to insert-before-markers.
|
||||||
(insert "\n"))))
|
(let ((beg (point)))
|
||||||
(goto-char (point-min)))))
|
(insert-before-markers "\n")
|
||||||
|
(goto-char beg))))))
|
||||||
|
|
||||||
(defun ghc-goto-empty-line ()
|
(defun ghc-goto-empty-line ()
|
||||||
(unless (re-search-forward "^$" nil t)
|
(unless (re-search-forward "^$" nil t)
|
||||||
|
Loading…
Reference in New Issue
Block a user