File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/vs/editor/contrib/rename/browser Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -179,9 +179,12 @@ export class RenameInputField implements IContentWidget {
179
179
180
180
const bodyBox = getClientArea ( this . getDomNode ( ) . ownerDocument . body ) ;
181
181
const editorBox = getDomNodePagePosition ( this . _editor . getDomNode ( ) ) ;
182
- const cursorBox = this . _editor . getScrolledVisiblePosition ( this . _position ! ) ;
183
182
184
- this . _nPxAvailableAbove = cursorBox . top + editorBox . top ;
183
+ // FIXME@ulugbekna : can getVisibleRanges() be empty? if so what to do about it
184
+ const firstLineInViewport = this . _editor . getVisibleRanges ( ) [ 0 ] . startLineNumber ;
185
+ const cursorBoxTop = this . _editor . getTopForLineNumber ( this . _position ! . lineNumber ) - this . _editor . getTopForLineNumber ( firstLineInViewport ) ;
186
+
187
+ this . _nPxAvailableAbove = cursorBoxTop + editorBox . top ;
185
188
this . _nPxAvailableBelow = bodyBox . height - this . _nPxAvailableAbove ;
186
189
187
190
const lineHeight = this . _editor . getOption ( EditorOption . lineHeight ) ;
You can’t perform that action at this time.
0 commit comments