diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d85ea04d9..89def82c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: matrix: neovim_branch: - 'v0.8.3' - - 'v0.9.2' + - 'v0.9.5' - 'nightly' env: diff --git a/Makefile b/Makefile index 1328da900..4c99cee24 100644 --- a/Makefile +++ b/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 diff --git a/doc/gitsigns.txt b/doc/gitsigns.txt index 565075bb7..98c82c266 100644 --- a/doc/gitsigns.txt +++ b/doc/gitsigns.txt @@ -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. diff --git a/lua/gitsigns/config.lua b/lua/gitsigns/config.lua index 096de069d..02fb6ecab 100644 --- a/lua/gitsigns/config.lua +++ b/lua/gitsigns/config.lua @@ -573,7 +573,7 @@ M.schema = { attach_to_untracked = { type = 'boolean', - default = true, + default = false, description = [[ Attach to untracked files. ]], diff --git a/test/gitsigns_spec.lua b/test/gitsigns_spec.lua index 62df8b300..2f6636271 100644 --- a/test/gitsigns_spec.lua +++ b/test/gitsigns_spec.lua @@ -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) diff --git a/test/gs_helpers.lua b/test/gs_helpers.lua index 90504bda4..8bb7f1567 100644 --- a/test/gs_helpers.lua +++ b/test/gs_helpers.lua @@ -36,6 +36,7 @@ M.test_config = { { 'n', 'mhS', 'lua require"gitsigns".stage_buffer()' }, { 'n', 'mhU', 'lua require"gitsigns".reset_buffer_index()' }, }, + attach_to_untracked = true, _extmark_signs = extmark_signs, update_debounce = 5, } diff --git a/test/highlights_spec.lua b/test/highlights_spec.lua index badfd40d0..c2c0d0818 100644 --- a/test/highlights_spec.lua +++ b/test/highlights_spec.lua @@ -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) diff --git a/test/screen.lua b/test/screen.lua index 691e3204d..5002ec503 100644 --- a/test/screen.lua +++ b/test/screen.lua @@ -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