mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Reset font size to window's starting font size
This commit is contained in:
@@ -425,6 +425,19 @@ describe "Workspace", ->
|
||||
expect(atom.config.get('editor.fontSize')).toBe 1
|
||||
workspace.decreaseFontSize()
|
||||
expect(atom.config.get('editor.fontSize')).toBe 1
|
||||
describe "::resetFontSize()", ->
|
||||
it "resets the font size to the window's starting font size", ->
|
||||
originalFontSize = 6
|
||||
|
||||
atom.config.set('editor.fontSize', originalFontSize)
|
||||
workspace.increaseFontSize()
|
||||
expect(atom.config.get('editor.fontSize')).toBe originalFontSize + 1
|
||||
workspace.resetFontSize()
|
||||
expect(atom.config.get('editor.fontSize')).toBe originalFontSize
|
||||
workspace.decreaseFontSize()
|
||||
expect(atom.config.get('editor.fontSize')).toBe originalFontSize - 1
|
||||
workspace.resetFontSize()
|
||||
expect(atom.config.get('editor.fontSize')).toBe originalFontSize
|
||||
|
||||
describe "::openLicense()", ->
|
||||
it "opens the license as plain-text in a buffer", ->
|
||||
|
||||
@@ -612,16 +612,18 @@ class Workspace extends Model
|
||||
|
||||
# Increase the editor font size by 1px.
|
||||
increaseFontSize: ->
|
||||
@originalFontSize ?= atom.config.get("editor.fontSize")
|
||||
atom.config.set("editor.fontSize", atom.config.get("editor.fontSize") + 1)
|
||||
|
||||
# Decrease the editor font size by 1px.
|
||||
decreaseFontSize: ->
|
||||
@originalFontSize ?= atom.config.get("editor.fontSize")
|
||||
fontSize = atom.config.get("editor.fontSize")
|
||||
atom.config.set("editor.fontSize", fontSize - 1) if fontSize > 1
|
||||
|
||||
# Restore to a default editor font size.
|
||||
# Restore to the window's original editor font size.
|
||||
resetFontSize: ->
|
||||
atom.config.unset("editor.fontSize")
|
||||
atom.config.set("editor.fontSize", @originalFontSize)
|
||||
|
||||
# Removes the item's uri from the list of potential items to reopen.
|
||||
itemOpened: (item) ->
|
||||
|
||||
Reference in New Issue
Block a user