Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun do-yas-expand ()
- (let ((yas-fallback-behavior 'return-nil))
- (yas-expand)))
- (defun check-expansion ()
- (save-excursion
- (if (looking-at "\\_>") t
- (backward-char 1)
- (if (looking-at "\\.") t
- (backward-char 1)
- (if (looking-at "->") t nil)))))
- (defun tab-indent-or-complete ()
- (interactive)
- (if (minibufferp)
- (minibuffer-complete)
- (if (or (not yas-minor-mode)
- (null (do-yas-expand)))
- (if (check-expansion)
- (company-complete-common)
- (yas--fallback)))))
- (define-key yas-minor-mode-map [tab] 'tab-indent-or-complete)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement