Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't reset hippie-expand search string #1168

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions yasnippet.el
Original file line number Diff line number Diff line change
Expand Up @@ -2301,15 +2301,19 @@ will only be expanded when the condition evaluated to non-nil."
(yas-define-snippets mode
(list (list key template name condition group))))

(defun yas-hippie-try-expand (first-time?)
(defun yas-hippie-try-expand (old)
"Integrate with hippie expand.

Just put this function in `hippie-expand-try-functions-list'."
(when yas-minor-mode
(if (not first-time?)
(if (not old)
(let ((yas-fallback-behavior 'return-nil))
(yas-expand))
(undo 1)
(let ((old-this-command this-command))
;; undo sets this-command, but that would confuse hippie-expand, so we
;; just restore the value.
(undo 1)
(setq this-command old-this-command))
nil)))


Expand Down