Is it possible to search only in a specific context, or to exclude matches that are present in a specific context? For example, can I search for foo
while excluding any foo
that is found in comments?
Search in a specific context
rcopat
#1
0 Likes
OdatNurd
#2
Sublime’s search is purely text based, so apart from perhaps some regex shenanigans to make sure that //
doesn’t appear somewhere before the text you’re looking for, I would imagine that you would need a package with deeper knowledge of the code to do such searches for you.
1 Like
rcopat
#3
@OdatNurd, thank you. That makes sense.
If someone is aware of a package, please let me know.
0 Likes
kingkeith
#4
for a single file I just do a select by scope - comment
then search in selection.
1 Like
rcopat
#5
Hi @kingkeith, can you please clarify what you mean by select by scope
? Are you talking about expand selection to scope
? I don’t see any options to insert - comment
.
0 Likes
deathaxe
#6
Console …
view.sel().add_all(view.find_by_selector("- comment"))
… that’s what API heros do.
3 Likes