centered-cursor-mode.el icon indicating copy to clipboard operation
centered-cursor-mode.el copied to clipboard

doesn't work with multiple windows on the vertical axis

Open Sleepful opened this issue 4 years ago • 4 comments

Given the windows A and B, where A is taller than B:

┌────────┐  
│ ****** │  <-- Cursor skewed towards the top
│   A    │  
│        │  
├────────┤  
│   B    │  
└────────┘  

The cursor rests on the ***** position, which is skewed towards the top rather than centered. Expected behavior:

┌────────┐  
│        │  
│ ****** │  <-- Centered cursor on window A
│        │  
├────────┤  
│   B    │  
└────────┘  

This is on the dev branch

Update:

The bug happens with the previous window configuration and then opening a completion buffer (such as M-x with Ivy/Swiper/Helm/Counsel...)

Sleepful avatar Feb 25 '21 07:02 Sleepful

pls fix, or give me a hint to fix it

Sleepful avatar Feb 25 '21 07:02 Sleepful

Funny scenario:

┌────┬────┐  
│    │    │ 
│ A  │ B  │  
│    │    │ 
├────┴────┤   
│    C    │  
└─────────┘

go to A, open a completion buffer such as M-x and then escape it with C-g or something, you get the bug. now go to B, open the completion buffer again and escape it, the cursor is centered again.

Sleepful avatar Feb 25 '21 07:02 Sleepful

Another update:

This happens when the windows (that are "on top" of each other, like A and B in the first diagram) have the same buffer open. With different opened buffers it does not happen.

Sleepful avatar Feb 25 '21 07:02 Sleepful

I think I know what you mean and I think I have fixed this in the dev branch (https://github.com/andre-r/centered-cursor-mode.el/tree/dev). I you try it, know that customization (variables) names have changed and at the end of the file will always be recentered (for now).

andre-r avatar Feb 25 '21 23:02 andre-r