avh4/elm-format

Vim Integration seems to mess with how vim redraws the screen after a save.

Open

#93 geöffnet am 31. Dez. 2015

Auf GitHub ansehen
 (11 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Haskell (148 Forks)batch import
IDE integrationhelp wanted

Repository-Metriken

Stars
 (1.329 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

I'm using elm-format ( elm-format 0.1-alpha3-dev ) with vim like this:

autocmd BufWritePost *.elm silent execute "!elm-format --yes %" | edit! | set filetype=elm

But on saving my display gets kind of messed up. Not really sure if this is a vim bug or something to do with elm-format, but when the format command exits the file gets redrawn sort of weird, everything gets shifted up a line. here's a screenshot of before saving:

conrad_ tmux _176x56

And now after saving:

broke

I can fix my screen by running :redraw!.

redrawn

I've found that I can get around this issue by adding > /dev/null to the end of the format command:

autocmd BufWritePost *.elm silent execute "!elm-format --yes % > /dev/null" | edit! | set filetype=elm

I feel like there is a more correct fix out there, or there is something else wrong with my vim configuration. Why is this happening? What's the right way to fix this?

Contributor Guide