Skip to content

Commit

Permalink
Add back convenience imports
Browse files Browse the repository at this point in the history
having util hang around everywhere is germane to my development
experience. I use util.log a lot, heh.

Also the previous commit breaks the tests by altering a fixture
file, which should never be altered.
  • Loading branch information
aaronik committed Dec 18, 2024
1 parent afd341d commit 00e90cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lua/treewalker/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local nodes = require('treewalker.nodes')
local util = require('treewalker.util')
local ops = require('treewalker.ops')
local lines = require('treewalker.lines')
local strategies = require('treewalker.strategies')
Expand All @@ -16,7 +17,9 @@ Treewalker.opts = {

---@param opts Opts | nil
function Treewalker.setup(opts)
Treewalker.opts = vim.tbl_deep_extend('force', Treewalker.opts, opts or {})
if opts then
Treewalker.opts = vim.tbl_deep_extend('force', Treewalker.opts, opts)
end
end

---@return nil
Expand Down
1 change: 1 addition & 0 deletions lua/treewalker/strategies.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local lines = require('treewalker.lines')
local nodes = require('treewalker.nodes')
local util = require('treewalker.util')

---@alias Dir "up" | "down"

Expand Down
4 changes: 3 additions & 1 deletion tests/fixtures/lua.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local util = require('treewalker.util')

local M = {}

local NON_TARGET_NODE_MATCHERS = {
Expand Down Expand Up @@ -26,7 +28,7 @@ local function is_jump_target(node)
end

local function is_descendant_jump_target(node)
return vim.list_contains(TARGET_DESCENDANT_TYPES, node:type())
return util.contains(TARGET_DESCENDANT_TYPES, node:type())
end

---Do the nodes have the same starting point
Expand Down

0 comments on commit 00e90cf

Please sign in to comment.