diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2022-04-18 15:28:24 +0200 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-04-18 15:36:28 +0200 |
| commit | 2248b64781eb303e2eb85342d4860210adc36213 (patch) | |
| tree | 63312b5428b7e6f8b0b1fbb2f717b9acc4564664 /lua/nvim-treesitter.lua | |
| parent | chore!: remove filetype detection and filetype plugins (diff) | |
| download | nvim-treesitter-2248b64781eb303e2eb85342d4860210adc36213.tar nvim-treesitter-2248b64781eb303e2eb85342d4860210adc36213.tar.gz nvim-treesitter-2248b64781eb303e2eb85342d4860210adc36213.tar.bz2 nvim-treesitter-2248b64781eb303e2eb85342d4860210adc36213.tar.lz nvim-treesitter-2248b64781eb303e2eb85342d4860210adc36213.tar.xz nvim-treesitter-2248b64781eb303e2eb85342d4860210adc36213.tar.zst nvim-treesitter-2248b64781eb303e2eb85342d4860210adc36213.zip | |
fix(statusline): don't use deprecated function
Diffstat (limited to 'lua/nvim-treesitter.lua')
| -rw-r--r-- | lua/nvim-treesitter.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lua/nvim-treesitter.lua b/lua/nvim-treesitter.lua index f6282988e..d4771cea8 100644 --- a/lua/nvim-treesitter.lua +++ b/lua/nvim-treesitter.lua @@ -1,9 +1,9 @@ local install = require "nvim-treesitter.install" local utils = require "nvim-treesitter.utils" -local ts_utils = require "nvim-treesitter.ts_utils" local info = require "nvim-treesitter.info" local configs = require "nvim-treesitter.configs" local parsers = require "nvim-treesitter.parsers" +local ts_query = vim.treesitter.query -- Registers all query predicates require "nvim-treesitter.query_predicates" @@ -33,7 +33,7 @@ local get_line_for_node = function(node, type_patterns, transform_fn) if not is_valid then return "" end - local line = transform_fn(vim.trim(ts_utils.get_node_text(node)[1] or "")) + local line = transform_fn(vim.trim(ts_query.get_node_text(node)[1] or "")) -- Escape % to avoid statusline to evaluate content as expression return line:gsub("%%", "%%%%") end @@ -56,7 +56,7 @@ function M.statusline(opts) local transform_fn = options.transform_fn or transform_line local separator = options.separator or " -> " - local current_node = ts_utils.get_node_at_cursor() + local current_node = ts_query.get_node_at_cursor() if not current_node then return "" end |
