View unanswered posts | View active topics



Reply to topic  [ 4 posts ] 
bug fix: Do not clear bookmarks when reloading a file 
Author Message
Member

Joined: Fri Mar 06, 2015 6:33 pm
Posts: 26
Reply with quote
This is an issue that has cost me a lot of development time. Every time I grab latest from Perforce or use the Perforce plugin to edit a file it forces a refresh and makes me lose my bookmarks, which I use a lot to mark the places I'm currently developing. Even if the bookmarks don't line up exactly anymore, it is still a huge time saver to be able to quickly navigate to their location after the reload.

Turns out this was a really easy fix. Let me know if this solution seems correct. I'm not 100% sure of the repercussions of restoring the bookmarks in this fashion, but from my initial testing it seems to do the trick just fine.

The change is in TabbedDocument.cs inside of the Reload() function by adding the following at line 470 right before the this.InitBookmarks() call:
Code:
/*old*/
this.SciControl.EmptyUndoBuffer();
this.InitBookmarks();
/*new*/
this.SciControl.EmptyUndoBuffer();

// Have to make a copy since MarkerManager.ToggleMarker() will trigger the values to get added to this.bookmarks.
List<Int32> bookmarksCopy = this.bookmarks;
foreach (var lineNum in bookmarksCopy)
{
    MarkerManager.ToggleMarker(SciControl, 0, lineNum);
}

this.InitBookmarks();


Tue Oct 04, 2016 9:48 pm
Profile
Moderator

Joined: Mon Jul 06, 2009 8:14 am
Posts: 258
Reply with quote
Thanks for the contribution, it will be reviewed as soon as possible. However I would like to encourage you to create Pull Requests in the future, it will be better for everyone, for reviewing, integrating changes, communicating about issues, testing the changes, etc.


Wed Oct 05, 2016 11:10 am
Profile
Member

Joined: Fri Mar 06, 2015 6:33 pm
Posts: 26
Reply with quote
Sorry about that. I'm not super familiar with git so I just grabbed it using TortoiseSVN and couldn't figure out how to get it into a pull request. I'll see if I can hook that up tonight if you still would like it to be a pull request.


Wed Oct 05, 2016 5:03 pm
Profile
Member

Joined: Fri Mar 06, 2015 6:33 pm
Posts: 26
Reply with quote
Had to battle a bit with git to figure out how to make a second pull request, but I think I got it added properly now. Hope that helps!


Tue Oct 11, 2016 11:22 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.