stylish-haskell
stylish-haskell copied to clipboard
`:%!stylish-haskell` jumps cursor to top of file
Reproduce:
Execute :%!stylish-haskell
or :call HaskellFormat('stylish')
on a file.
Issue:
Cursor jumps to the top of the file.
This isn't really an issue with stylish-haskell
, it's an issue with vim formatters that act as whole-file filters. They'll all do that.
You can work around it by setting a mark with m
, running stylish-haskell, and then jumping back to the mark with '
. My command is:
" Run stylish haskell on the file
nnoremap <leader>hs ms:%!stylish-haskell<cr>'s
@parsonsmatt I think this hint is worth adding to readme, right?
I didn't figure this out until I saw this issue and investigated myself, but it had low-level bothered me until then :sweat_smile: