Skip to content

Commit

Permalink
Add line number padding to expected width
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsawicki committed Oct 1, 2012
1 parent a4ad582 commit a03512f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/app/editor-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1494,18 +1494,18 @@ describe "Editor", ->

describe "width", ->
it "sets the width based on largest line number", ->
expect(editor.gutter.lineNumbers.outerWidth()).toBe editor.charWidth * 2
expect(editor.gutter.lineNumbers.outerWidth()).toBe(editor.charWidth * 2 + editor.gutter.calculateLineNumberPadding())

it "updates the width and the left position of the scroll view when total number of lines gains a digit", ->
editor.setText("")

expect(editor.gutter.lineNumbers.outerWidth()).toBe editor.charWidth * 1
expect(editor.gutter.lineNumbers.outerWidth()).toBe(editor.charWidth * 1 + editor.gutter.calculateLineNumberPadding())
expect(parseInt(editor.scrollView.css('left'))).toBe editor.gutter.outerWidth()

for i in [1..9] # Ends on an empty line 10
editor.insertText "#{i}\n"

expect(editor.gutter.lineNumbers.outerWidth()).toBe editor.charWidth * 2
expect(editor.gutter.lineNumbers.outerWidth()).toBe(editor.charWidth * 2 + editor.gutter.calculateLineNumberPadding())
expect(parseInt(editor.scrollView.css('left'))).toBe editor.gutter.outerWidth()

describe "when lines are inserted", ->
Expand Down

0 comments on commit a03512f

Please sign in to comment.