git-blame.nvim
git-blame.nvim copied to clipboard
Align virtual text
This is a solid plugin. Very fast.
Small request: would it be possible to add an option have the virtual text right justify itself? Currently the text appears immediately following the line you are on, with a single space separating the physical EOL and the beginning of the virtual text. It would be nice if there were a way to adjust that.
I'm not sure I understood how you would like the text to be justified. Do you want more space or what? Do you know any vim plugins which display virtual text the way you want?
You can customize the message template with
let g:gitblame_message_template = 'format'
Please refer to this section of the README for more details. You can add as much spacing as you want (or a tab maybe). If this is what you wanted, please close the issue, if not, please explain with a little more details. Thanks!
So say your display is 100 characters wide. You have the following code:
puts “Hello”
I decide to have my format string set to “%a”, the abbreviated day name. Now, since our git-blame text will be three characters, the virtual text would start at column 97. Currently, it starts immediately after the final double quote, with a single space in between.
Looking over the documentation for virtual text, though, it looks like this may be something you would have to write: I didn’t see a native way for neocon to right justify virtual text. If that’s the case, that may be more trouble than it’s worth. If so, that’s fine, and I’ll just close this.
Ah, okay. There's an open issue (#11634) in neovim for native support of text alignment. I'm closing this issue now and will reopen once it's implemented in neovim (I've subscribed to that thread) just to keep issues clean. Thanks!
I wonder if the API is working as expected now in Neovim. Will need to check that :)
Checked it. Still the same :(
I'm gonna close this issue since I'm planning to implement into the plugin itself because Neovim lets you to position virtual text (see https://neovim.io/doc/user/api.html#nvim_buf_set_extmark()) and you can add optional arguments to nvim_buf_set_extmark
since c43b6bce173fb99e78561f75bd31d12027a0c644. "right_align"
was working incorrectly some time ago but perhaps it's fixed now.