mirror of
https://github.com/lewis6991/gitsigns.nvim
synced 2025-02-15 11:46:49 +00:00
feat!: change default of attached_to_untracked to false
This commit is contained in:
parent
300a306da9
commit
590d077c55
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -26,7 +26,7 @@ jobs:
|
||||
matrix:
|
||||
neovim_branch:
|
||||
- 'v0.8.3'
|
||||
- 'v0.9.2'
|
||||
- 'v0.9.5'
|
||||
- 'nightly'
|
||||
|
||||
env:
|
||||
|
4
Makefile
4
Makefile
@ -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
|
||||
|
@ -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.
|
||||
|
||||
|
@ -573,7 +573,7 @@ M.schema = {
|
||||
|
||||
attach_to_untracked = {
|
||||
type = 'boolean',
|
||||
default = true,
|
||||
default = false,
|
||||
description = [[
|
||||
Attach to untracked files.
|
||||
]],
|
||||
|
@ -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)
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user