Skip to content

Commit a3b8918

Browse files
committed
editor: TextEditor
1 parent ad86c7f commit a3b8918

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib_src/misc/cells.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { get as weaveGet, moveNext as weaveMoveNext, movePrev as weaveMovePrev }
44

55
import { getLine } from "./blocks.js"
66

7-
import { Point } from "atom"
7+
import { Point, TextEditor } from "atom"
88

9-
export function getRange(editor) {
9+
export function getRange(editor: TextEditor) {
1010
// Cell range is:
1111
// Start of line below top delimiter (and/or start of top row of file) to
1212
// End of line before end delimiter
@@ -48,15 +48,15 @@ export function getRange(editor) {
4848
return [start, end]
4949
}
5050

51-
export function get(editor) {
51+
export function get(editor: TextEditor) {
5252
if (editor.getGrammar().scopeName.indexOf("source.julia") > -1) {
5353
return jlGet(editor)
5454
} else {
5555
return weaveGet(editor)
5656
}
5757
}
5858

59-
function jlGet(editor) {
59+
function jlGet(editor: TextEditor) {
6060
const range = getRange(editor)
6161
let text = editor.getTextInBufferRange(range)
6262
if (text.trim() === "") text = " "
@@ -72,7 +72,7 @@ function jlGet(editor) {
7272
return [res]
7373
}
7474

75-
export function moveNext(editor) {
75+
export function moveNext(editor: TextEditor) {
7676
if (editor == null) {
7777
editor = atom.workspace.getActiveTextEditor()
7878
}
@@ -83,7 +83,7 @@ export function moveNext(editor) {
8383
}
8484
}
8585

86-
function jlMoveNext(editor) {
86+
function jlMoveNext(editor: TextEditor) {
8787
const range = getRange(editor)
8888
const sel = editor.getSelections()[0]
8989
const nextRow = range[1].row + 2 // 2 = 1 to get to delimiter line + 1 more to go past it
@@ -93,7 +93,7 @@ function jlMoveNext(editor) {
9393
])
9494
}
9595

96-
export function movePrev(editor) {
96+
export function movePrev(editor: TextEditor) {
9797
if (editor == null) {
9898
editor = atom.workspace.getActiveTextEditor()
9999
}
@@ -104,7 +104,7 @@ export function movePrev(editor) {
104104
}
105105
}
106106

107-
function jlMovePrev(editor) {
107+
function jlMovePrev(editor: TextEditor) {
108108
const range = getRange(editor)
109109
const prevRow = range[0].row - 2 // 2 = 1 to get to delimiter line + 1 more to go past it
110110
const sel = editor.getSelections()[0]

0 commit comments

Comments
 (0)