From 3362f4519671da29b437c48a7c54bec8550a4f9d Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Sun, 20 Sep 2020 23:20:37 +0200 Subject: Remove textobjects module --- lua/nvim-treesitter/textobjects/move.lua | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 lua/nvim-treesitter/textobjects/move.lua (limited to 'lua/nvim-treesitter/textobjects/move.lua') diff --git a/lua/nvim-treesitter/textobjects/move.lua b/lua/nvim-treesitter/textobjects/move.lua deleted file mode 100644 index 1dd2f132..00000000 --- a/lua/nvim-treesitter/textobjects/move.lua +++ /dev/null @@ -1,29 +0,0 @@ -local ts_utils = require'nvim-treesitter.ts_utils' -local shared = require'nvim-treesitter.textobjects.shared' -local attach = require'nvim-treesitter.textobjects.attach' - -local M = {} - -function M.goto_adjacent(query_string, forward, start, same_parent, overlapping_range_ok) - local bufnr, _, node = shared.textobject_at_point(query_string) - local adjacent = shared.get_adjacent(forward, node, query_string, same_parent, overlapping_range_ok, bufnr) - - ts_utils.goto_node(adjacent, not start) -end - --- luacheck: push ignore 631 -M.goto_next_start = function(query_string) M.goto_adjacent(query_string, 'forward', 'start', not 'same_parent', 'overlap ok') end -M.goto_next_end = function(query_string) M.goto_adjacent(query_string, 'forward', not 'start', not 'same_parent', 'overlap ok') end -M.goto_previous_start = function(query_string) M.goto_adjacent(query_string, not 'forward', 'start', not 'same_parent', 'overlap ok') end -M.goto_previous_end = function(query_string) M.goto_adjacent(query_string, not 'forward', not 'start', not 'same_parent', 'overlap ok') end --- luacheck: pop - -local normal_mode_functions = {"goto_next_start", - "goto_next_end", - "goto_previous_start", - "goto_previous_end"} - -M.attach = attach.make_attach(normal_mode_functions, "move") -M.deattach = attach.make_detach(normal_mode_functions, "move") - -return M -- cgit v1.2.3