sublime-devdocs icon indicating copy to clipboard operation
sublime-devdocs copied to clipboard

Search From Selection searches an empty string when nothing is selected

Open dpc00 opened this issue 1 month ago • 0 comments

Claude reports: "DevDocs: Search From Selection" searches for an empty string when nothing is selected, instead of the word under the cursor, because DevDocsSearchSelectionCommand.run computes text = self.view.word(selection) (a Region, not text) and then overwrites it on the next line with text = self.view.substr(selection) of the still empty selection.

Tested on Sublime Text 4 build 4215 (Windows) with DevDocs 2014.03.28.16.25.26 from Package Control. I put the cursor inside the word document in a .js file with no selection and ran dev_docs_search_selection. To see the text without opening a browser tab I used a loose copy of devdocs.py whose SearchFor only printed its argument: it printed ''.

Fix, tested here with the same loose copy: replace text = self.view.word(selection) with selection = self.view.word(selection). With that, SearchFor received 'document'.

dpc00 avatar Oct 22 '26 22:10 dpc00