Home Download Buy Blog Forum Support

pkg to edit just there in the "Find results" tab? Yes!

pkg to edit just there in the "Find results" tab? Yes!

Postby tito on Sun Sep 15, 2013 4:37 pm

Editing directly in the "Find results" would be cool, no?
Any change should be written to the file edited. I think is all there to be able to do this. Someone have tried? I can try it :)
Last edited by tito on Tue Feb 04, 2014 5:48 am, edited 1 time in total.
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 855
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: Is there a pkg to edit just there in the "Find results" tab?

Postby adzenith on Sun Sep 15, 2013 4:53 pm

As far as I know, nobody has tried, but I have also often thought that this would be really cool to have.
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: Is there a pkg to edit just there in the "Find results" tab?

Postby tito on Tue Feb 04, 2014 5:47 am

just started, https://github.com/SublimeText/FindResultsApplyChanges

Basically, you have a "tab" named "Find Results"(standard 'file results' from ST), and any change made to the content of that tab, can be applied back to the files, by going to "Main menubar" -> "Find" -> "Find Results Commit Any Change Made".

Today, is a quick and dirty hack. Is just a start, pull requests welcome....! see bugs

Just in case, will only apply changes to these lines starting with numbers. ;-P
Last edited by tito on Mon Feb 10, 2014 4:12 pm, edited 2 times in total.
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 855
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: pkg to edit just there in the "Find results" tab? Yes!

Postby adzenith on Tue Feb 04, 2014 1:40 pm

So cool..!
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: pkg to edit just there in the "Find results" tab? Yes!

Postby gregor.hoch on Tue Feb 04, 2014 6:07 pm

Great idea and great first implementation! I was thinking that it would be cool to commit on save (like some the git package) and you have on the list of bugs... :)
gregor.hoch
 
Posts: 144
Joined: Sat Oct 01, 2011 7:54 pm

Re: pkg to edit just there in the "Find results" tab? Yes!

Postby tito on Wed Feb 05, 2014 10:12 am

Just updated it, now uses regions instead of regexp. So, newlines can be inserted.. but that will shift the newlines.. and if you apply(aka commit changes) more than once, the file will end corrupt. I added an "alert" to avoid just that. Buf if you modify the file in another tab.. the same corruption can happens.. not a big deal for my use case.

Thinking.. To avoid this what we need is linked Regions... (regions that reflect the content of Regions in other files.. or buffers..) ... this will allow us to do all sort of hacks ala LightTable.. keep dreaming.. :-P

For my general purpose, (I like to rename things from time to time..) this is just great! bothers me just the following:

- Trivial: Hook CTRL/CMD+S to apply the changes (how to?)
- Annoying: Double click in these lines with numbers and a colon will open the file, default ST behaviour(how to disable it?)

Any ideas?!
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 855
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 12 guests