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

Cursor keeps disappearing when using ivy-overlay in buffer #1732

Closed
terlar opened this issue Aug 26, 2018 · 3 comments

Comments

@terlar
Copy link

commented Aug 26, 2018

I recently started using ivy with ivy-overlay for completion-at-point function in the buffer. But when I either accept the completion (RET) or cancel (C-g) the cursor never restores.

I have to manually run (setq cursor-type 'box) to get it back. I haven't found exactly why this is happening and haven't tried it out in with a reduced setup without plugins, just wonder if you have heard about this before or have any idea where to start looking / what could be causing this.

I will do some further investigations and get back with more info.

@basil-conto

This comment has been minimized.

Copy link
Collaborator

commented Aug 26, 2018

the cursor never restores

WDYM exactly?

I have to manually run `(setq cursor-type 'box)

What was the previous value? (It defaults to t.)

just wonder if you have heard about this before

Not that I'm aware of, but I'm relatively new around here.

what could be causing this

My guess is you're using some overlay-based package which is clashing with `ivy-overlay, similar to #1016 and #1488.

I will do some further investigations and get back with more info.

Please do. It would be particularly helpful if you could try reproducing the issue from emacs -Q or make plain and also provide a precise set of steps with before-after descriptions of the keys you press, what you see, etc. Thanks.

@terlar

This comment has been minimized.

Copy link
Author

commented Aug 27, 2018

org-mode file to demonstrate the issue. I ran it an a vanilla Emacs with env HOME=$HOME/emacsjail emacs. As mentioned in the description I have some suspicions from doing this test.

Regarding the cursor I am talking about this:
https://github.com/abo-abo/swiper/blob/master/ivy-overlay.el#L111-L115
and this
https://github.com/abo-abo/swiper/blob/master/ivy-overlay.el#L58-L59

I ran the debugger and found out that it says cursor-type is t while it actually doesn't show and then it is left as nil when the ivy-overlay-cleanup function is done. I wonder if it is due to the src block edit being opened in the moment between the evaluation.

#+TITLE: Cursor disappears with ivy-overlay inside org-mode

This issue only seems to appear in =org-mode= and running this vanilla
like this make me think that it has something to do with using tab for
completion and tab also seemingly being bound to edit the SRC block.

* Install Ivy
#+BEGIN_SRC emacs-lisp
(require 'package)
(package-initialize)
(package-refresh-contents)
(package-install 'ivy)
(require 'ivy)
#+END_SRC

#+RESULTS:
: ivy

* Configure
#+BEGIN_SRC emacs-lisp
(setq tab-always-indent 'complete)
(setq org-confirm-babel-evaluate nil)
(setq org-edit-src-content-indentation 0)
(setq org-src-tab-acts-natively t)
#+END_SRC

#+RESULTS:
: t

* Enable ivy
#+BEGIN_SRC emacs-lisp
(ivy-mode 1)
#+END_SRC

#+RESULTS:
: t

* Demo the issue

To make the cursor disappear go to the end of the line that says
=(set= and press =TAB=. Then press =C-g= or =C-m=. Cursor disappears.
#+BEGIN_SRC emacs-lisp
(set
#+END_SRC

* Restore the cursor
#+BEGIN_SRC emacs-lisp
(setq cursor-type 'box)
#+END_SRC

#+RESULTS:
: box

@abo-abo abo-abo closed this in 00dbfa4 Sep 6, 2018

@abo-abo

This comment has been minimized.

Copy link
Owner

commented Sep 6, 2018

Thanks, I was able to reproduce the issue. I decided to disable the overlays inside Org source blocks, see the commit msg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.