Skip to content

Commit

Permalink
Merge pull request #18 from Hi-Angel/dont-modify-on-same-indentation
Browse files Browse the repository at this point in the history
purescript-indentation.el: don't modify buffer if indentation unchanged
  • Loading branch information
kritzcreek authored Sep 30, 2024
2 parents c3f0d6e + 53c4675 commit fbbbe60
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions purescript-indentation.el
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,18 @@ autofill-mode."
(end-of-line))))

(defun purescript-indentation-reindent (col)
(beginning-of-line)
(delete-region (point)
(progn
(when (and (eq purescript-literate 'bird)
(eq (char-after) ?>))
(forward-char))
(skip-syntax-forward "-")
(point)))
(when (eq purescript-literate 'bird)
(insert ">"))
(indent-to col))
(unless (= col (purescript-indentation-current-indentation))
(beginning-of-line)
(delete-region (point)
(progn
(when (and (eq purescript-literate 'bird)
(eq (char-after) ?>))
(forward-char))
(skip-syntax-forward "-")
(point)))
(when (eq purescript-literate 'bird)
(insert ">"))
(indent-to col)))

(defun purescript-indentation-current-indentation ()
(if (eq purescript-literate 'bird)
Expand Down

0 comments on commit fbbbe60

Please sign in to comment.