-
Notifications
You must be signed in to change notification settings - Fork 35
indentation: fix some issues #20
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
Conversation
Indent function declaration correctly (no indent) ``` f :: String -> String f ``` but indent if it's a type declaration ``` f :: String -> String ```
``` where f :: String -> String ``` Previously `f` was highlighted as an identifier, while if not on a line with where (or let) it is wrapped inside a `purescriptFunctionDecl` and highlighted in the same way as type signature.
|
And also fix a small syntax highlighting issue. |
```
where x :: Int
x = 0
```
and
```
let y :: Boolean
y = false
```
The purescriptFunctionDecl group has to finish on the second line. In
order to acomplish that provide two additional `purescriptFunctionDecl`
syntax region declarations.
This is fixes the regression introduced in the previous commit where
`purescriptFunctionDecl` extended over whole `where` / `let` blocks.
|
@Arthur-Xavier could you test the syntax highlighting for type declarations in |
Instead shift intendation on next line. Do that consistently for `}` and `]`.
``` newtype MInt = MInt Int -- this line will be indent but if empty and one presses <C-M> the next line will not ``` So tyyping `<C-M>` twice will reset indentation. This works for any declaration starting in the first colum, but still one can have indentent code if one starts a multi line declaration.
remove `g:` (it's not necessary)
|
Sorry for the late response; I had a really busy weekend and needed some spare time to look into this. Seems all right to me, couldn't detect any regressions. I tested against lots of source files both the syntax and the indent definitions (I lost my I noticed, however, a few problems with class, instance declarations and arrow operators (both type and term-level). I checked but these problems didn't come with any of your changes and they also didn't happen before. The color scheme I use also had no updates on PureScript syntax. I guess it must be a Vim thing or I don't know. Anyway, I'll file some issues and see if I can work on them later; or you if you'd like to. Thanks for the help! :) |
|
That ok, i had time to catch all kinks. Do you mean some problems with highlighting? I haven't followed vim dev closely, so it's hard to say. |
|
Yes. The one I'm sure there wasn't before is where arrow operators ( |
Indent function declaration correctly (no indent)
but indent if it's a type declaration