Closed jncorpron closed 4 years ago
Line annotations are phantoms with the LAYOUT_INLINE
flag which are added to the very last character of a line, so they are expected to always render after a line. It works well, if word wrapping is disabled. Therefore the default setting "auto" disables line annotations if word wrapping is enabled.
With "git_gutter_show_line_annotation": true
line annotations are added even if word wrapping is enabled and might cause the line annotation to be displayed at the next line as ST includes it into its word wrapping. This behavior can't be changed.
The cursor behavior is completely handled by ST core. Adding phantoms to empty lines makes the cursor behave badly as well, hence no annotations are displayed then. If you don't like the cursor's behavior you would need to file an issue at https://github.com/SublimeTextIssues/Core/issues. It can't be fixed from plugin side.
The "blame" information are gathered once and published as line annotations and can be added to the status bar. Both use jinja2 to enable the user to fully customize the output. Creating a dedicated plugin would therefore reduce the flexibility of status bar customization and require the whole infrastructure of calling git and parsing the output to be copied and maintained twice. Not worth the effort.
If the line annotations cause issues, you can disable them and try "Git Blame" package, which adds phantoms with the same info to the next line via key binding.
I'm not sure I understand all of the technical detail you replied with, but it sounds like the solution is that it's not fixable and my solution of turning line annotations off was the right one.
I'm fine with not using the feature, I just meant to let you all know that there was a bug. I'm okay with whatever resolution you'd like.
You understood correctly. The current solution is the best possible with the available core functions.
All "bugs" related with
are caused by the underlying phantom API being used to render line annotation.
This issue will be fixed for ST4 via annotations API.
🔢 Steps:
The 🐛 Bug: Both steps 5 & 6 cause the cursor to move to a position in the file where it would not, if the line annotation or GitGutter are disabled. This breaks the ease-of-use of most of the ST editing commands that use the ⬆️ up & ⬇️ down keys 😭 which is pretty essential for editing quickly (particularly when the cursor mysteriously jumps to the end of the file).
Maybe relevant info:
PS: the line annotation feature is interesting 👍, but it's also not obvious that GitGutter, "plugin to see git diff in gutter", is the plugin that adds annotations to the editor buffer. Maybe you should consider making this feature another, distinct plugin?