projectile 在50000+的项目中,输入框很卡

按了 回车 才出现错误提示的,显示不出任何东西

那你贴的图不对

你应该贴没有任何东西的图 以及 你的配置

我等了一会,出来结果了。但是还是会有下面的错误提示。 假如我搜不存在的字符,是不是应该 在窗口里面 提示 未找到 之类的,而不是 啥也不显示呢?@ manateelazycat

回车键依赖于当前的选择

没有选择自然就出错了

不过 未找到 应该有

这下面这个错误提示 就是 按了回车后 出现的

你按两下 C-n 再按回车呢?

按一下 C-n,就跟回车一个作用,就出现错误提示和搜索结果了

在不退出 snails 的时候

C-h v snails-select-line-overlay

%E5%9B%BE%E7%89%87

有显示的时候也是这样的?

这就是已经搜索出结果的时候,按 C-h v。然后我试了 不管之前的光标 有没有选中东西,这个snails-select-line-overlay 都是nil

你把 C-h f snails-render-bufer 的代码贴上来吧

snails-render-bufer is a function defined in snails-core.el.

Signature (snails-render-bufer)

Documentation Render candidates when snails-need-render flag is set.

References snails-render-bufer is unused in snails-core.el.

Find all references Find callees

Debugging Enable edebug Enable tracing Disassemble Forget

Source Code ;; Defined in ~/.emacs.d/site-lisp/snails/snails-core.el

(defun snails-render-bufer ()

“Render candidates when `snails-need-render’ flag is set.”

(when snails-need-render (with-current-buffer snails-content-buffer

  ;; Record select line offset.
  (snails-record-select-line-offset)

  ;; Clean buffer first.
  (erase-buffer)

  ;; Clean all header line overlays.
  (setq snails-header-line-overlays nil)

  ;; Reset select line variables.
  (setq snails-select-line-overlay (make-overlay (point) (point) (current-buffer) t))
  (overlay-put snails-select-line-overlay 'face `snails-select-line-face)

  (let* ((candiate-index 0)
         (backend-names (snails-get-backend-names))
         (effective-backend-index 1)
         (effective-backend-number (length (cl-remove-if #'booleanp snails-candiate-list)))
         header-line-start
         header-line-end
         header-index-start
         header-index-end
         candidate-content-start
         candidate-content-end)
    ;; Render backend result.
    (dolist (candiate-list snails-candiate-list)
      ;; Just render backend result when return candidate is not nil.
      (when candiate-list
        ;; Render header line with overlay.
        (setq header-line-start (point))
        (insert (nth candiate-index backend-names))
        (setq header-line-end (point))
        (let ((header-line-overlay (make-overlay header-line-start header-line-end)))
          (add-to-list 'snails-header-line-overlays header-line-overlay)
          (overlay-put header-line-overlay
                       'face
                       'snails-header-line-face
                       ))

        ;; Insert backend index.
        (setq header-index-start (point))
        (insert (format " [%s/%s]\n" effective-backend-index effective-backend-number))
        (backward-char)
        (setq header-index-end (point))
        (overlay-put (make-overlay header-index-start header-index-end)
                     'face
                     'snails-header-index-face)
        (forward-char)
        (setq effective-backend-index (+ effective-backend-index 1))

        ;; Render candidate list.
        (dolist (candiate candiate-list)
          ;; Render candidate display name.
          (insert (nth 0 candiate))

          ;; Render candidate real content. ;
          (setq candidate-content-start (point))
          (insert (format "%s" (nth 1 candiate)))
          (setq candidate-content-end (point))
          (let ((candidate-content-overlay (make-overlay candidate-content-start candidate-content-end)))
            (overlay-put candidate-content-overlay 'display "")
            (overlay-put candidate-content-overlay
                         'face
                         'snails-candiate-content-face))
          (insert "\n"))

        ;; Insert new empty line at last candiate of backend.
        (insert "\n"))
      ;; Update candidate index to fetch name of next backend.
      (setq candiate-index (+ candiate-index 1))))

  ;; Restore select line offset.
  (snails-restore-select-line-offset)
  )

;; Reset render flag.
(setq snails-need-render nil)))

(setq snails-select-line-overlay (make-overlay (point) (point) (current-buffer) t))

后面加上一句

(print "DDDDDebug") (print snails-select-line-overlay)

然后 M-x eval-buffer

再然后 调用snails

再然后 C-h e 查看*Message*

看看他是不是还是nil

%E5%9B%BE%E7%89%87

应该是设置了哪个变量了

可为什么找不到呢?

我也不懂lisp,看着有点复杂

你用smex吗 就是替换原有的M-x的

如果用的话就先把他注释掉(并重启emacs)

然后把

(defun snails-quit ()
  "Quit snails."
  (interactive)
  ;; Delete frame first.

替换成

(defun snails-quit ()
  "Quit snails."
  (interactive)
  ;; Delete frame first.
  (backtrace)

然后 M-x eval-buffer

再然后 调用snails

再然后 C-h e 查看Message

%E5%9B%BE%E7%89%87

你可以多按几个键

这个看不出来是谁调用了 snails-quit