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

Conflicting issue with Neovim plugin #84

Closed
viegasfh opened this issue Oct 20, 2020 · 5 comments
Closed

Conflicting issue with Neovim plugin #84

viegasfh opened this issue Oct 20, 2020 · 5 comments
Labels
bug Something isn't working microsofts-problem The issue is caused by one in vscode, with no workaround available yet

Comments

@viegasfh
Copy link

Hi!

I have neovim plugin for vscode installed and when I load any fountain file I get the following error message:

Unable to init vscode-neovim: command 'type' already exists

This happens when I right-click and click on open a fountain file with visual studio code. If I load Visual Studio Code without opening the fountain file, I don't get this message, but I presume somehow the type command is affected in betterfountain?

What exactly does the type command do in the BetterFountain plugin? Is there a way to workaround this so that both can work together without affecting one another? The suggestion from the vscode-neovim plugin is to disable any extension that registers the type command. But, obviously, I don't want to do this, because I love working with both neovim and betterfountain together.

I hope there is a workaround for this.

@piersdeseilligny
Copy link
Owner

So the issue is that betterfountain registers the type command here: https://github.com/piersdeseilligny/betterfountain/blob/master/src/extension.ts#L229 in order to automatically skip to the next line when you press enter within a parenthetical. For example, if you're at the end of a fountain document writing dialogue (as is very often the case), and have just finished writing a parenthetical, the caret would be positioned as such:

ALICE
(screaming❚)

because the extension also automatically adds a ) after the caret when you type a (.
In this situation, because the ) was automatically inserted (and it should be) pressing on enter should skip to the next line as such:

ALICE
(screaming)
❚

rather than

ALICE
(screaming
❚)

which would be the default behaviour.

The point is, I'm not sure if there's any way of getting this behaviour without registering the type command (which stupidly only one extension can do at a time).

I guess I could add a setting to disable this feature if you want to, but that's not really ideal? I'il look into what can be done later today.

@viegasfh
Copy link
Author

viegasfh commented Oct 20, 2020

Thanks for the explanation!

I noticed by disabling the vscode-neovim plugin that what I lose in addition to the parenthetical is the autocomplete features, which is ok, as one can always do that with neovim.

VSCode should allow for more than one plugin to register the type command, indeed.

It it is possible to detect whether the vscode-neovim plugin is installed and disable the type command in betterfountain, and if it is not too much work, then it would be nice, as I guess I can emulate them with neovim. I can find a workaround. But if it is not, then don't bother. I will load VSCode first and then open the fountain file.

Thanks for your time!

@viegasfh
Copy link
Author

I found this discussion microsoft/vscode#13441, where they say that having multiple extensions register the type command is something they haven't considered. Apparently, Atom is able to handle this.

@piersdeseilligny
Copy link
Owner

@viegasfh BetterFountain 1.6.11 (now in the marketplace) fixes this issue! You can now disable the following setting:

image

which will allow vim emulators to register the type command without any conflict. If that setting is enabled, and BetterFountain fails to register the type command, it will display a warning that it failed to do so, but will still activate.

@piersdeseilligny piersdeseilligny added bug Something isn't working microsofts-problem The issue is caused by one in vscode, with no workaround available yet labels Nov 8, 2020
@viegasfh
Copy link
Author

Thanks a lot, Piers! Working perfectly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working microsofts-problem The issue is caused by one in vscode, with no workaround available yet
Projects
None yet
Development

No branches or pull requests

2 participants