-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
72 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(local find (require :formedit.find)) | ||
(local ts (require :vim.treesitter)) | ||
|
||
(fn form [] | ||
(let [form (find.form) | ||
parent (form:parent) | ||
text (ts.get_node_text form 0) | ||
[start-row start-col end-row end-col] [(parent:range)]] | ||
(vim.api.nvim_buf_set_text 0 start-row start-col end-row end-col [text]))) | ||
|
||
{: form} |
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,16 @@ | ||
(local {: describe : it : before_each} (require :plenary.busted)) | ||
(local h (require :spec.helper)) | ||
(local raise (require :formedit.raise)) | ||
|
||
(local keymap :<localleader>o) | ||
|
||
(describe :raise | ||
(fn [] | ||
(before_each (fn [] | ||
(set vim.g.maplocalleader keymap) | ||
(vim.keymap.set :n keymap raise.form))) | ||
(it :form | ||
(fn [] | ||
(h.setup {:content "(1 (2))" :cursor [1 4]}) | ||
(h.feedkeys keymap) | ||
(h.expect {:content "(2)" :cursor [1 2]}))))) |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.