Set the height of the line number gutter explicitly

This commit is contained in:
Nathan Sobo
2017-03-27 10:23:55 -06:00
committed by Antonio Scandurra
parent 4e834da3e3
commit 61583462cf
2 changed files with 9 additions and 6 deletions

View File

@@ -108,15 +108,18 @@ fdescribe('TextEditorComponent', () => {
it('gives the line number tiles an explicit width and height so their layout can be strictly contained', async () => {
const {component, element, editor} = buildComponent({rowsPerTile: 3})
const gutterElement = component.refs.lineNumberGutter.element
for (const child of gutterElement.children) {
expect(child.offsetWidth).toBe(gutterElement.offsetWidth)
const lineNumberGutterElement = component.refs.lineNumberGutter.element
expect(lineNumberGutterElement.offsetHeight).toBe(component.getScrollHeight())
for (const child of lineNumberGutterElement.children) {
expect(child.offsetWidth).toBe(lineNumberGutterElement.offsetWidth)
}
editor.setText('\n'.repeat(99))
await component.getNextUpdatePromise()
for (const child of gutterElement.children) {
expect(child.offsetWidth).toBe(gutterElement.offsetWidth)
expect(lineNumberGutterElement.offsetHeight).toBe(component.getScrollHeight())
for (const child of lineNumberGutterElement.children) {
expect(child.offsetWidth).toBe(lineNumberGutterElement.offsetWidth)
}
})

View File

@@ -2151,7 +2151,7 @@ class LineNumberGutterComponent {
{
className: 'gutter line-numbers',
attributes: {'gutter-name': 'line-number'},
style: {position: 'relative'},
style: {position: 'relative', height: height + 'px'},
on: {
mousedown: this.didMouseDown
},