Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit bd2e81f

Browse files
committed
Add compiled comments from 1229c28
It seems that the compiled `lib` files were not committed in 1229c28
1 parent 27d5570 commit bd2e81f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/main.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ module.exports = {
7070
rules = ignoredRulesWhenFixing;
7171
}
7272

73+
// The fix replaces the file content and the cursor jumps automatically
74+
// to the beginning of the file, so save current cursor position
7375
const cursorPosition = editor.getCursorBufferPosition();
7476
this.worker.request('job', {
7577
type: 'fix',
@@ -78,6 +80,7 @@ module.exports = {
7880
filePath,
7981
projectPath
8082
}).then(() => {
83+
// set cursor to the position before fix job
8184
editor.setCursorBufferPosition(cursorPosition);
8285
}).catch(err => {
8386
atom.notifications.addWarning(err.message);
@@ -117,6 +120,8 @@ module.exports = {
117120
rules = ignoredRulesWhenFixing;
118121
}
119122

123+
// The fix replaces the file content and the cursor jumps automatically
124+
// to the beginning of the file, so save current cursor position
120125
const cursorPosition = textEditor.getCursorBufferPosition();
121126
this.worker.request('job', {
122127
type: 'fix',
@@ -125,6 +130,7 @@ module.exports = {
125130
filePath,
126131
projectPath
127132
}).then(response => atom.notifications.addSuccess(response)).then(() => {
133+
// set cursor to the position before fix job
128134
textEditor.setCursorBufferPosition(cursorPosition);
129135
}).catch(err => {
130136
atom.notifications.addWarning(err.message);

0 commit comments

Comments
 (0)