Only expand emmet snippets if at word boundary

Makes emmet a little less aggressive on TAB.

Addresses #3383
This commit is contained in:
Henrik Lissner 2020-09-01 19:35:54 -04:00
parent 5940d931f4
commit 73565f1041
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -122,7 +122,9 @@ snippet, or `emmet-expand-yas'/`emmet-expand-line', depending on whether
`yas-minor-mode' is enabled or not." `yas-minor-mode' is enabled or not."
(interactive) (interactive)
(call-interactively (call-interactively
(cond ((<= (current-column) (current-indentation)) (cond ((or (<= (current-column) (current-indentation))
(not (eolp))
(not (memq (char-after) (list ?\n ?\s ?\t))))
#'indent-for-tab-command) #'indent-for-tab-command)
((bound-and-true-p yas-minor-mode) ((bound-and-true-p yas-minor-mode)
(if (yas--templates-for-key-at-point) (if (yas--templates-for-key-at-point)