refactor: format with stylua
This commit is contained in:
parent
e2d177b480
commit
440acf7900
@ -7,7 +7,7 @@
|
|||||||
---@field private _tree_utils table<string, function> Treesitter utilities for the given filetype
|
---@field private _tree_utils table<string, function> Treesitter utilities for the given filetype
|
||||||
---@field private _fallback_pattern string Pattern to search for if treesitter parser fails
|
---@field private _fallback_pattern string Pattern to search for if treesitter parser fails
|
||||||
local VirtualIndent = {
|
local VirtualIndent = {
|
||||||
_ns_id = vim.api.nvim_create_namespace "VirtIndent",
|
_ns_id = vim.api.nvim_create_namespace("VirtIndent"),
|
||||||
_bufnrs = {},
|
_bufnrs = {},
|
||||||
}
|
}
|
||||||
VirtualIndent.__index = VirtualIndent
|
VirtualIndent.__index = VirtualIndent
|
||||||
@ -20,11 +20,11 @@ function VirtualIndent:new(bufnr)
|
|||||||
-- TODO: Improve organization of this, ideally should be a separate module that returns these.
|
-- TODO: Improve organization of this, ideally should be a separate module that returns these.
|
||||||
local ft_settings = {
|
local ft_settings = {
|
||||||
markdown = {
|
markdown = {
|
||||||
utils = require "vindent.treesitter.markdown",
|
utils = require("vindent.treesitter.markdown"),
|
||||||
fallback_pattern = "^%#+",
|
fallback_pattern = "^%#+",
|
||||||
},
|
},
|
||||||
org = {
|
org = {
|
||||||
utils = require "vindent.treesitter.org",
|
utils = require("vindent.treesitter.org"),
|
||||||
fallback_pattern = "^%*+",
|
fallback_pattern = "^%*+",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ function VirtualIndent:_get_indent_size(line, ts_has_errors, ts_fallback_pat)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local headline = self._tree_utils.closest_headline_node { line + 1, 1 }
|
local headline = self._tree_utils.closest_headline_node({ line + 1, 1 })
|
||||||
|
|
||||||
if headline then
|
if headline then
|
||||||
local headline_line = headline:start()
|
local headline_line = headline:start()
|
||||||
@ -102,7 +102,7 @@ end
|
|||||||
---@param ignore_ts? boolean whether or not to skip the treesitter start & end lookup
|
---@param ignore_ts? boolean whether or not to skip the treesitter start & end lookup
|
||||||
function VirtualIndent:set_indent(start_line, end_line, ignore_ts)
|
function VirtualIndent:set_indent(start_line, end_line, ignore_ts)
|
||||||
ignore_ts = ignore_ts or false
|
ignore_ts = ignore_ts or false
|
||||||
local headline = self._tree_utils.closest_headline_node { start_line + 1, 1 }
|
local headline = self._tree_utils.closest_headline_node({ start_line + 1, 1 })
|
||||||
if headline and not ignore_ts then
|
if headline and not ignore_ts then
|
||||||
local parent = headline:parent()
|
local parent = headline:parent()
|
||||||
if parent then
|
if parent then
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
line_endings = "Unix"
|
line_endings = "Unix"
|
||||||
indent_type = "Spaces"
|
indent_type = "Spaces"
|
||||||
indent_width = 2
|
indent_width = 2
|
||||||
no_call_parentheses = true
|
no_call_parentheses = false
|
||||||
|
Loading…
Reference in New Issue
Block a user