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

Plugin breaks the positioning of floating windows in other plugins #235

Open
ObiWahn opened this issue Mar 3, 2024 · 11 comments
Open

Plugin breaks the positioning of floating windows in other plugins #235

ObiWahn opened this issue Mar 3, 2024 · 11 comments
Labels
need info Need more information before proceeding

Comments

@ObiWahn
Copy link

ObiWahn commented Mar 3, 2024

I really thought is is an issue of coc. But removing this plugin resolved the issue.

neoclide/coc.nvim#4922

@cxw42 cxw42 changed the title Your plugin breaks the positioning of floating windows in other plugins. Plugin breaks the positioning of floating windows in other plugins Mar 5, 2024
@cxw42
Copy link
Member

cxw42 commented Mar 5, 2024

Would you please provide more details, and a minimal repro? I looked at the linked issue, and it seems to be about the cursor position. However, the title of the issue talks about floating-window position. I am not sure what problem you are having. Thanks!

If this issue is actually about position of the cursor on the line, please try with the latest from this repo. It might be the same issue as already-fixed #224.

@cxw42 cxw42 added the need info Need more information before proceeding label Mar 5, 2024
@sergio-gdr
Copy link

Hi!
I have a similar issue, also with CoC + editorconfig.
It happens only if the cursor is not in the very beginning of the line:

Screencast.from.2024-03-18.17-22-44.webm

Removing editorconfig dissolves the issue.

Tell me if you need any more info!

@cxw42
Copy link
Member

cxw42 commented Mar 19, 2024

@SergioGDR thanks for the video! Was this with the latest from this repo? If not, please try with the latest. That issue looks very much like #224.

@sergio-gdr
Copy link

@SergioGDR thanks for the video! Was this with the latest from this repo? If not, please try with the latest. That issue looks very much like #224.

Yup, this is with the latest.

@cxw42
Copy link
Member

cxw42 commented Mar 30, 2024

Looking at the ticket you linked at the top, I see neoclide/coc.nvim#4922 (comment) from two days ago recommends not using packadd to get the EditorConfig plugin.

@pf-ait
Copy link

pf-ait commented Jul 17, 2024

I am experiencing the same issue, however while using fzf, which is also using popup windows by default. No matter if I use the vim9 bundled version via packadd or the up-to-date version (current master checked out at 8b7da79 via vim-plug), as soon as something opens a popup window, the cursor will scroll to the top of the file, which is quite annoying.

See also #224 and fzf-vim#1164, which discussed this issue, the latter also links to the upstream fix already contained in vim.

@kedodrill
Copy link

kedodrill commented Aug 7, 2024

I am having the same exact problem. The screencast above shows exactly what I have been dealing with for the past few months. I am using fzf and fzf#run for custom commands. I'm using vim-plug Plug 'editorconfig/editorconfig-vim and using the vim9script option. Commenting out this plugin resolves the erroneous behavior.

@pf-ait I saw those as well, and that fix for vim was from a few years ago, so maybe something got changed.
https://github.com/vim/vim/blob/master/src/autocmd.c#L2405-L2424
Looks a bit different.

It's worth noting here that playing with different window options for fzf can prevent the jump. Instead of window I'm using 'down': '40%' in my commands and that seems to be working well.

@timacdonald
Copy link

timacdonald commented Aug 12, 2024

I've run into this one as well. I've just run PlugUpdate to ensure that all plugins are up to date.

  • MacOS
  • Vim 9.1

Commenting out this plugin in my config fixes the issue.

# Broken
Plug 'editorconfig/editorconfig-vim'

# Fixed
# Plug 'editorconfig/editorconfig-vim' 

I also found that while the plugin is installed I can fix the issue by removing the .editorconfig file.

Plug 'editorconfig/editorconfig-vim'

// and...

rm './.editorconfig'

If I can provide any additional information to help out here, please let me know. Also happy to help out with a fix if you have a rough idea of where we should be looking to get it resolved.

@JoshuaToenyes
Copy link

I have also run into this problem.

I'm running VIM 9.1 on MacOS installed via Homebrew:

VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Aug 01 2024 20:48:53)
macOS version - x86_64
Included patches: 1-650

I have editorconfig-vim installed as a Vim8 plugin. If I checkout the v1.2.0 tag in the plugin directory the problem is resolved.

The issue is also present in v.1.2.1-alpha.1 tag. So I think the problem must be in one of these commits: v1.2.0...v.1.2.1-alpha.1

Unfortunately I know very little about Vim internals, so I'm not much help on a solution.

Thank you @cxw42 and all other contributors for your great work on this project!

@damiendart
Copy link

damiendart commented Oct 12, 2024

I've also run into the issue seen by @sergio-gdr, and I've found that disabling EditorConfig for terminal buffers seems to solve it:

let g:EditorConfig_exclude_patterns = ['^.*!\w*sh$']

I don't use terminal buffers that much outside of displaying fzf in Vim, so I don't know what else will be affected by this setting. There might be a way to just target terminal buffers running fzf.

Alternatively, if you're showing fzf in a horizontal split (let g:fzf_layout = { 'down': '40%' }), I've found that setting splitkeep (introduced in Vim 9.0.0647 and NeoVim 0.9.0) to screen helps with creating a floating-window-like feel by preventing the text in the other windows from moving around.

@pf-ait
Copy link

pf-ait commented Oct 14, 2024

Just tried the fix posted by @damiendart - it indeed solved the scrolling issue after closing floating fzf windows!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need info Need more information before proceeding
Projects
None yet
Development

No branches or pull requests

8 participants