mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Set the height of the line number gutter explicitly
This commit is contained in:
committed by
Antonio Scandurra
parent
4e834da3e3
commit
61583462cf
@@ -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)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -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
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user