windwp / nvim-ts-autotag

Use treesitter to auto close and auto rename html tag
MIT License
1.65k stars 87 forks source link

How to enable auto tag for react fragments? #199

Closed AlejandroSanchez90 closed 2 months ago

AlejandroSanchez90 commented 3 months ago

it possible to make this work for fragments swell?

<> => </>

roycrippen4 commented 2 months ago

@AlejandroSanchez90, for clarification, you want version 1?

| = cursor position

Version 1

Old text   Command   New text
   <|         >       <>|</>

Version 2

Old text   Command   New text
   <|         >        </>
PriceHiller commented 2 months ago

~Should/will be closed by #202~

~(Thanks to @roycrippen4 for the hard work 😄)~

~Duplicate of #185. Since there's discussion on-going here, I'll leave this open as well and close it alongside #185.~

The above is incorrect, see next comment.

roycrippen4 commented 2 months ago

@PriceHiller Unfortunately it's not a duplicate of #185. It's a similar-ish problem, but #202 doesn't solve #185. I'll be submitting a separate PR for that issue.

AlejandroSanchez90 commented 2 months ago

@AlejandroSanchez90, for clarification, you want version 1?

| = cursor position

Version 1

Old text   Command   New text
   <|         >       <>|</>

Version 2

Old text   Command   New text
   <|         >        </>

Hi thanks for the reply, I was referring to version one

roycrippen4 commented 2 months ago

Sounds good, @AlejandroSanchez90. A PR has been submitted that fixes this issue and should be merged in shortly.

hanumanman commented 22 hours ago

@roycrippen4 Thanks a lot for this feature! This works now when typing normally, but doesnt work when updating tag name using diw/ciw and the like Example: <div></div> Delete div with diw => the text is now <></div> instead of <></>