Skip to content

Commit bfda5a4

Browse files
committed
Merge branch 'hotfix/issue-14' into develop
2 parents 9bde0a5 + 4c253e6 commit bfda5a4

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

nodejs-repl.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ when receive the output string"
291291
;; cf. https://www.ecma-international.org/ecma-262/#sec-ecmascript-language-expressions
292292
(defun nodejs-repl--beginning-of-expression ()
293293
(search-backward-regexp "[[:graph:]]" nil t)
294-
(forward-char)
294+
(unless (eq (char-after) ?\;)
295+
(forward-char))
295296
(cond
296297
;; Allow function
297298
((and (eq (char-before) ?})

test/test.el

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,10 @@
169169
(insert "bob; [1,2,3] . map(function(number) { return number * 2 })")
170170
(nodejs-repl--beginning-of-expression)
171171
))
172+
(expect 16
173+
(with-temp-buffer
174+
(js-mode)
175+
(insert "bob; var foo = 1;")
176+
(nodejs-repl--beginning-of-expression)
177+
))
172178
)

0 commit comments

Comments
 (0)