Home Download Buy Blog Forum Support

Andy Edits

Andy Edits

Postby agibsonsw on Wed Oct 10, 2012 11:51 am

Currently available via GitHub. I encourage feedback :)

Jump between edited regions - optional gutter icon

Can jump to next or previous edited-lines or use a quick-panel which shows the edited text and line number. (If the edited text is just whitespace then the panel will display the full line's text.)

A shortcut can toggle outlining of the edited lines. An optional icon can appear in the gutter - although this may interfere if you also use Bookmarks. You could use your own icon if you prefer! icon_scope determines the colour of the icon and outlining: "class" works well for me.

You can remove the edit history for a region using another shortcut, via a quick panel (although you cannot remove the most recent edit). If you highlight some text you can create/add it as an edit-region.

You can list, and jump to, edits across all open files.

Details for edited lines will persist if you close ST, but not if you close the file/view. This is the default persistence behaviour for ST.

My suggestions for your Key Bindings (User) are:
{ "keys": ["ctrl+alt+d"], "command": "delete_edit" },
{ "keys": ["ctrl+alt+h"], "command": "toggle_edits" },
{ "keys": ["ctrl+alt+j"], "command": "quick_edits" },
{ "keys": ["ctrl+alt+k"], "command": "prev_edit_line" },
{ "keys": ["ctrl+alt+l"], "command": "next_edit_line" },
{ "keys": ["ctrl+alt+m"], "command": "list_all_edits" },
{ "keys": ["ctrl+alt+c"], "command": "create_edit" }

CURRENT LIMITATIONS: Pressing Undo repeatedly may leave an area as an edit-region, even though you have undone all edits to this region. Being able to create and remove edit regions can help with this issue.

Multi-select will only remember the first selection area.
Attachments
edits6.png
edits6.png (34.38 KiB) Viewed 4277 times
"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: Andy Edits

Postby agibsonsw on Wed Oct 10, 2012 6:26 pm

A context-menu should make this easier to use 8-).

edits7.png
edits7.png (24.55 KiB) Viewed 4219 times
"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: Andy Edits

Postby agibsonsw on Wed Oct 10, 2012 10:26 pm

Mmm it creates spurious edits towards the top of the page. Teething problems! I'll shall investigate (got an idea what's wrong..).

Added: I may have corrected this but I'll have to keep an eye on it and try to notice when it happens.
"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: Andy Edits

Postby agibsonsw on Thu Oct 11, 2012 3:25 am

With apologies :oops: , but better hold off on this for a while! It's carrying edit information across the views.

self for on_modified and on_selection_modified is a single instance - I was under the impression that these were per view. Shouldn't be too tricky to fix though.

Soz again, Andy (I was too keen!).
"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: Andy Edits

Postby agibsonsw on Thu Oct 11, 2012 11:38 am

I believe the previous issue is now fixed.

It would be great if someone might give this a trial and offer some feedback :)
"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: Andy Edits

Postby agibsonsw on Thu Oct 11, 2012 7:17 pm

This is working quite well for me now :) .

It doesn't include automatically inserted tabs, matched brackets or quotes within the current edit region. Therefore, the edit-region may be split into several edits, and/or the region may end before it should. What I'm doing is pressing Ctrl-Alt-H (or using my shortcut menu) to toggle highlighting of the edits. Regardless of this highlighting step, I can select the whole area and use Ctrl-Alt-C to define it as a single edit-region. I can do this at any time and it has the advantage that I can explicitly define the start and end points of the edit region.

It would be possible to create code to handle these automatic insertions (and other factors) but it would be quite detailed and never 100% foolproof. I think it is best with this kind of feature that you/I have some control over how it works. That is, let the feature create the edit regions as you code, then review and correct them to what you decide should be considered as edit regions.

Again, I encourage feedback ;).
"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: Andy Edits

Postby singw on Fri Oct 12, 2012 9:52 am

Will this be put on Package Control's repository?
singw
 
Posts: 59
Joined: Fri Aug 05, 2011 2:16 pm

Re: Andy Edits

Postby agibsonsw on Fri Oct 12, 2012 11:44 am

singw wrote:Will this be put on Package Control's repository?


Hello. Yes, I have requested this. Andy.
"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: Andy Edits

Postby agibsonsw on Fri Oct 12, 2012 5:09 pm

I believe I have resolved any Undo/Redo discrepancies ;) but I need some feedback to confirm this. Added: Resolved, "to an acceptable degree"!
"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: Andy Edits

Postby agibsonsw on Fri Oct 12, 2012 8:01 pm

Sorry about all the updates - I'm almost done :)

If there are only spaces and/or tabs between two edit regions then they will be treated as one region. I believe this is reasonable? This will save having to Create areas as a single edit-region manually. Andy.

edits8.png
edits8.png (34.61 KiB) Viewed 3786 times
"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

Next

Return to Plugin Announcements

Who is online

Users browsing this forum: Alexa [Bot] and 6 guests