You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (this.correctCharsInLine===expectedText.length) {
163
161
this.cm.execCommand('goCharRight');
164
162
this.currentLine+=1;
@@ -190,6 +188,14 @@ export default {
190
188
this.stats.lastThirdStartTime=this.timeElapsed();
191
189
}
192
190
191
+
console.blue(this.currentLine);
192
+
console.red(this.cm.getLine(this.currentLine));
193
+
if (this.currentLine+1===this.codeInfo.lines&&this.cm.getLine(this.currentLine).trim().length===0) {
194
+
console.red('Last line is empty');
195
+
this.stats.history.push(this.currentChange);
196
+
this.completed();
197
+
}
198
+
193
199
if (this.options.autoIndent) {
194
200
this.cm.execCommand('goLineStartSmart');
195
201
this.currentChar=this.cm.getCursor().ch;
@@ -200,8 +206,8 @@ export default {
200
206
}
201
207
if (this.options.underScore) {
202
208
let underScoreWidth =1;
203
-
if (!this.options.autoIndent&&this.cm.getLine(this.currentLine).slice(0, this.tabWidth) ===Array(this.tabWidth).fill('').join('')) {
204
-
underScoreWidth =this.tabWidth;
209
+
if (!this.options.autoIndent&&this.cm.getLine(this.currentLine).slice(0, this.codeInfo.tabSize) ===Array(this.codeInfo.tabSize).fill('').join('')) {
210
+
underScoreWidth =this.codeInfo.tabSize;
205
211
}
206
212
this.cm.markText(
207
213
{ line:this.currentLine, ch:this.currentChar },
@@ -229,11 +235,11 @@ export default {
229
235
let text = key;
230
236
231
237
if (key ==='Tab') {
232
-
text =Array(this.tabWidth).fill('').join('');
238
+
text =Array(this.codeInfo.tabSize).fill('').join('');
233
239
// console.log(`tabText: '${text}'`);
234
240
235
-
if (expectedText ===''&&this.language.name!=='Whitespace') {
236
-
if (lineText.slice(this.currentChar, this.currentChar+this.tabWidth) === text) {
241
+
if (expectedText ===''&&this.codeInfo.language.name!=='Whitespace') {
242
+
if (lineText.slice(this.currentChar, this.currentChar+this.codeInfo.tabSize) === text) {
237
243
console.log('tab exception');
238
244
expectedText = text;
239
245
}
@@ -284,8 +290,8 @@ export default {
284
290
} elseif (this.options.underScore) {
285
291
if (this.currentChar!==lineText.length) {
286
292
let underScoreWidth =1;
287
-
if (!this.options.autoIndent&&this.cm.getLine(this.currentLine).slice(this.currentChar, this.tabWidth+this.currentChar) ===Array(this.tabWidth).fill('').join('')) {
288
-
underScoreWidth =this.tabWidth;
293
+
if (!this.options.autoIndent&&this.cm.getLine(this.currentLine).slice(this.currentChar, this.codeInfo.tabSize+this.currentChar) ===Array(this.codeInfo.tabSize).fill('').join('')) {
294
+
underScoreWidth =this.codeInfo.tabSize;
289
295
}
290
296
this.cm.markText(
291
297
{ line:this.currentLine, ch:this.currentChar },
@@ -449,8 +455,8 @@ export default {
449
455
450
456
if (this.options.underScore) {
451
457
let underScoreWidth =1;
452
-
if (!this.options.autoIndent&&this.cm.getLine(this.currentLine).slice(this.currentChar, this.tabWidth+this.currentChar) ===Array(this.tabWidth).fill('').join('')) {
453
-
underScoreWidth =this.tabWidth;
458
+
if (!this.options.autoIndent&&this.cm.getLine(this.currentLine).slice(this.currentChar, this.codeInfo.tabSize+this.currentChar) ===Array(this.codeInfo.tabSize).fill('').join('')) {
0 commit comments