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

Add nvim-qt to editor presets #4171

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pedersorensen
Copy link

  • PR Description
    This PR adds nvim-qt to the list of editor presets.
    I've only tested this on Windows where escaping from the terminal can be handy at times. Not sure if this makes sense in a Mac of Linux environment, but nvim-qt looks quite ubiquitous there as well.

  • Please check if the PR fulfills these requirements

  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

@pedersorensen pedersorensen force-pushed the feature/nvim-qt_editor_preset branch 2 times, most recently from b2dba03 to a57a6ff Compare January 21, 2025 07:36
@pedersorensen pedersorensen force-pushed the feature/nvim-qt_editor_preset branch from a57a6ff to 24ccd3a Compare January 29, 2025 06:16
@pedersorensen
Copy link
Author

Hi @jesseduffield
I'm not quite sure on the protocol here. Should I have raised an issue before (blindly) submitting this PR? Or contact you in some other way? I'm still quite new to this open source contribution thing.

@stefanhaller
Copy link
Collaborator

No, you did everything right. Sometimes PRs don't get any feedback for some reason or another; maybe the maintainers were busy at the time and then forgot to get back to it later (that's definitely true for me in this case, anyway). In such a case it's totally appropriate to gently ping them after a few days or a week.

As for the change itself: it doesn't seem quite right to me. Neovim-qt is a GUI application, isn't it? The standardTerminalEditorPreset convenience function you are using is for command-line editors that take over the terminal; for nvim-qt it seems that you need something more along the lines of what we do for sublime. For the editAtLineAndWaitTemplate value it seems that you can use the --nofork option, though I'm not familiar enough with neovim to tell whether that's totally appropriate.

@pedersorensen pedersorensen force-pushed the feature/nvim-qt_editor_preset branch 3 times, most recently from 33fe596 to 0feb655 Compare January 30, 2025 07:21
@pedersorensen
Copy link
Author

Thanks Stefan
I've tried to add your suggestion, though I'm not quite sure in which circumstances the editAtLineAndWaitTemplate it being used. I haven't been able to trigger opening the editor with that template, I always seem to get the output of editAtLineTemplate regardless of how I open a file.

@pedersorensen pedersorensen force-pushed the feature/nvim-qt_editor_preset branch from 0feb655 to 771f2f9 Compare January 30, 2025 07:28
@pedersorensen pedersorensen force-pushed the feature/nvim-qt_editor_preset branch from 771f2f9 to 9a4ffe4 Compare January 30, 2025 07:32
@stefanhaller
Copy link
Collaborator

editAtLineAndWait is currently only used for the "Edit Hunk" command (shift-E in the staging view).

I tried the new version, and I'm afraid it doesn't work, but I don't understand why. When using e on a file, nvim-qt opens without lazygit suspending itself, which is good; but then lazygit is unresponsive, as if the nvim-qt command didn't return. I don't understand this, because when typing nvim-qt -- somefile in the shell, it does return to the shell prompt immediately. This needs more digging.

Same for Edit Hunk: it does suspend to the terminal in that case (good), but when closing the editor window it doesn't come back. Again, I don't understand why.

And finally, the overall experience is not what I would expect (comparing to vscode or sublime). If I have nvim-qt open already, I'd expect the file to be opened as a new buffer in that instance, but it spawns a new instance and opens the file there. This doesn't seem useful when I want to use neovim as an IDE. Do we need --server to achieve that? But I'm not familiar enough with neovim or its typical workflows to tell what's expected here.

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

Successfully merging this pull request may close these issues.

2 participants