biati-digital / nova-text-tools

Swiss Army knife for text manipulation and selection Sort, Transform, Filter, Delete Duplicates, Encode, Decode and much more...
16 stars 2 forks source link

Prevents creating HTML code for images dragged into the editor #8

Closed heathflohre closed 2 years ago

heathflohre commented 2 years ago

Contacted Panic about the same issue with Emmet, but the plugin blocks Nova's functionality to create an img tag for image files dragged into the editor. It reverts it to the file path. Usually the tag is created immediately, but with the plugin active, there is a slight pause before the path is inserted.

biati-digital commented 2 years ago

How can this extension block Nova's functionality? all commands are only executed from the command palette/right click, etc. Dragging a file should not invoke this extension at all.

heathflohre commented 2 years ago

Agreed. Panic was alerted as well and they can recreate the bug. The Emmet extension has the same issue when the auto-complete preference is selected. Does your plugin do any active watching of the text?

biati-digital commented 2 years ago

I'll try to recreate this issue, it's been a few months since i worked on this so i've to recheck the code and i found myself switching to vscode a lot.

I'll take a look at this when i've some free time.

biati-digital commented 2 years ago

@heathflohre i did some tests, this has to be a bug with Nova, expand selection uses onDidChangeSelection to reset the expand selection history, there's no problems with that code.

onDidChangeSelection will call maybeResetHistory and this function asks Nova for the current selection with textEditor.selectedRanges; this line is the one causing the problem, removing that line solves this problem.

I could try to implement a fix, but this needs to be addressed by Panic because as you mention, the emmet extension also has this problem.

https://user-images.githubusercontent.com/1219228/145690687-4dd0050d-3890-4d80-b76f-4657836d5599.mp4

biati-digital commented 2 years ago

Closing as this is something Nova should take a look and fix.