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

Improve indenting for filetype typescript.tsx #62

Closed
fleischie opened this issue Jun 7, 2019 · 4 comments
Closed

Improve indenting for filetype typescript.tsx #62

fleischie opened this issue Jun 7, 2019 · 4 comments

Comments

@fleischie
Copy link
Collaborator

The indenting in non-styled sections is not working, especially when in tsx sections:

Current behavior:

Screen Shot 2019-06-07 at 14 31 19

Somwhat desired behavior:

Screen Shot 2019-06-07 at 14 31 40

@sheerun
Copy link

sheerun commented Sep 6, 2019

The fix should look something like this to also account for vim-jsx-pretty plugin:

if &filetype =~ '^typescript' && exists('*GetTsxIndent')
  let s:JsIndentFunction = function('GetTsxIndent')
elseif &filetype =~ '^typescript' && exists('*GetTypescriptIndent')
  let s:JsIndentFunction = function('GetTypescriptIndent')
elseif exists('*GetJsxIndent')
  let s:JsIndentFunction = function('GetJsxIndent')
elseif exists('*GetJavascriptIndent')
  let s:JsIndentFunction = function('GetJavascriptIndent')
elseif exists('*GetJsIndent')
  let s:JsIndentFunction = function('GetJsIndent')
end

@fleischie
Copy link
Collaborator Author

Oh hey, thanks @sheerun for the hint. I might try it out whenever I feel like I can spare the moment. 🙇👍

@kira-krul
Copy link

I believe the issue is fixed and can be closed?

@Jayphen
Copy link

Jayphen commented Mar 10, 2020

@sheerun Where should one put the above if/else block in order to fix this?

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

4 participants