From eb410431ba0f2388ddee99df176a89f66e031a4d Mon Sep 17 00:00:00 2001 From: steven nguyen Date: Fri, 3 Sep 2021 10:59:19 -0500 Subject: [PATCH 1/2] Fix `this` bug See https://github.com/atom/find-and-replace/commit/9da051259931daac46feba55f26d3dcea9b39abd#commitcomment-55840601 --- lib/find-view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/find-view.js b/lib/find-view.js index c20d22e1..09c008f5 100644 --- a/lib/find-view.js +++ b/lib/find-view.js @@ -235,7 +235,7 @@ class FindView { 'find-and-replace:use-selection-as-replace-pattern': this.setSelectionAsReplacePattern.bind(this) })); - this.refs.replaceNextButton.addEventListener('click', e => e.shiftKey ? this.replacePrevious() : this.replaceNext())); + this.refs.replaceNextButton.addEventListener('click', e => e.shiftKey ? this.replacePrevious.bind(this) : this.replaceNext.bind(this))); this.refs.replaceAllButton.addEventListener('click', this.replaceAll.bind(this)); this.subscriptions.add(atom.commands.add('atom-workspace', { 'find-and-replace:replace-previous': this.replacePrevious.bind(this), From 62cb143c5702f377406766e08412a7590ab1f8e0 Mon Sep 17 00:00:00 2001 From: steven nguyen Date: Fri, 3 Sep 2021 13:51:32 -0500 Subject: [PATCH 2/2] there's an extra paren --- lib/find-view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/find-view.js b/lib/find-view.js index 09c008f5..204de714 100644 --- a/lib/find-view.js +++ b/lib/find-view.js @@ -235,7 +235,7 @@ class FindView { 'find-and-replace:use-selection-as-replace-pattern': this.setSelectionAsReplacePattern.bind(this) })); - this.refs.replaceNextButton.addEventListener('click', e => e.shiftKey ? this.replacePrevious.bind(this) : this.replaceNext.bind(this))); + this.refs.replaceNextButton.addEventListener('click', e => e.shiftKey ? this.replacePrevious.bind(this) : this.replaceNext.bind(this)); this.refs.replaceAllButton.addEventListener('click', this.replaceAll.bind(this)); this.subscriptions.add(atom.commands.add('atom-workspace', { 'find-and-replace:replace-previous': this.replacePrevious.bind(this),