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

Hide the cursor for evil-mode #43

Closed
zrquan opened this issue May 18, 2022 · 9 comments
Closed

Hide the cursor for evil-mode #43

zrquan opened this issue May 18, 2022 · 9 comments

Comments

@zrquan
Copy link
Contributor

zrquan commented May 18, 2022

通过 find-file 或者 bookmark 打开目录时光标没有隐藏,需要切换一次目录才会隐藏光标

image

@alexluigit
Copy link
Owner

现在应该好了。
另外你这个顶部标题怎么没内容? 是马赛克了吗?

@alexluigit alexluigit changed the title 光标隐藏问题 Hide the cursor for evil-mode May 18, 2022
@zrquan
Copy link
Contributor Author

zrquan commented May 18, 2022

现在应该好了。 另外你这个顶部标题怎么没内容? 是马赛克了吗?

貌似和光标一样,通过 bookmark 打开目录会看不到标题,之前都没注意

@alexluigit
Copy link
Owner

alexluigit commented May 18, 2022

你能简单发个重现步骤吗? 谢谢。我没怎么用过自带的bookmark, 简单试了下 bookmark-set 和 bookmark-jump 没发现这个问题。

@zrquan
Copy link
Contributor Author

zrquan commented May 18, 2022

可能是 counsel-bookmark 或者 doom-emacs 的问题?我的 elisp 目前还是 helloworld 水平,不太会具体定位😂

May-18-2022 17-20-52

@alexluigit
Copy link
Owner

喔,ivy 的问题。等我写个补丁。consult-bookmark 没这毛病。

@alexluigit
Copy link
Owner

counsel-bookmark 应该好了, 你试试吧。

@zrquan
Copy link
Contributor Author

zrquan commented May 18, 2022

标题已经没问题了,但 consult-bookmark 打开时光标还有点问题,貌似高亮的行和光标实际上不在同一行?

打开 dirvish 第一次移动会跳到不正确的行上:
May-18-2022 19-59-04

比如上图 (setq cursor-type 'box) 之后其实 cursor 在第二行

@alexluigit
Copy link
Owner

alexluigit commented May 18, 2022

还是一样的原因,我完全不理解 ivy 要在这里调用 with-ivy-window,这里出现的标题/行高亮都是这个造成的。我不太想在 dirvish 里 workaround,因为根源问题不在这里。

一个临时的解决办法

(defadvice! counsel-bookmark-in-place ()
  "Forward to `bookmark-jump' or `bookmark-set' if bookmark doesn't exist."
  :override #'counsel-bookmark
  (require 'bookmark)
  (ivy-read "Create or jump to bookmark: "
            (bookmark-all-names)
            :history 'bookmark-history
            :action (lambda (x)
                      (cond ((and counsel-bookmark-avoid-dired
                                  (member x (bookmark-all-names))
                                  (file-directory-p (bookmark-location x)))
                             (let ((default-directory (bookmark-location x)))
                               (counsel-find-file)))
                            ((member x (bookmark-all-names))
                             (bookmark-jump x))
                            (t
                             (bookmark-set x))))
            :caller 'counsel-bookmark))

我后续看看有没有更好的办法解决。但我其实也并不能保证 ivy 里面会不会有其他地方导致什么问题。我的建议是从 ivy 全家桶换成 vertico + consult (+ 其他) 这一套 (这也是doom 现在默认的选择)。ivy/counsel/swiper 里的很多问题在 vertico 这里根本不存在。

参考: https://github.com/radian-software/selectrum#ivy

@zrquan
Copy link
Contributor Author

zrquan commented May 19, 2022

了解,谢谢大佬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants