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

Overwrite mode improvements #6777

Merged
merged 2 commits into from
Feb 12, 2014
Merged

Conversation

WebsiteDeveloper
Copy link
Contributor

Combined #6670 and #6328 into this pull request as requested.
Waiting for review.
@redmunds

$statusOverwrite.text(Strings.STATUSBAR_INSERT);
} else {
$statusOverwrite.text(Strings.STATUSBAR_OVERWRITE);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This:

        if (!newstate) {
            $statusOverwrite.text(Strings.STATUSBAR_INSERT);
        } else {
            $statusOverwrite.text(Strings.STATUSBAR_OVERWRITE);
        }

can be simplified to:

        $statusOverwrite.text(newstate ? Strings.STATUSBAR_OVERWRITE : Strings.STATUSBAR_INSERT);

@WebsiteDeveloper
Copy link
Contributor Author

@redmunds fixes pushed.

@@ -151,6 +169,7 @@ define(function (require, exports, module) {
if (!current) {
StatusBar.hide(); // calls resizeEditor() if needed
} else {
current.toggleOverwrite($statusOverwrite.text() === Strings.STATUSBAR_OVERWRITE);
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't be updating individual indicators here. This should be isolated to a function and called below (e.g. _updateLanguageInfo()).

@redmunds
Copy link
Contributor

redmunds commented Feb 6, 2014

Done with initial review. This works great!

Only other issue is that the cursor should change to a hand (pointer) when mouse is over status bar.

Once all issues have been addressed, this branch should be rebased. After I merge it, then I'll open bug against CodeMirror for scrollCursorIntoView() issue.

@redmunds
Copy link
Contributor

@WebsiteDeveloper Maybe you missed my "Done with review" comment, so tagging you on it this time.

@WebsiteDeveloper
Copy link
Contributor Author

@redmunds i absolutely missed that.
I rebased the branch and fixed the two minor issues you noted

@@ -1381,4 +1393,4 @@ label input {

.install-extension-dialog .spinner {
margin-left: 10px;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@WebsiteDeveloper Once again, it makes reviewing code so much easier if you don't alter whitespace -- especially when it is not related to the code being changed. In this case, even the newline at the end of the file was removed. Restore whitespace that is not related to the code being changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This end of file change must have happened when i fixed the rebase conflicts. And by the way it reviewing is just as easy if you append ?w=0 to the url

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I'm familiar with ?w=1, but that also hides incorrect indenting and missing newline at end of file.

@redmunds
Copy link
Contributor

@WebsiteDeveloper Done with review. This is looking great. 1 comment about whitespace "fixing".

Could you also add a couple tests to the EditOptionHandler-test tests? I think you could use SpecRunnerUtils.simulateKeyEvent() to test that doc is correctly updated in both insert and overwrite modes. This would be ok as a separate pull request.

@WebsiteDeveloper
Copy link
Contributor Author

@redmunds
Alright i will add a couple of tests i a subsequent pull.
As to the whitespaces is it sufficient if i add the one newline at the end and leave the rest as they are?

@redmunds
Copy link
Contributor

@WebsiteDeveloper Are you using an extension that automatically updates the whitespace? If so, Brackets (as of Sprint 36) now supports project-level preferences so can you disable (or change params for) that extension in the Brackets project?

@WebsiteDeveloper
Copy link
Contributor Author

I used to. But i removed it.

@redmunds
Copy link
Contributor

@WebsiteDeveloper

is it sufficient if i add the one newline at the end and leave the rest as they are?

I can live with it one last time :)

@WebsiteDeveloper
Copy link
Contributor Author

alright

@WebsiteDeveloper
Copy link
Contributor Author

@redmunds added the newline

@redmunds
Copy link
Contributor

Looks great. Thanks. Merging.

redmunds added a commit that referenced this pull request Feb 12, 2014
@redmunds redmunds merged commit 25be547 into adobe:master Feb 12, 2014
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.

2 participants