Skip to content

Commit

Permalink
Change default highlight_group
Browse files Browse the repository at this point in the history
As I changed colorschemes, I started to notice that CursorLine was the
default color I was originally going for. ColorColumn happened to be the
right one on the colorschemes I had been using, but it wasn't right
across a broader spectrum of colorschemes.

This change may introduce a change to users; I hope it isn't too
jarring. My rationale is twofold:

* the readme suggests using the plugin with hard coded defaults, so many
  users may be doing this, which means this change won't affect them
* CursorLine is the same color as ColorColumn for many colorschemes

Hopefully this ends up being an improvement.
  • Loading branch information
aaronik committed Jan 2, 2025
1 parent 6f801c5 commit 2ed3d5c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The swap commands intelligently swap nodes, including comments and attributes/de

-- The color of the above highlight. Must be a valid vim highlight group.
-- (see :h highlight-group for options)
highlight_group = 'ColorColumn',
highlight_group = 'CursorLine',
}
}
```
Expand All @@ -79,7 +79,7 @@ use {

-- The color of the above highlight. Must be a valid vim highlight group.
-- (see :h highlight-group for options)
highlight_group = 'ColorColumn',
highlight_group = 'CursorLine',
})
end
}
Expand All @@ -90,7 +90,7 @@ use {
Plug 'aaronik/treewalker.nvim'
" This line is optional
:lua require('treewalker').setup({ highlight = true, highlight_duration = 250, highlight_group = 'ColorColumn' })
:lua require('treewalker').setup({ highlight = true, highlight_duration = 250, highlight_group = 'CursorLine' })
```

---
Expand Down
2 changes: 1 addition & 1 deletion lua/treewalker/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local Treewalker = {}
Treewalker.opts = {
highlight = true,
highlight_duration = 250,
highlight_group = "ColorColumn",
highlight_group = "CursorLine",
}

-- This does not need to be called for Treewalker to work. The defaults are preinitialized and aim to be sane.
Expand Down
2 changes: 1 addition & 1 deletion tests/treewalker/highlight_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe("Highlights in a regular lua file: ", function()
tw.setup({ highlight = true, highlight_duration = 250 })
tw.move_down()
local hl_group_arg = highlight_stub.calls[1].refs[3]
assert.equal("ColorColumn", hl_group_arg)
assert.equal("CursorLine", hl_group_arg)
end)

it("respects highlight_group config option", function()
Expand Down

0 comments on commit 2ed3d5c

Please sign in to comment.