Skip to content

Commit

Permalink
Fix top-level
Browse files Browse the repository at this point in the history
  • Loading branch information
hkupty committed Apr 12, 2019
1 parent 92a5026 commit 24726fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion API.md
Expand Up @@ -189,9 +189,11 @@ mode **(string)**: Motion mode or 'visual'
**(table)** coordinates {from = {row,col}, to = {row,col}, bufnr = 1}


## `acid.forms.form_under_cursor()`
## `acid.forms.form_under_cursor([top])`
Extracts the innermost form under the cursor

*top* **(boolean)**: if true, recursively searches for top level.


**(string)** symbol under cursor

Expand Down
5 changes: 3 additions & 2 deletions lua/acid/forms.lua
Expand Up @@ -102,9 +102,10 @@ end

--- Extracts the innermost form under the cursor
-- @treturn string symbol under cursor
-- @tparam[opt] boolean top if true, recursively searches for top level.
-- @treturn table coordinates {from = {row,col}, to = {row,col}, bufnr = 1}
forms.form_under_cursor = function()
local coordinates = forms.get_form_boundaries()
forms.form_under_cursor = function(opt)
local coordinates = forms.get_form_boundaries(opt)

return forms.extract(coordinates)
end
Expand Down

0 comments on commit 24726fa

Please sign in to comment.