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

Multiline Generic Declarations: Broken indentation + other problems #24

Open
pappasam opened this issue Jan 25, 2020 · 1 comment
Open

Comments

@pappasam
Copy link
Contributor

Thanks for this great plugin!

I've noticed that for users writing multi-line generics, the indentation inserts unnecessary characters. into the editor. There are obviously other problems here regarding multi-line / nested generics (notice that the syntax coloring is different that the single-line version), but please see below for a true workflow blocker. Any idea how to fix this?

GenericBugs

@pappasam
Copy link
Contributor Author

pappasam commented Jan 26, 2020

I've fixed the annoying auto-insertion in my vimrc. This results from the fact that the vim "comments" option is never set. It defaults to treating ">" as a comment string. My hacky personal fix: set the value of "comments" to the same as C:

autocmd FileType typescript.tsx setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://

I recommend putting some thought into the ideal value for "comment" and providing that to users. If you want to use my example, by all means 😺

Now, it'd be nice if we could fix the indentation of the closing ">" on multiline strings, and potentially fix the indentation of the closing ")". Not quite sure how to go about doing that.

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