Fixed template insertion when on the last line without final newline.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 01 Oct 2020 22:42:47 +0300
changeset 1249 f2f0db6154f3
parent 1248 3bc716b96e3c
child 1250 e08853966e84
Fixed template insertion when on the last line without final newline.
contrib/gadialog.el
--- a/contrib/gadialog.el	Thu Oct 01 22:29:18 2020 +0300
+++ b/contrib/gadialog.el	Thu Oct 01 22:42:47 2020 +0300
@@ -60,6 +60,7 @@
     (forward-line 1))
   (unless (re-search-forward "^# " (+ (point) 10240) t)
     (goto-char (point-max)))
+  (when (eobp) (insert-char ?\n))
   (forward-line 0)
   (gadialog-cleaup-whitespaces-forward)
   (insert "\n# ")