mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Only reset font size if font size has been changed
This commit is contained in:
@@ -425,6 +425,7 @@ 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
|
||||
@@ -439,6 +440,13 @@ describe "Workspace", ->
|
||||
workspace.resetFontSize()
|
||||
expect(atom.config.get('editor.fontSize')).toBe originalFontSize
|
||||
|
||||
it "does nothing if the font size has not been changed", ->
|
||||
originalFontSize = 6
|
||||
|
||||
atom.config.set('editor.fontSize', originalFontSize)
|
||||
workspace.resetFontSize()
|
||||
expect(atom.config.get('editor.fontSize')).toBe originalFontSize
|
||||
|
||||
describe "::openLicense()", ->
|
||||
it "opens the license as plain-text in a buffer", ->
|
||||
waitsForPromise -> workspace.openLicense()
|
||||
|
||||
@@ -623,7 +623,8 @@ class Workspace extends Model
|
||||
|
||||
# Restore to the window's original editor font size.
|
||||
resetFontSize: ->
|
||||
atom.config.set("editor.fontSize", @originalFontSize)
|
||||
if @originalFontSize
|
||||
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