AndrewRadev / sideways.vim

A Vim plugin to move function arguments (and other delimited-by-something items) left and right.
http://www.vim.org/scripts/script.php?script_id=4171
MIT License
481 stars 9 forks source link

Add support for HTML class values #41

Closed jdsutherland closed 4 years ago

jdsutherland commented 4 years ago

This attempts to add support for html class values.

Inside will operate on values:

<div id="app" class="▋min-h-screen bg-gray-200 antialiased xl:flex xl:flex-col xl:h-screen">

Outside will continue to work on attributes (current behavior):

<div id="app" ▋class="min-h-screen bg-gray-200 antialiased xl:flex xl:flex-col xl:h-screen">

This currently doesn't work and I'm not sure why.

AndrewRadev commented 4 years ago

I had actually started to implement this today, but you beat me to it :D. I stole your tests and made this: https://github.com/AndrewRadev/sideways.vim/commit/b6e819e5d54efc3d160695499769cedca98b4f29. I should have merged my code into yours, but it's late and I'm too tired to deal with git.

The reason your version doesn't work is probably because of syntax skipping. By default, sideways skips "String" and "Comment" syntax items. In order to get it to stop, I had to set the syntax groups to skip to [], but that wasn't working either, without some fixes. You can see them in that commit.

Bottom-line is, it should work now, I think. I'm sorry for not helping with your PR instead, and I really appreciate you opening it and the work you put into it. Let me know if you see any issues with the support. I won't close the PR for now, so if you'd like, you could merge master and make changes.