Skip to content

Commit 72fc48e

Browse files
committed
fix: Respect yasnippet
1 parent 54d89da commit 72fc48e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

vsc-edit-mode.el

+6-4
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,11 @@
377377
(defun vsc-edit-tab ()
378378
"Global TAB key."
379379
(interactive)
380-
(if (or (vsc-edit-prog-mode-p) vsc-edit-insert-tab-on-tab)
381-
(vsc-edit-smart-tab)
382-
(funcall-interactively (local-key-binding (kbd "TAB")))))
380+
(or (and yas-minor-mode
381+
(ignore-errors (yas-next-field-or-maybe-expand) t))
382+
(if (or (vsc-edit-prog-mode-p) vsc-edit-insert-tab-on-tab)
383+
(vsc-edit-smart-tab)
384+
(execute-kbd-macro (kbd "TAB")))))
383385

384386
(defun vsc-edit-smart-shift-tab ()
385387
"`prog-mode' shift tab."
@@ -405,7 +407,7 @@
405407
(interactive)
406408
(if (vsc-edit-prog-mode-p)
407409
(vsc-edit-smart-shift-tab)
408-
(funcall-interactively (local-key-binding [S-tab]))))
410+
(execute-kbd-macro [S-tab])))
409411

410412
;;
411413
;; (@* "BOL and EOL" )

0 commit comments

Comments
 (0)