Skip to content

Commit 72651d0

Browse files
committed
fix: removing unnessary conditions check
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 30f7796 commit 72651d0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/node_modules/@stdlib/repl/lib/eager_evaluation.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function EagerEvaluator( repl, rli, enabled ) {
7878
* @returns {void}
7979
*
8080
*/
81-
setNonEnumerableReadOnly(EagerEvaluator.prototype, 'onKeypress', function onKeyPress(data, key) {
81+
setNonEnumerableReadOnly(EagerEvaluator.prototype, 'onKeypress', function onKeyPress() {
8282
var cursorPosition;
8383
var executable;
8484
var nlInd;
@@ -88,8 +88,7 @@ setNonEnumerableReadOnly(EagerEvaluator.prototype, 'onKeypress', function onKeyP
8888
var res;
8989
var tmp;
9090

91-
if (!this._enabled || this._rli.line === '' || key.name === 'paste-start' ||
92-
(key.name === 'o' && key.ctrl) || key.name === 'return' || this._repl._completerEngine.isNavigating()) {
91+
if (!this._enabled || this._rli.line === '' || this._repl._completerEngine.isNavigating()) {
9392
return;
9493
}
9594

@@ -154,8 +153,8 @@ setNonEnumerableReadOnly(EagerEvaluator.prototype, 'onKeypress', function onKeyP
154153
* @returns {void}
155154
*
156155
*/
157-
setNonEnumerableReadOnly(EagerEvaluator.prototype, 'beforeKeypress', function beforeKeyPress(data, key) {
158-
if (!this._isPreview || (key.name === 'o' && key.ctrl) ) {
156+
setNonEnumerableReadOnly(EagerEvaluator.prototype, 'beforeKeypress', function beforeKeyPress() {
157+
if (!this._isPreview ) {
159158
return;
160159
}
161160
if ( this._isPreview ) {

0 commit comments

Comments
 (0)