windwp / nvim-ts-autotag

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

Plugin is breaking `.` (dot-repeat action) when `>` is inserted #147

Closed afonsocarlos closed 7 months ago

afonsocarlos commented 10 months ago

Hello, first off thanks a lot for the great plugin, it's been very helpful.

I noticed a bug when inserting > and then trying to repeat the action with ..

Here's an example:

<?php
|DB::query('some query here'); // the cursor is in the beginning of the line
DB::query('some other query there');

I want to replace the static call with an instance call so I do ctq$this-><esc>

<?php
$this->|query('some query here'); // the cursor after > (right arrow) after inserting
DB::query('some other query there');

Now when I move to the next line and do . to repeat the edit it actually results in the following:

<?php
$this->query('some query here');
$this-|query('some other query there'); // note > is missing

Apparently that is happening because of this keymap internal.lua:59 I currently solved it by setting the M.enable_close option to false since I need to use -> on PHP all the time, but the problem still happens for the / (close_slash) keymap.

It would be nice if there was a way for the plugin to stay out of . (dot-repeat) way or if there was some way to make the > new insertion behavior reproducible by .

stale[bot] commented 7 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.