@@ -85,8 +85,8 @@ function getRange(editor, row) {
85
85
}
86
86
}
87
87
88
- function getSelection ( editor , sel ) {
89
- const { start, end } = sel . getBufferRange ( )
88
+ function getSelection ( editor , selection ) {
89
+ const { start, end } = selection . getBufferRange ( )
90
90
const range = [
91
91
[ start . row , start . column ] ,
92
92
[ end . row , end . column ]
@@ -102,37 +102,37 @@ function getSelection(editor, sel) {
102
102
return range
103
103
}
104
104
105
- export function moveNext ( editor , sel , range ) {
105
+ export function moveNext ( editor , selection , range ) {
106
106
// Ensure enough room at the end of the buffer
107
107
const row = range [ 1 ] [ 0 ]
108
108
let last
109
109
while ( ( last = editor . getLastBufferRow ( ) ) < row + 2 ) {
110
110
if ( last !== row && ! isBlank ( getLine ( editor , last ) ) ) {
111
111
break
112
112
}
113
- sel . setBufferRange ( [
113
+ selection . setBufferRange ( [
114
114
[ last , Infinity ] ,
115
115
[ last , Infinity ]
116
116
] )
117
- sel . insertText ( "\n" )
117
+ selection . insertText ( "\n" )
118
118
}
119
119
// Move the cursor
120
120
let to = row + 1
121
121
while ( to < editor . getLastBufferRow ( ) && isBlank ( getLine ( editor , to ) ) ) {
122
122
to ++
123
123
}
124
124
to = walkForward ( editor , to )
125
- return sel . setBufferRange ( [
125
+ return selection . setBufferRange ( [
126
126
[ to , Infinity ] ,
127
127
[ to , Infinity ]
128
128
] )
129
129
}
130
130
131
131
function getRanges ( editor ) {
132
- const ranges = editor . getSelections ( ) . map ( sel => {
132
+ const ranges = editor . getSelections ( ) . map ( selection => {
133
133
return {
134
- selection : sel ,
135
- range : sel . isEmpty ( ) ? getRange ( editor , sel . getHeadBufferPosition ( ) . row ) : getSelection ( editor , sel )
134
+ selection : selection ,
135
+ range : selection . isEmpty ( ) ? getRange ( editor , selection . getHeadBufferPosition ( ) . row ) : getSelection ( editor , selection )
136
136
}
137
137
} )
138
138
return ranges . filter ( ( { range } ) => {
0 commit comments