mIRC Homepage
Posted By: visionz Editor - Searching for an identifier - 09/11/10 04:01 AM
When searching (ctrl-f) while on an identifier, mIRC editor puts the identifier in the search box, with the $ prefix.

Wouldn't it better if it removed the $ prefix? I always find myself removing the prefix when I want to search for the identifier's definition.
Posted By: RusselB Re: Editor - Searching for an identifier - 09/11/10 05:26 AM
If you use /help comchan, you will not get the same information as you would using /help $comchan

The $ part of the identifier name is part of the name.

I'm quite sure that, if your name was Vision, you wouldn't want people to refer to you as Ision. The V is part of your name, and thus should be there.
Posted By: visionz Re: Editor - Searching for an identifier - 09/11/10 05:34 AM
As far as my mIRC knowledge goes, I think that $foo definition is identified by :

alias foo { return 1 }

So searching for "foo" instead of "$foo" makes more sense to me, as "foo" will return every results, while "$foo" will only return identifiers call
Posted By: 5618 Re: Editor - Searching for an identifier - 09/11/10 07:00 AM
Originally Posted By: visionz
So searching for "foo" instead of "$foo" makes more sense to me, as "foo" will return every results, while "$foo" will only return identifiers call

So what if you only want to search for identifiers? :P
The user should define what is searched for, not mIRC. wink
Posted By: Riamus2 Re: Editor - Searching for an identifier - 09/11/10 01:08 PM
Just as a note, in the Scripts Editor, you can change the options to not display the active word (Options > Find Selection).

That being said, if you have that enabled, mIRC will insert what you are on. If you're on foo in alias foo { }, then it will search for foo. If you're on $foo somewhere else, then it will search for $foo. That makes sense for it to do that. Just because I'm searching for an identifier doesn't mean I'm looking for the alias that creates it. In many cases, I'm looking for the identifier itself.

Personally, I disable the Find Selection option because it tends to be more of a headache (changing what I'm searching for when I'm doing multiple searching and making changes between or whatever else). Then, if I want the alias that creates the identifier, I just search for something like foo { and it finds it quickly.

Anyhow, I don't think it needs changed. It makes more sense imo the way it is now.
Posted By: Wims Re: Editor - Searching for an identifier - 09/11/10 05:23 PM
Removing a caracter automatically when searching for something is definitely not a good idea, however looking for an alias's definition is something common, a tooltip with the line number and the file name of where the alias is located would be, imo, a good additon.
Posted By: visionz Re: Editor - Searching for an identifier - 09/11/10 05:41 PM
I think you didn't understand my suggestion.

Let say my cursor is on $foo in

Code:
var %test = $foo(1,2,3)


If I press Ctrl-F, mIRC will automaticly puts "$foo" in the search box as the default search term. IMO, mIRC should remove the $, as it is not _really_ a part of the identifier. So in my example, if I press Ctrl-F, it should put "foo" in the search box, not "$foo".

Or, if that annoys too much other users, a shortcut to go to the alias definition instead would be great too.
Posted By: Riamus2 Re: Editor - Searching for an identifier - 09/11/10 05:52 PM
If you read what I said, I still think that it makes more sense to search for what is selected (when using that option) rather than trying to have mIRC guess what you really mean. If you're on $foo, then $foo should be what's inserted if you use that option. It is not uncommon to search for the identifier itself.

Consider a built-in identifier, such as $me. Searching for me would very likely find a variety of things not related to the identifier you're trying to find. Also, if you're trying to find the alias that creates the identifier, just searching for the identifier name (foo) is unlikely to find the alias that creates it anyhow. If you want to find the alias, you are going to be better off searching for foo { (or even alias foo { if you have it in Remotes). Removing the $ doesn't suddenly make it find the alias for you.

So, in short, mIRC should not change what you have selected on its own. That's up to you. mIRC can't know what you're trying to find and guessing isn't a good choice.

Wims, although a tooltip might be useful, reading one, then switching files, then using Ctrl-G to get to the location will take longer than a search for foo {. Also, I don't believe the scripts editor supports tooltips and adding them isn't really important enough (imo) to do the amount of work necessary to add tooltips there. I'd much rather see true tooltip support in dialogs without needing a DLL before seeing them in the scripts editor. smile
Posted By: Wims Re: Editor - Searching for an identifier - 09/11/10 07:07 PM
I think I perfectly did but this is how I (and probably others) see the suggestion :

"hey I often do that in mIRC, could this feature be changed so it's better for me ?"

This isn't a valid argument.
What if someone suggests "I often search for @window menu definition, could mirc search directly for "menu @window {" when I enter something starting with a '@' ?" ?

Also, the "find selection" option works with selection, so if you select foo, it will search for "foo", you're not selecting anything so mIRC guess and use the cursor position and the mIRC syntax to get the token.
© mIRC Discussion Forums