feat!: change default of attached_to_untracked to false

This commit is contained in:
Lewis Russell 2024-01-25 15:54:18 +00:00 committed by Lewis Russell
parent 300a306da9
commit 590d077c55
8 changed files with 39 additions and 14 deletions

View File

@ -26,7 +26,7 @@ jobs:
matrix:
neovim_branch:
- 'v0.8.3'
- 'v0.9.2'
- 'v0.9.5'
- 'nightly'
env:

View File

@ -3,8 +3,8 @@ export PJ_ROOT=$(PWD)
FILTER ?= .*
NVIM_RUNNER_VERSION := v0.9.1
NVIM_TEST_VERSION ?= v0.9.1
NVIM_RUNNER_VERSION := v0.9.5
NVIM_TEST_VERSION ?= v0.9.5
ifeq ($(shell uname -s),Darwin)
UNAME ?= MACOS

View File

@ -720,7 +720,7 @@ auto_attach *gitsigns-config-auto_attach*
Automatically attach to files.
attach_to_untracked *gitsigns-config-attach_to_untracked*
Type: `boolean`, Default: `true`
Type: `boolean`, Default: `false`
Attach to untracked files.

View File

@ -573,7 +573,7 @@ M.schema = {
attach_to_untracked = {
type = 'boolean',
default = true,
default = false,
description = [[
Attach to untracked files.
]],

View File

@ -42,24 +42,29 @@ describe('gitsigns (with screen)', function()
screen = Screen.new(20, 17)
screen:attach({ ext_messages = true })
screen:set_default_attr_ids({
local default_attrs = {
[1] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.WebGray },
[2] = { background = Screen.colors.LightMagenta },
[2] = { foreground = Screen.colors.NvimDarkCyan },
[3] = { background = Screen.colors.LightBlue },
[4] = { background = Screen.colors.LightCyan1, bold = true, foreground = Screen.colors.Blue1 },
[4] = { foreground = Screen.colors.NvimDarkRed },
[5] = { foreground = Screen.colors.Brown },
[6] = { foreground = Screen.colors.Blue1, bold = true },
[7] = { bold = true },
[8] = { foreground = Screen.colors.White, background = Screen.colors.Red },
[9] = { foreground = Screen.colors.SeaGreen, bold = true },
[10] = { foreground = Screen.colors.Red },
})
}
-- Use the classic vim colorscheme, not the new defaults in nvim >= 0.10
if fn.has('nvim-0.10') > 0 then
command('colorscheme vim')
else
default_attrs[2] = { background = Screen.colors.LightMagenta }
default_attrs[4] = { background = Screen.colors.LightCyan1, bold = true, foreground = Screen.colors.Blue1 }
end
screen:set_default_attr_ids(default_attrs)
-- Make gitsigns available
exec_lua('package.path = ...', package.path)
config = vim.deepcopy(test_config)

View File

@ -36,6 +36,7 @@ M.test_config = {
{ 'n', 'mhS', '<cmd>lua require"gitsigns".stage_buffer()<CR>' },
{ 'n', 'mhU', '<cmd>lua require"gitsigns".reset_buffer_index()<CR>' },
},
attach_to_untracked = true,
_extmark_signs = extmark_signs,
update_debounce = 5,
}

View File

@ -23,17 +23,27 @@ describe('highlights', function()
screen = Screen.new(20, 17)
screen:attach()
screen:set_default_attr_ids({
local default_attrs = {
[1] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.WebGray },
[2] = { background = Screen.colors.LightMagenta },
[2] = { foreground = Screen.colors.NvimDarkCyan },
[3] = { background = Screen.colors.LightBlue },
[4] = { background = Screen.colors.LightCyan1, bold = true, foreground = Screen.colors.Blue1 },
[4] = { foreground = Screen.colors.NvimDarkRed },
[5] = { foreground = Screen.colors.Brown },
[6] = { foreground = Screen.colors.Blue1, bold = true },
[7] = { bold = true },
[8] = { foreground = Screen.colors.White, background = Screen.colors.Red },
[9] = { foreground = Screen.colors.SeaGreen, bold = true },
})
}
-- Use the classic vim colorscheme, not the new defaults in nvim >= 0.10
if helpers.fn.has('nvim-0.10') > 0 then
command('colorscheme vim')
else
default_attrs[2] = { background = Screen.colors.LightMagenta }
default_attrs[4] = { background = Screen.colors.LightCyan1, bold = true, foreground = Screen.colors.Blue1 }
end
screen:set_default_attr_ids(default_attrs)
-- Make gitisigns available
exec_lua('package.path = ...', package.path)
@ -59,6 +69,8 @@ describe('highlights', function()
setup_gitsigns(config)
local nvim10 = helpers.fn.has('nvim-0.10') > 0
expectf(function()
match_dag({
p('Deriving GitSignsAdd from DiffAdd'),
@ -66,7 +78,10 @@ describe('highlights', function()
p('Deriving GitSignsAddNr from GitSignsAdd'),
p('Deriving GitSignsChangeLn from DiffChange'),
p('Deriving GitSignsChangeNr from GitSignsChange'),
p('Deriving GitSignsDelete from DiffDelete'),
-- TODO(lewis6991): huh?
nvim10 and
p('Deriving GitSignsDelete from Removed') or
p('Deriving GitSignsDelete from DiffDelete'),
p('Deriving GitSignsDeleteNr from GitSignsDelete'),
})
end)

View File

@ -1084,6 +1084,10 @@ function Screen:_handle_option_set(name, value)
self.options[name] = value
end
function Screen:_handle_chdir(path)
self.pwd = vim.fs.normalize(path, { expand_env = false })
end
function Screen:_handle_popupmenu_show(items, selected, row, col, grid)
self.popupmenu = { items = items, pos = selected, anchor = { grid, row, col } }
end