ace-window icon indicating copy to clipboard operation
ace-window copied to clipboard

Windows with empty buffers: `ace-window` won't show the leading characters

Open xuhdev opened this issue 8 years ago • 7 comments

To reproduce, fire up Emacs, C-x 2 C-x 3 and clear the buffer contents. Now call ace-window. The leading characters are not shown. Instead, whitespace characters are highlighted.

xuhdev avatar Jul 18 '16 22:07 xuhdev

Can't reproduce. Ace window has code to handle this specific problem. What's your Emacs version?

abo-abo avatar Jul 19 '16 06:07 abo-abo

I'm on 24.5

xuhdev avatar Jul 19 '16 17:07 xuhdev

Can't reproduce on 24.5 either. Can you try with emacs -Q -l ace-window.el?

abo-abo avatar Jul 19 '16 19:07 abo-abo

I found out the issue. The following two lines in my configuration cause the misbehavior:

(global-whitespace-mode)
(setq whitespace-style '(face trailing))

These two lines highlight trailing whitespace in a buffer. Do you have any suggestions to fix it? Thanks!

xuhdev avatar Jul 19 '16 21:07 xuhdev

One workaround for this problem is to use this feature included in the ace-window documentation:

If you want to know the window selection characters ahead of time,
turn on `ace-window-display-mode'.

It permanently displays the window labels at the left of each window's modeline and is not affected by your whitespace-mode configuration.

rswgnu avatar Dec 11 '17 22:12 rswgnu

You could close this issue since you have added code to insert a character into empty buffers that can support the leading/overlay character. However, this presently leaves the buffer modified. You should probably change it to do an undo on the buffer or reset its modified state.

rswgnu avatar Mar 22 '19 15:03 rswgnu

You should probably change it to do an undo on the buffer or reset its modified state.

Please PR

abo-abo avatar Mar 25 '19 10:03 abo-abo