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

Commit

Permalink
Revert "Merge pull request #853 from yacut/restore-cursor-position-af…
Browse files Browse the repository at this point in the history
…ter-fix"

This reverts commit 27d5570.
  • Loading branch information
Arcanemagus committed Apr 13, 2017
1 parent 520a5aa commit 605b108
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
12 changes: 0 additions & 12 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,12 @@ module.exports = {
rules = ignoredRulesWhenFixing;
}

// The fix replaces the file content and the cursor jumps automatically
// to the beginning of the file, so save current cursor position
const cursorPosition = editor.getCursorBufferPosition();
_this.worker.request('job', {
type: 'fix',
config: atom.config.get('linter-eslint'),
rules,
filePath,
projectPath
}).then(function () {
// set cursor to the position before fix job
editor.setCursorBufferPosition(cursorPosition);
}).catch(function (err) {
atom.notifications.addWarning(err.message);
});
Expand Down Expand Up @@ -189,9 +183,6 @@ module.exports = {
rules = ignoredRulesWhenFixing;
}

// The fix replaces the file content and the cursor jumps automatically
// to the beginning of the file, so save current cursor position
const cursorPosition = textEditor.getCursorBufferPosition();
_this.worker.request('job', {
type: 'fix',
config: atom.config.get('linter-eslint'),
Expand All @@ -200,9 +191,6 @@ module.exports = {
projectPath
}).then(function (response) {
return atom.notifications.addSuccess(response);
}).then(function () {
// set cursor to the position before fix job
textEditor.setCursorBufferPosition(cursorPosition);
}).catch(function (err) {
atom.notifications.addWarning(err.message);
});
Expand Down
14 changes: 1 addition & 13 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,12 @@ module.exports = {
rules = ignoredRulesWhenFixing
}

// The fix replaces the file content and the cursor jumps automatically
// to the beginning of the file, so save current cursor position
const cursorPosition = editor.getCursorBufferPosition()
this.worker.request('job', {
type: 'fix',
config: atom.config.get('linter-eslint'),
rules,
filePath,
projectPath
}).then(() => {
// set cursor to the position before fix job
editor.setCursorBufferPosition(cursorPosition)
}).catch((err) => {
atom.notifications.addWarning(err.message)
})
Expand Down Expand Up @@ -176,9 +170,6 @@ module.exports = {
rules = ignoredRulesWhenFixing
}

// The fix replaces the file content and the cursor jumps automatically
// to the beginning of the file, so save current cursor position
const cursorPosition = textEditor.getCursorBufferPosition()
this.worker.request('job', {
type: 'fix',
config: atom.config.get('linter-eslint'),
Expand All @@ -187,10 +178,7 @@ module.exports = {
projectPath
}).then(response =>
atom.notifications.addSuccess(response)
).then(() => {
// set cursor to the position before fix job
textEditor.setCursorBufferPosition(cursorPosition)
}).catch((err) => {
).catch((err) => {
atom.notifications.addWarning(err.message)
})
}
Expand Down

0 comments on commit 605b108

Please sign in to comment.