travisjeffery / ClangFormat-Xcode

Xcode plug-in to to use clang-format from in Xcode and consistently format your code with Clang
https://twitter.com/travisjeffery
MIT License
2.89k stars 288 forks source link

Xcode scrolling on format. #78

Closed Falven closed 3 years ago

Falven commented 9 years ago

For those of us who use format on save, the fact that Xcode will scroll around the file when we save is a big distraction and problem. Don't know much about Xcode plugins, but could there be a conceivable way of preventing Xcode from scrolling around to a random place in the code when formatting? Or at least a hack-ish way where Xcode scrolls back to where your viewport was before it scrolled?

scottsykora commented 8 years ago

I second this issue. I'd love to see a fish for this, it is pretty disorienting every time i subconsciously hit command-s. I'm running Xcode 6.4 and seeing this.

scottsykora commented 8 years ago

Actually, I've found that this isn' an issue when the cursor is within the current scrolled to section of the file. If the cursor is outside then the formatter scrolls the window to the cursor, which is unexpected and disorienting.

travisjeffery commented 3 years ago

93