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

feat(signs): enable staged signs by default #1039

Merged
merged 1 commit into from
Jun 13, 2024
Merged

Conversation

lewis6991
Copy link
Owner

No description provided.

@lewis6991 lewis6991 merged commit b8cf5e8 into main Jun 13, 2024
6 checks passed
@lewis6991 lewis6991 deleted the feat/signsstaged branch June 13, 2024 11:01
@lewis6991 lewis6991 changed the title feat(signs): able staged signs by default feat(signs): enable staged signs by default Jun 13, 2024
This was referenced Jun 13, 2024
antoineco added a commit to antoineco/dotfiles that referenced this pull request Jun 18, 2024
The behavior is on by default since lewis6991/gitsigns.nvim#1039, but it
doesn't work properly:

- nav_hunk() also jumps to staged hunks
- upon jumping to a staged hunk, its hl switches back from dim to bright
leiteg added a commit to leiteg/dotfiles that referenced this pull request Jun 19, 2024
This feature is now merged and enabled by default:

PR: lewis6991/gitsigns.nvim#1039
@danielebra
Copy link
Contributor

I was updating my plugins and noticed a significant behavioural change in gitsigns that might be related to this pull request.

I started seeing staged commits that previously displayed nothing in the gutter, were now displaying icons I did I was not using, such as the pipes for add.

It would have been beneficial if this change was highlighted in the sample config, with an explanation about the new signs_staged feature.

For example:

require('gitsigns').setup {
  signs = {
    add          = { text = '┃' },
    change       = { text = '┃' },
    delete       = { text = '_' },
    topdelete    = { text = '‾' },
    changedelete = { text = '~' },
    untracked    = { text = '┆' },
  },
  -- [Missing Section]
  -- Icons can be configured separately for staged content
  -- signs_staged = {
  --   add          = { text = '┃' },
  --   change       = { text = '┃' },
  --   delete       = { text = '_' },
  --   topdelete    = { text = '‾' },
  --   changedelete = { text = '~' },
  --   untracked    = { text = '┆' },
  -- },
  signcolumn = true,  -- Toggle with `:Gitsigns toggle_signs`
  numhl      = false, -- Toggle with `:Gitsigns toggle_numhl`
  linehl     = false, -- Toggle with `:Gitsigns toggle_linehl`
  word_diff  = false, -- Toggle with `:Gitsigns toggle_word_diff`
  watch_gitdir = {
    follow_files = true
  },
  auto_attach = true,
  attach_to_untracked = false,
  current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
  current_line_blame_opts = {
    virt_text = true,
    virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
    delay = 1000,
    ignore_whitespace = false,
    virt_text_priority = 100,
  },
  current_line_blame_formatter = '<author>, <author_time:%R> - <summary>',
  sign_priority = 6,
  update_debounce = 100,
  status_formatter = nil, -- Use default
  max_file_length = 40000, -- Disable if file is longer than this (in lines)
  preview_config = {
    -- Options passed to nvim_open_win
    border = 'single',
    style = 'minimal',
    relative = 'cursor',
    row = 0,
    col = 1
  },
}

It might have been smoother if the signs_staged icons were defaulted to the initialized icons in signs for a more seamless transition for existing configurations.

Thanks for all your open source contributions, I added the default entry to the read me in #1077

antoineco added a commit to antoineco/dotfiles that referenced this pull request Jul 29, 2024
The behavior is on by default since lewis6991/gitsigns.nvim#1039, but it
doesn't work properly:

- nav_hunk() also jumps to staged hunks
- upon jumping to a staged hunk, its hl switches back from dim to bright
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants