mIRC Home    About    Download    Register    News    Help

Print Thread
Editor - Searching for an identifier #227404 09/11/10 04:01 AM
Joined: Aug 2003
Posts: 72
V
visionz Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Aug 2003
Posts: 72
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.

Re: Editor - Searching for an identifier [Re: visionz] #227408 09/11/10 05:26 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Re: Editor - Searching for an identifier [Re: RusselB] #227409 09/11/10 05:34 AM
Joined: Aug 2003
Posts: 72
V
visionz Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Aug 2003
Posts: 72
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

Re: Editor - Searching for an identifier [Re: visionz] #227410 09/11/10 07:00 AM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
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

Re: Editor - Searching for an identifier [Re: visionz] #227417 09/11/10 01:08 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Re: Editor - Searching for an identifier [Re: visionz] #227421 09/11/10 05:23 PM
Joined: Jul 2006
Posts: 3,813
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,813
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.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Editor - Searching for an identifier [Re: Wims] #227423 09/11/10 05:41 PM
Joined: Aug 2003
Posts: 72
V
visionz Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Aug 2003
Posts: 72
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.

Re: Editor - Searching for an identifier [Re: visionz] #227424 09/11/10 05:52 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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


Invision Support
#Invision on irc.irchighway.net
Re: Editor - Searching for an identifier [Re: visionz] #227425 09/11/10 07:07 PM
Joined: Jul 2006
Posts: 3,813
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,813
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.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net