editorconfig / editorconfig-vim

EditorConfig plugin for Vim
http://editorconfig.org
Other
3.13k stars 137 forks source link

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

Open ObiWahn opened 7 months ago

ObiWahn commented 7 months ago

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

https://github.com/neoclide/coc.nvim/issues/4922

cxw42 commented 7 months ago

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.

sergio-gdr commented 6 months ago

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 commented 6 months ago

@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 commented 6 months ago

@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 commented 6 months ago

Looking at the ticket you linked at the top, I see https://github.com/neoclide/coc.nvim/issues/4922#issuecomment-2026553559 from two days ago recommends not using packadd to get the EditorConfig plugin.

pf-ait commented 2 months ago

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 commented 2 months ago

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 commented 1 month ago

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

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 commented 1 month ago

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: https://github.com/editorconfig/editorconfig-vim/compare/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!