Home Download Buy Blog Forum Support

Show Scope "command" ala TextMate

Re: Show Scope "command" ala TextMate

Postby facelessuser on Thu Mar 29, 2012 8:27 pm

quodlibet wrote:I removed the two `\n`s from following line:

I could cut it down to one, but that is as far as I would go. I can put it in a setting.

quodlibet wrote:I think the "points" and "rowcol" features are too arithmetical for me. @nick's plugin's behavior seems preferable for identifying extent.

@nick's doesn't show extent, it just shows the scopes. These are two different things, useful for two different purposes. But that is why I made the settings and not on by default; not everyone will want them.

quodlibet wrote:In an ideal universe, highlighting the scope would probably be best way. (I tried to avoid mentioning this on the off-chance that you would find it interesting :) ) But even if it can be done, from what I've seen in other plugins (e.g., https://github.com/a-sk/livecss), trying to hijack the color scheme makes a mess of things.

Highlighting the scopes is easy. LiveCSS is a mess for different reasons; it is trying to dynamically add special color scopes to highlight CSS colors. If all you want is an underline of the entire scope's extent, I can do that no problem. I can even use the scopes internal color (but I don't think that is necessary). LiveCSS is something different entirely. If you want something like I described, create an issue, and I will consider it when I have time.
facelessuser
 
Posts: 1576
Joined: Tue Apr 05, 2011 7:38 pm

Re: Show Scope "command" ala TextMate

Postby nick. on Thu Mar 29, 2012 8:33 pm

facelessuser wrote:
quodlibet wrote:I removed the two `\n`s from following line:

quodlibet wrote:In an ideal universe, highlighting the scope would probably be best way. (I tried to avoid mentioning this on the off-chance that you would find it interesting :) ) But even if it can be done, from what I've seen in other plugins (e.g., https://github.com/a-sk/livecss), trying to hijack the color scheme makes a mess of things.

Highlighting the scopes is easy. LiveCSS is a mess for different reasons; it is trying to dynamically add special color scopes to highlight CSS colors. If all you want is an underline of the entire scope's extent, I can do that no problem. I can even use the scopes internal color (but I don't think that is necessary). LiveCSS is something different entirely. If you want something like I described, create an issue, and I will consider it when I have time.


I interpreted his statement to mean that the plugin would highlight all instances of the scope (under the cursor or on keypress or whathaveyou). Similar to how Find/Replace highlights all matches.
nick.
 
Posts: 266
Joined: Wed Jan 18, 2012 3:45 am

Re: Show Scope "command" ala TextMate

Postby facelessuser on Thu Mar 29, 2012 8:37 pm

nick. wrote:
facelessuser wrote:
quodlibet wrote:I removed the two `\n`s from following line:

quodlibet wrote:In an ideal universe, highlighting the scope would probably be best way. (I tried to avoid mentioning this on the off-chance that you would find it interesting :) ) But even if it can be done, from what I've seen in other plugins (e.g., https://github.com/a-sk/livecss), trying to hijack the color scheme makes a mess of things.

Highlighting the scopes is easy. LiveCSS is a mess for different reasons; it is trying to dynamically add special color scopes to highlight CSS colors. If all you want is an underline of the entire scope's extent, I can do that no problem. I can even use the scopes internal color (but I don't think that is necessary). LiveCSS is something different entirely. If you want something like I described, create an issue, and I will consider it when I have time.


I interpreted his statement to mean that the plugin would highlight all instances of the scope (under the cursor or on keypress or whathaveyou). Similar to how Find/Replace highlights all matches.


Cake

ST2 API

Code: Select all
find_by_selector(selector)   [Regions]   Finds all regions in the file matching the given selector, returning them as a list.
facelessuser
 
Posts: 1576
Joined: Tue Apr 05, 2011 7:38 pm

Re: Show Scope "command" ala TextMate

Postby quodlibet on Thu Mar 29, 2012 8:45 pm

facelessuser wrote:I could cut it down to one, but that is as far as I would go. I can put it in a setting.


I would prefer one over two. But don't worry too much about my fussy aesthetics :)

facelessuser wrote:@nick's doesn't show extent, it just shows the scopes.


I meant that the way I've used @nick's plugin is to enable it and then move the cursor around to locate the extent of the scope.

facelessuser wrote:If you want something like I described, create an issue, and I will consider it when I have time.


I just created a github account for this :)

One of these days I may even work out what all the pulling and forking is about :p

Edit: I should've added a "Thanks!" somewhere or other.

Edit #2:

nick. wrote:I interpreted his statement to mean that the plugin would highlight all instances of the scope (under the cursor or on keypress or whathaveyou). Similar to how Find/Replace highlights all matches.


Actually, I hadn't even thought that!
Last edited by quodlibet on Thu Mar 29, 2012 8:51 pm, edited 1 time in total.
quodlibet
 
Posts: 553
Joined: Sat Jun 18, 2011 5:53 pm

Re: Show Scope "command" ala TextMate

Postby agibsonsw on Thu Mar 29, 2012 8:51 pm

One of these days I may even work out what all the pulling and forking is about


I very much agree with this sentiment ;). Is it related to grokking or borking :lol:
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Show Scope "command" ala TextMate

Postby natebeaty on Thu Mar 29, 2012 8:54 pm

facelessuser wrote:Added instant scoping toggle.

Repo is now here.
https://github.com/facelessuser/ScopeHunter

I will request it be added to Package Control. If you have issues or suggestions, please create an issue on github.


Whoa! I had no idea my bringing this thread back to life would result in a handy plugin. I agree the short time the scope is shown by default is not enough. This will be a huge help, thanks. (Fwiw, I had to restart ST2 after installing to get this to work, in case anyone else has the same issue.)
natebeaty
 
Posts: 122
Joined: Wed Apr 06, 2011 8:28 pm
Location: Chicago, IL

Re: Show Scope "command" ala TextMate

Postby facelessuser on Thu Mar 29, 2012 9:00 pm

natebeaty wrote:
facelessuser wrote:Added instant scoping toggle.

Repo is now here.
https://github.com/facelessuser/ScopeHunter

I will request it be added to Package Control. If you have issues or suggestions, please create an issue on github.


Whoa! I had no idea my bringing this thread back to life would result in a handy plugin. I agree the short time the scope is shown by default is not enough. This will be a huge help, thanks. (Fwiw, I had to restart ST2 after installing to get this to work, in case anyone else has the same issue.)


I think it is because I open the settings file into a variable and then reference the variable from then on, but when the plugin is getting copied over, ST2 quickly loads the Python script before the setting file is copied over. When you restart, all dependencies are available; therefore, no problems.
facelessuser
 
Posts: 1576
Joined: Tue Apr 05, 2011 7:38 pm

Previous

Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], subhaze and 13 guests