问题
Why is it that every time I save my file in Eclipse with Ctrl-S it moves the cursor to the top of the page I'm working on? Coincidentally, it moves the cursor to the top of the JavaScript section of an HTML page I am editing. It's really annoying. How do I stop it?
回答1:
Yep, was plagued by the same annoyance. In the eclipse preferences, select javascript then editor. On the editor preferences page there is a box, checked by default, called "Smart caret positioning in JavaScript names (overrides platform behavior)". Uncheck it.
回答2:
I've got into the habit of hitting ctrl+Q immediately after ctrl+S This brings you back to the last edited location.
Not so much a solution as a workaround, but it has stopped me pulling my hair out nonetheless.
S.
来源:https://stackoverflow.com/questions/10083077/ctrl-s-moves-the-cursor-near-the-top-of-the-document-in-eclipse