Skip to content

Commit

Permalink
Disallow string ligatures of less than 2 characters
Browse files Browse the repository at this point in the history
  • Loading branch information
mickeynp committed Sep 2, 2020
1 parent f128816 commit 6f955a4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ligature.el
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ expression that will match against ligatures beginning with that
first character."
(let (grouped-ligatures)
(dolist (ligature ligatures)
(when (< (length ligature) 2)
(error "Ligature `%s' must be 2 characters or longer" ligature))
(let ((key (substring ligature 0 1)))
(push (substring ligature 1) (alist-get key grouped-ligatures nil nil #'equal))))
(dolist (group grouped-ligatures)
Expand Down

0 comments on commit 6f955a4

Please sign in to comment.