Skip to content

Commit

Permalink
fix: accept null in updateCurrentEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Feb 6, 2021
1 parent 741bb9b commit 286a0f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/signature-help-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class SignatureHelpManager {
* it has been decided to track this instance
* @param editor the Atom Text editor instance to be tracked
*/
updateCurrentEditor(editor: TextEditor) {
updateCurrentEditor(editor: TextEditor | null) {
if (editor === this.editor) {
return
}
Expand All @@ -157,7 +157,7 @@ export class SignatureHelpManager {
this.editor = null
this.editorView = null

if (!atom.workspace.isTextEditor(editor)) {
if (!editor || !atom.workspace.isTextEditor(editor)) {
return
}

Expand Down Expand Up @@ -306,6 +306,7 @@ export class SignatureHelpManager {
}
const hight = view.element.getBoundingClientRect().height
const lineHight = editor.getLineHeightInPixels()
//@ts-ignore internal type
const availableHight = (position.row - editor.getFirstVisibleScreenRow()) * lineHight
if (hight < availableHight + 80) {
overlay.style.transform = `translateY(-${lineHight + hight}px)`
Expand Down

0 comments on commit 286a0f1

Please sign in to comment.