jsformat-atom icon indicating copy to clipboard operation
jsformat-atom copied to clipboard

Cursor moved to top of window on format

Open Gruntfuggly opened this issue 9 years ago • 0 comments

Sometimes (often) when the document is formatted (on save) the cursor is moved to the top of the window. I assume this is because the whole file is 'selected' for formatting, because if I undo the cursor positions it goes back to the bottom of the page and then back to the original position.

It's not the end of the world, but gets quite irritating.

Apart from that I much prefer jsformat over atom-beautify - thanks!

I can fix this temporarily by changing line 73 in lib/format.coffee to

mainCursor.setBufferPosition(currentCursorPosition)

but I suspect this may break formatting of selections?

Gruntfuggly avatar Feb 24 '16 10:02 Gruntfuggly