Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Conversation

@bchintx
Copy link
Contributor

@bchintx bchintx commented Jul 12, 2013

alternate fix for issue #4238 that replaces previously submitted pull request #4329

The other pull request tries to more intelligently swap out the working set entries, but fails to open the newly saved document. This approach leverages the already existing workflow in opening and adding the newly saved file to the working set. However, rather than just appending the new file to the end of the working set list, the new code now supports an optional parameter which specifies where to insert it. Consequently, we can insert the file into the same working order as it was before the file-save-as event.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This item should be added to the structure above:

{!{fullPath:string, index:number=}}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, ok. I wasn't sure on the format of these comments. Thanks for the clarification.

@gruehle
Copy link
Member

gruehle commented Jul 12, 2013

This change is definitely simpler (and cleaner) than #4329, but it does cause a big flicker because the working set is redrawn twice: once when the old item is removed, and again when the new file is added. It would be nice if that could be a single redraw.

@gruehle
Copy link
Member

gruehle commented Jul 12, 2013

Initial review complete.

bchintx added 2 commits July 12, 2013 12:43
…f the item from the working set, thereby reducing the flicker otherwise caused by two redraws of the working set list
@bchintx
Copy link
Contributor Author

bchintx commented Jul 12, 2013

@gruehle Thanks again for the initial review. I've committed two changes that should take care of all of your concerns. Can you please revisit this review to confirm that you approve?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just use if (!suppressRedraw) here. This handles undefined, null and false correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hehehe. Javascript newbie. thanks!

@gruehle
Copy link
Member

gruehle commented Jul 12, 2013

@bchin - re-review complete.

@bchintx
Copy link
Contributor Author

bchintx commented Jul 12, 2013

@gruehle Latest changes have been committed. Thanks again for catching those, especially the issue about skipping the listener.

Ready for review. :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be @param {boolean=} suppressRedraw ... (we really need to have a closure compilation task to catch these kind of things...)

@gruehle
Copy link
Member

gruehle commented Jul 12, 2013

@bchin - one tiny change left. I would have done the change myself, but then I saw that the pull request cannot be automatically merged. Could you merge with master? Thanks!

@bchintx
Copy link
Contributor Author

bchintx commented Jul 12, 2013

@gruehle Got it. I've fixed that last comment, and then manually resolved the merge with master. Should be ready to merge pending your final approval. Thanks again!

@gruehle
Copy link
Member

gruehle commented Jul 12, 2013

@bchin I'm still seeing a redraw after the file is removed and an additional redraw once the file is added. It seems like the suppressRedraw flag isn't working correctly, or something else is forcing a redraw.

@gruehle
Copy link
Member

gruehle commented Jul 12, 2013

Looks great! Merging.

gruehle added a commit that referenced this pull request Jul 12, 2013
fix issue #4238- 'Save As on file in working set does not preserve working set order'
@gruehle gruehle merged commit e532b74 into master Jul 12, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants