diff --git a/README.md b/README.md index 36cf4ac..43e82e6 100644 --- a/README.md +++ b/README.md @@ -121,16 +121,6 @@ require("nvim-paredit").setup({ -- This is the inverse of `get_node_root` for forms and should find the inner node for which -- the forms elements are direct children. -- - -- In some languages (i.e. clojure) elements consists of several parts - -- keyword has up to three parts - -- :foo/hello is represented as: - -- kwd_lit (":") - -- namespace: kwd_ns ("foo") - -- name: kwd_name ("hello") - -- this function should return whole element, in this case kwd_lit - element_lit = function(node) - end, - -- -- For example given the node `'()` or 'quoting_lit', this function should return `()` or 'list_lit'. unwrap_form = function(node) end, diff --git a/lua/nvim-paredit/api/wrap.lua b/lua/nvim-paredit/api/wrap.lua index c21a68d..970b477 100644 --- a/lua/nvim-paredit/api/wrap.lua +++ b/lua/nvim-paredit/api/wrap.lua @@ -13,7 +13,7 @@ end function M.find_element_under_cursor(lang) local node = ts.get_node_at_cursor() if lang.element_lit then - return lang.element_lit(node) + return lang.get_node_root(node) end return node end diff --git a/lua/nvim-paredit/lang/clojure.lua b/lua/nvim-paredit/lang/clojure.lua index ab64e9c..a4aa10a 100644 --- a/lua/nvim-paredit/lang/clojure.lua +++ b/lua/nvim-paredit/lang/clojure.lua @@ -36,16 +36,6 @@ function M.get_node_root(node) return traversal.find_root_element_relative_to(root, node) end -function M.element_lit(node) - local lit = node - if lit then - if not lit:type():match("lit$") then - lit = M.element_lit(lit:parent()) - end - end - return lit -end - function M.unwrap_form(node) if common.included_in_table(form_types, node:type()) then return node