-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into jv/add-fennel-extension
- Loading branch information
Showing
12 changed files
with
703 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
local common = require("nvim-paredit.utils.common") | ||
|
||
local M = {} | ||
|
||
M.config = {} | ||
|
||
function M.update_config(config) | ||
M.config = common.merge(M.config, config) | ||
M.config = vim.tbl_deep_extend("force", M.config, config) | ||
end | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
local config = require("nvim-paredit.config") | ||
|
||
local M = {} | ||
|
||
function M.handle_indentation(event, opts) | ||
local indent = opts.indent or config.config.indent or {} | ||
if not indent.enabled or not indent.indentor then | ||
return | ||
end | ||
|
||
local tree = vim.treesitter.get_parser(0) | ||
|
||
tree:parse() | ||
local parent = tree:named_node_for_range(event.parent_range) | ||
|
||
indent.indentor( | ||
vim.tbl_deep_extend("force", event, { | ||
tree = tree, | ||
parent = parent, | ||
}), | ||
vim.tbl_deep_extend("force", opts, { | ||
indent = indent, | ||
}) | ||
) | ||
end | ||
|
||
return M |
Oops, something went wrong.