Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not committed yet formatter #476

Closed
knpwrs opened this issue Feb 25, 2022 · 5 comments · Fixed by #524
Closed

Not committed yet formatter #476

knpwrs opened this issue Feb 25, 2022 · 5 comments · Fixed by #524
Labels
enhancement New feature or request

Comments

@knpwrs
Copy link

knpwrs commented Feb 25, 2022

I have current_line_blame_formatter = ' <author>, <author_time:%Y-%m-%d> - <summary>'. The symbol (from nerd fonts, it's a source control symbol) helps to distinguish the virtual text from gitsigns from other text. The virtual text which says Not Committed Yet doesn't have any distinguishing characteristics, it would be really nice to be able to configure it to say  Not Committed Yet instead.

@knpwrs knpwrs added the enhancement New feature or request label Feb 25, 2022
@lewis6991
Copy link
Owner

What do you propose?

@lewis6991
Copy link
Owner

Hmm, what about:

require('gitsigns').setup {
  ...
  current_line_blame_formatter = function(name, info)
    local text
    if info.author == 'Not Committed Yet' then
      text = ''..info.author
    else    
      local fmt = ' <author>, <author_time:%Y-%m-%d> - <summary>'
      text = require('gitsigns.utils').expand_blame_format(fmt, name, info)
    end

    return {{ text, 'GitSignsCurrentLineBlame' }}
  end
}

We would just need to expose expand_blame_format.

@knpwrs
Copy link
Author

knpwrs commented Feb 25, 2022

That would work for me! As long as it's documented.

@lewis6991
Copy link
Owner

@knpwrs I added config.current_line_blame_formatter_nc instead (in #524). Does this work for you?

@knpwrs
Copy link
Author

knpwrs commented Apr 14, 2022

Sure would!

lewis6991 added a commit that referenced this issue Apr 14, 2022
Used to format uncommitted lines.

Resolves: #476
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants