You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns the printed text value of this element (does not include newlines)
653
+
654
+
Note: This is currently bugged as entities (eg &) and attr substitutions (eg
655
+
%attr) will not return their printed value
656
+
657
+
- **Returns**: `string`
658
+
659
+
660
+
SETTEXTCONTENT *banana-ast-settextcontent*
661
+
662
+
Sets the text content of this element. Removes all other children
663
+
664
+
Replaces newlines with elements (note: if newlines are passed inside an inline
665
+
element (eg. ), it will cause a LineTooBig error)
666
+
667
+
- **Parameters**:
668
+
- `str` (string): the text to set this element’s content to
669
+
670
+
671
+
PARENT *banana-ast-parent*
672
+
673
+
Returns the parent node of this node
674
+
675
+
- **Returns**: `Banana.Ast`
676
+
677
+
678
+
ISHIDDEN *banana-ast-ishidden*
679
+
680
+
Returns true when this node is not rendered (eg the style `display: none`)
681
+
682
+
- **Returns**: `boolean`
683
+
684
+
685
+
ATTACHREMAP *banana-ast-attachremap*
686
+
687
+
Attaches the given remap to the ast
688
+
689
+
690
+
EXPLANATION *banana-ast-explanation*
691
+
692
+
For those wondering why one should not just use `vim.keymap.set` there are a
693
+
few reasons.
694
+
695
+
1. Remap collision. `vim.keymap.set` can only set one remap per buffer which means that if you want multiple ast nodes to handle remaps differently (eg in mason when you try to install a package pressing `i` on different lines installs different packages) you have to have a central function handle everything. `attachRemap` allows "decentralized" remaps (ie each ast node can figure out how to best handle the remap)
696
+
2. Remap deletion. Remembering to delete remap handlers when an ast is deleted can be annoying. Using `attachRemap` does that for you
697
+
698
+
699
+
CONSTRAINTS *banana-ast-constraints*
700
+
701
+
Currently, the supported constraints are "hover", "line-hover", and <number>.
702
+
703
+
>lua
704
+
-- this will only be called if the cursor is over the node (eg isHovering() is true)
705
+
-- when the user types `<leader>w` or if the user types `1<leader>w`
0 commit comments