GoSublime icon indicating copy to clipboard operation
GoSublime copied to clipboard

GoSublime moves cursors place in file on save

Open aar10n opened this issue 7 years ago • 3 comments

I have a medium sized Go file (~350 lines) and I find that whenever I save the file, first ST3 freezes for a second (for which I don't think it should for a relatively small file) but then in addition to that, it moves my cursor to the top of the file. This is unbelievably annoying, because if I'm working at the end of, or even midway through the file, after a save, I have to backtrack and find my spot again.

My question is: How do I stop this behaviour (and make the mouse stay in place) and also: Can I optimize GoSublime at all to prevent slowness on saving?

aar10n avatar May 06 '18 03:05 aar10n

I'm gonna need some actual way to reproduce this (settings, versions, relevant console output, etc.). GoSublime doesn't run any command on save unless you choose to do so and even goes so far as to patch the changes into the view to avoid all the issues you're seeing.

DisposaBoy avatar May 06 '18 08:05 DisposaBoy

So I disabled the "fmt_enabled" option and the problem is not happening anymore. That is the only configuration option I'm using. As for console output, there is none on save. There's not too much else to say other than using the formatting option caused the problem.

aar10n avatar May 06 '18 12:05 aar10n

Without a way to reproduce it, there's not much that I can do to help.

Maybe try updating to the alpha version of margo by switching to the development branch. You'll need to make sure you're installing via git https://github.com/DisposaBoy/GoSublime#installation then it's a simple git checkout development and then restarting Sublime Text. It will advise you to press ctrl+.,ctrl+x. The comments in the file should hopefully be clear enough.

DisposaBoy avatar May 07 '18 09:05 DisposaBoy