Set window margin before command is completed
Fix case that buffer is switched before command is completed
Update comment to git-gutter
Re-factoring

- reduce local variable
- separate function
- don't calculate twice