Before it was trying to add the text outside of the buffer when the GIT_COMMIT_MSG buffer was invoked by lazygit. The buffer looks a bit different for some reason but it's still a GIT_COMMIT_MSG buffer.
This way the string is added right on top of the line you're currently located and it works either on a buffer created by git commit or the lazygit one.
What/How/Why
Fixes: https://github.com/2KAbhishek/co-author.nvim/issues/5
Before it was trying to add the text outside of the buffer when the GIT_COMMIT_MSG buffer was invoked by lazygit. The buffer looks a bit different for some reason but it's still a GIT_COMMIT_MSG buffer.
This way the string is added right on top of the line you're currently located and it works either on a buffer created by git commit or the lazygit one.
Screenshots
LazyGit
Selecting co-author for commit
The author is added below the current line
git commit
Selecting co-author for commit
The author is added below the current line