Skip to content

Commit

Permalink
FIX: Single semicolon at beginning was indented. (#454)
Browse files Browse the repository at this point in the history
The workaround here is to add a double semicolon, iff the start comment is a
single semicolon.  This also required some fixing of the whitespace
calculations.  This commit is for issue
387 (#387).
  • Loading branch information
quazgar authored Jan 5, 2024
1 parent 464517d commit d80b2ff
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions snippets/prog-mode/commentblock
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@ ${1:$(let* ((col (current-column))
${1:$(let* ((col (current-column))
(str "")
(start (yas-trimmed-comment-start))
(start (if (string= start ";") ";;" 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-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 start str))} ${1:comment} ${1:$(
let* ((col (current-column))
(str "")
(start (yas-trimmed-comment-start))
(start (if (string= start ";") ";;" start))
(end (yas-trimmed-comment-end)))
(while (< (length str)
(- 79 (length end)
(if (eq (mod (+ (string-width yas-text) (length start) (length end)) 2) 1) (- col 1) col)))
(setq str (concat str " ")))
(concat str end))}
${1:$(let* ((col (current-column))
(str "")
Expand Down

0 comments on commit d80b2ff

Please sign in to comment.