erincayaz / obsidian-colored-text

MIT License
74 stars 5 forks source link

Add "Remove Color Under Cursor" command #21

Closed DPAttila closed 1 year ago

DPAttila commented 1 year ago

I didn't find any command to remove an assigned color, so I've implemented one. (Although I saw a mention of it in #16.)

Currently only works for a single color, under the cursor, with no text selected.

Nice work BTW, thank you for the plugin!

erincayaz commented 1 year ago

Hi, first of all thanks for the contribution. I tested the code and it is working really well. However I think that excluding text selection could confuse users. Did you try to add that? If so, did you run into problem?

DPAttila commented 1 year ago

My first idea was not to add selection, but now I see that it could be useful, to remove multiple spans or the coloring from only half of a colored section. I will look into it, and add it in the next few days.

DPAttila commented 1 year ago

Alright, now color remove works for spans in selection, even if they are on multiple lines. I've also left the no-selection-mode active.

Please note that you have to select the whole of a colored section (opening and closing tags included) for the removal to happen.

erincayaz commented 1 year ago

Hi, sorry for the late reply I was a little bit busy. Thanks again for the contribution, I will test the code and merge it today.