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
It would be nice to have a structure-aware command to wrap the region with a new JSX element, similar to web-mode-element-wrap, but preserving a valid JSX file.
The text was updated successfully, but these errors were encountered:
I use a very naive function to it, it does not check at all if it is a valid JSX file after (I am not sure if it's easy to check JSX validity), I am not very good at eLisp.
(defunrjsx-region-wrap (node)
"Wrap an region with NODE tag"
(interactive"sTag wrapper: ")
(if (region-active-p)
(save-mark-and-excursion
(progn
(if (< (mark) (point)) (exchange-point-and-mark))
(insert (concat"<" node ">"))
(exchange-point-and-mark)
(insert (concat"</" node ">"))))
(message"no active region")))
(define-key rjsx-mode-map (kbd"C-c C-w") 'rjsx-region-wrap)
It would be nice to have a structure-aware command to wrap the region with a new JSX element, similar to
web-mode-element-wrap
, but preserving a valid JSX file.The text was updated successfully, but these errors were encountered: