From b63d70da01c08c0f5d284ba1689aa842ebb41f3e Mon Sep 17 00:00:00 2001 From: Nikolay Yakimov Date: Sun, 21 Apr 2019 20:40:45 +0300 Subject: [PATCH] [atom] Revert getLastCursor type (#34869) Apparently, `getLastCursor` returning `undefined` was unintened and evidently was at some point silently fixed, at least in most cases. --- types/atom/atom-tests.ts | 3 +-- types/atom/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/types/atom/atom-tests.ts b/types/atom/atom-tests.ts index feb6d9fe31..9a04b9c7b6 100644 --- a/types/atom/atom-tests.ts +++ b/types/atom/atom-tests.ts @@ -17,7 +17,6 @@ declare const mouseEvent: MouseEvent; declare let buffer: Atom.TextBuffer; declare const color: Atom.Color; -declare let maybeCursor: Atom.Cursor | undefined; declare let cursor: Atom.Cursor; declare let cursors: Atom.Cursor[]; declare let decoration: Atom.Decoration; @@ -2790,7 +2789,7 @@ function testTextEditor() { editor.moveToBeginningOfPreviousParagraph(); editor.selectLargerSyntaxNode(); editor.selectSmallerSyntaxNode(); - maybeCursor = editor.getLastCursor(); + cursor = editor.getLastCursor(); str = editor.getWordUnderCursor(); str = editor.getWordUnderCursor({}); diff --git a/types/atom/index.d.ts b/types/atom/index.d.ts index 3e2b8f33d5..fb230420c0 100644 --- a/types/atom/index.d.ts +++ b/types/atom/index.d.ts @@ -1939,7 +1939,7 @@ export class TextEditor { moveToBeginningOfPreviousParagraph(): void; /** Returns the most recently added Cursor. */ - getLastCursor(): Cursor | undefined; + getLastCursor(): Cursor; /** Returns the word surrounding the most recently added cursor. */ getWordUnderCursor(options?: {