From 15c068e1cff03f81f63b85159437e162660c0760 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Tue, 28 Mar 2017 09:35:03 +0200 Subject: Update snippets and yasnippet --- .emacs.d/snippets/prog-mode/commentline | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to '.emacs.d/snippets/prog-mode/commentline') diff --git a/.emacs.d/snippets/prog-mode/commentline b/.emacs.d/snippets/prog-mode/commentline index 0b0edff..400a7bf 100644 --- a/.emacs.d/snippets/prog-mode/commentline +++ b/.emacs.d/snippets/prog-mode/commentline @@ -3,11 +3,9 @@ # name: commentline # key: col # -- -${1:$(yas-trimmed-comment-start)} ${1:comment} ${1:$(let* ((str "") - (curr (current-column)) - (start (yas-trimmed-comment-start)) - (lastcom (substring start -1)) - (end (yas-trimmed-comment-end))) - (while (< (length str) (- 79 (+ curr (length end)))) - (setq str (concat str lastcom))) - (concat str end))}$0 \ No newline at end of file +`(yas-trimmed-comment-start)` ${1:comment} ${1:$(let* ((start (yas-trimmed-comment-start)) + (lastcom (aref start (1- (length start)))) + (end (yas-trimmed-comment-end)) + (endpadlen (- 79 (+ (current-column) (length end))))) + (concat (make-string (max endpadlen 0) lastcom) + end))}$0 \ No newline at end of file -- cgit v1.3