Open ObiWahn opened 9 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.
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!
@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.
@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.
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.
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.
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.
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.
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!
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.
Just tried the fix posted by @damiendart - it indeed solved the scrolling issue after closing floating fzf windows!
I really thought is is an issue of coc. But removing this plugin resolved the issue.
https://github.com/neoclide/coc.nvim/issues/4922