                     (if (string-equal (car item) "Insert snippet")
                         '("Insert snippet" . (lambda (template)
                                                (let ((struct (helm-yas-get-struct-by-template template)))
-                                                 (yas-expand-snippet (yas--template-content struct) nil nil (yas--template-expand-env struct)))
+                                                 (yas-expand-snippet (yas--template-content struct) helm-yas-point-start helm-yas-point-end (yas--template-expand-env struct)))
                                                (when helm-yas-display-msg-after-complete
                                                  (message "this snippet is bound to [ %s ]"
                                                           (helm-yas-get-key-by-template template helm-yas-cur-snippets-alist)))))

  ;; pretty useless because most snippets do not have a key binding.
  (setq helm-yas-display-msg-after-complete nil)

  ;; The following patch to helm-c-yasnippet makes it properly evaluate the
  ;; `expand-env` attribute in snippets.
  ;;
  ;; It is unfortunate to have to patch it this way - this fix should probably
  ;; the submitted back to the helm-c-yasnippet project.
  (el-patch-feature helm-c-yasnippet)
  (with-eval-after-load 'helm-c-yasnippet
    (eval '(el-patch-defun helm-yas-build-cur-snippets-alist (&optional table)
             (let ((yas-choose-keys-first nil)
                   (yas-choose-tables-first nil)
                   (yas-buffer-local-condition 'always))
               (let* ((result-alist '((candidates) (transformed) (template-key-alist) (template-file-alist) (el-patch-add (template-struct-alist))))
                      (cur-tables
                       (if table

                            with template-key-alist
                            with template-file-alist
                            (el-patch-add with template-struct-alist)
                            for lst in (el-patch-swap hash-value-alist (yas--filter-templates-by-condition hash-value-alist))
                            for key = (car lst)
                            for template-struct = (cdr lst)
                            for name = (yas--template-name template-struct) ;`yas--template-name'
