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

Fontsize #888

Merged
merged 11 commits into from May 18, 2012
Merged

Fontsize #888

merged 11 commits into from May 18, 2012

Conversation

cantrell
Copy link
Contributor

Added the ability to increase and decrease the font size of the editor using Ctrl -/+. The change should be persistent across all editors, but not persistent across sessions.

Note that the change to brackets_codemirror_override.less is only temporary and can be removed once we either update CodeMirror2, or once we merge codemirror.css separately.

…iptor so that if the key is empty, it can check to if it's because the key was '-'. There are many ways to enable '-' as a keyboard shortcut, but this seemed by far the least intrusive.
…e to allow pre tags to inherit line-height (and hense, easier to change dynamically).
… pre tags. This is required to handle a CM/bootstrap integration issue, and is fixed in the most recent version of CM, so this can eventually be removed.
@cantrell
Copy link
Contributor Author

I noticed a bug with the in-line editor when changing font sizes so you might want to hold off on this. I have a partial fix, and I'll try to get the rest done tomorrow (15th).

@cantrell
Copy link
Contributor Author

Now inline editors resize exactly as their containing editors do. This request is ready for review.

@@ -21,7 +21,7 @@
*
*/

/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */
/*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, indent: 4, maxerr: 50 */
Copy link
Member

Choose a reason for hiding this comment

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

we prefer to explicitly call out 'window' instead of 'browser'

@ghost ghost assigned njx May 16, 2012
@njx
Copy link
Member

njx commented May 16, 2012

Assigning to me

console.log("KeyMap _buildKeyDescriptor() - No key provided!");
return "";
if (origDescriptor && origDescriptor.search(/^.+--$/) !== -1) { // Check if the binding is for "-"
key = "-";
Copy link
Member

Choose a reason for hiding this comment

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

I think this logic would be better in _normalizeKeyDescriptorString(), since that's actually where the logical loophole is that causes the problem--i.e., it should be treated as a workaround for the fact that we're splitting on "-", and we should explicitly test for the case there.

@njx
Copy link
Member

njx commented May 18, 2012

Initial review finished.

- Added validation to make sure we're only operating on fonts specified as px or em.
- Made the minimum font size check more robust.
- Changed the arguments to _adjustFontSize from "up" and "down" to 1 and -1.
- Replaced document.createElement with some jQuery magic.
- Moved some editor refresh logic into a function inside Editor itself.
@cantrell
Copy link
Contributor Author

Thanks, NJ. All requested changes have been made.

@njx
Copy link
Member

njx commented May 18, 2012

Looks good, merging.

njx added a commit that referenced this pull request May 18, 2012
@njx njx merged commit 469c1d0 into adobe:master May 18, 2012
@njx njx mentioned this pull request Jun 4, 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.

None yet

3 participants