summaryrefslogtreecommitdiff
path: root/prog-mode/commentblock
diff options
context:
space:
mode:
authorsh-ow <sh-ow@users.noreply.github.com>2016-04-14 00:59:31 +0200
committersh-ow <sh-ow@users.noreply.github.com>2016-04-14 00:59:31 +0200
commite2409dd612e22497f50677aad6cda4e50e1aa7ea (patch)
tree33b9392daee8b68ec89754963d27a9593c60ad7c /prog-mode/commentblock
parent9b30fe4123b1b2b14f4234a5c4bf2ef5301904e0 (diff)
prog-mode: rename yas-get-comment-xxx functions, different approach for whitespace trim
Diffstat (limited to 'prog-mode/commentblock')
-rw-r--r--prog-mode/commentblock20
1 files changed, 10 insertions, 10 deletions
diff --git a/prog-mode/commentblock b/prog-mode/commentblock
index 09bcddb..ba61f61 100644
--- a/prog-mode/commentblock
+++ b/prog-mode/commentblock
@@ -5,31 +5,31 @@
# --
${1:$(let* ((col (current-column))
(str "")
- (lastcom (substring (yas-get-comment-start) -1))
- (start (yas-get-comment-start))
- (end (yas-get-comment-end))
+ (lastcom (substring (yas-trimmed-comment-start) -1))
+ (start (yas-trimmed-comment-start))
+ (end (yas-trimmed-comment-end))
(over (- (+ (string-width yas-text) (length start) (length end) col) 77)))
(while (< (length str) (+ (- 79 (length start) (length end) col) (if (> over 0) over 0)))
(setq str (concat str lastcom)))
(concat start str end))}
${1:$(let* ((col (current-column))
(str "")
- (start (yas-get-comment-start))
- (end (yas-get-comment-end)))
+ (start (yas-trimmed-comment-start))
+ (end (yas-trimmed-comment-end)))
(while (< (length str) (ffloor (/ (- 78.0 (+ col (length start) (string-width yas-text) (length end))) 2.0)))
(setq str (concat str " ")))
(concat start str))} ${1:comment} ${1:$(let* ((col (current-column))
(str "")
- (start (yas-get-comment-start))
- (end (yas-get-comment-end)))
+ (start (yas-trimmed-comment-start))
+ (end (yas-trimmed-comment-end)))
(while (< (length str) (- 79.0 (if (eq (mod (string-width yas-text) 2) 1) (- col 1) col) (length end)))
(setq str (concat str " ")))
(concat str end))}
${1:$(let* ((col (current-column))
(str "")
- (lastcom (substring (yas-get-comment-start) -1))
- (start (yas-get-comment-start))
- (end (yas-get-comment-end))
+ (lastcom (substring (yas-trimmed-comment-start) -1))
+ (start (yas-trimmed-comment-start))
+ (end (yas-trimmed-comment-end))
(over (- (+ (string-width yas-text) (length start) (length end) col) 77)))
(while (< (length str) (+ (- 79 (length start) (length end) col) (if (> over 0) over 0)))
(setq str (concat str lastcom)))