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

Fails to initialize Neovim when Guifont called in .vimrc #107

Open
bk2204 opened this issue Dec 6, 2023 · 0 comments
Open

Fails to initialize Neovim when Guifont called in .vimrc #107

bk2204 opened this issue Dec 6, 2023 · 0 comments

Comments

@bk2204
Copy link

bk2204 commented Dec 6, 2023

Describe the bug

When running neovim-gtk with 0.9.4 or nightly installed, with the below .vimrc (tested using nvim-gtk -- -u FILE), Neovim fails to initialize with the error messages below. Note that this problem does not occur with 0.7.2. I don't believe the font is relevant; using monospace:h12 triggers the problem just as well.

I believe the problem is related to the fact that the newer versions set gui_running. I use a .vimrc that's shared between Vim and Neovim, so I used to have a branch for gvim (has("gui_running")) which simply called my SetGUIOptions function, and a branch for Neovim which did that on UIEnter.

Obviously I can change the order, but it seems less than ideal for neovim-gtk to hang when Guifont is invoked during startup. I should note that Neovim-Qt with 0.9.4 simply complains about the lack of Guifont, so it doesn't appear that this is an intrinsic limitation of newer versions of Neovim. If this isn't supported, an error is much more welcome than a hard-to-debug hang.

Error messages below:

[2023-12-06T00:08:21Z ERROR nvim_gtk::file_browser] Couldn't get cwd: Elapsed(())
[2023-12-06T00:08:21Z ERROR nvim_gtk::file_browser] Couldn't populate tree: No such file or directory (os error 2)
[2023-12-06T00:08:31Z ERROR nvim_gtk::subscriptions] Error manually running SubscriptionHandle { key: SubscriptionKey { event_name: "BufEnter", pattern: "*" }, index: 0 }
thread 'tokio-runtime-worker' panicked at 'Neovim request None timed out', src/nvim/ext.rs:45:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2023-12-06T00:08:41Z ERROR nvim_gtk::subscriptions] Error manually running SubscriptionHandle { key: SubscriptionKey { event_name: "BufEnter,BufFilePost,BufModifiedSet,DirChanged", pattern: "*" }, index: 0 }
thread 'tokio-runtime-worker' panicked at 'Neovim request None timed out', src/nvim/ext.rs:45:21
thread 'tokio-runtime-worker' panicked at 'Neovim request None timed out', src/nvim/ext.rs:45:21
thread 'tokio-runtime-worker' panicked at 'Neovim request None timed out', src/nvim/ext.rs:45:21
thread 'tokio-runtime-worker' panicked at 'Neovim request None timed out', src/nvim/ext.rs:45:21
thread 'tokio-runtime-worker' panicked at 'Neovim request None timed out', src/nvim/ext.rs:45:21
thread 'tokio-runtime-worker' panicked at 'Neovim request None timed out', src/nvim/ext.rs:45:21
[2023-12-06T00:08:51Z ERROR nvim_gtk::subscriptions] Error manually running SubscriptionHandle { key: SubscriptionKey { event_name: "OptionSet", pattern: "completeopt" }, index: 0 }
[2023-12-06T00:09:01Z ERROR nvim_gtk::subscriptions] Error manually running SubscriptionHandle { key: SubscriptionKey { event_name: "OptionSet", pattern: "background" }, index: 0 }
[2023-12-06T00:09:11Z ERROR nvim_gtk::subscriptions] Error manually running SubscriptionHandle { key: SubscriptionKey { event_name: "DirChanged", pattern: "*" }, index: 0 }
[2023-12-06T00:09:11Z ERROR nvim_gtk::error] Can't initialize nvim: TimeoutError(Elapsed(()))

.vimrc:

function! s:SetGUIOptions()
  " If we're in a Neovim GUI, such as Neovim-GTK…
  if has("nvim")
    Guifont SourceCodePro:h12
  endif
endfunction

if has("gui_running")
  call <SID>SetGUIOptions()
endif

Technical information (please complete the following information):

  • OS: Debian unstable and Ubuntu mantic (23.10)
  • Neovim version: 0.9.4 from Debian repository, Ubuntu nightly version from Ubuntu Neovim unstable PPA
  • Neovim-Gtk build version: 50f27f5a06582a7fb6b9fa03ca5f2d21d466c181 (current HEAD)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant