Skip to content

Commit

Permalink
Fix #49: bug with hitting backspace after line comment
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Apr 15, 2024
1 parent bddb64f commit 145ca14
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Unreleased

- Bump squint to 0.7.105
- Fix [#49](https://github.com/nextjournal/clojure-mode/issues/49): bug with hitting backspace after line comment

## 0.3.1

- Fix [#45](https://github.com/nextjournal/clojure-mode/issues/45): cursor after Discard node should evaluate child
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
(j/fn [^:js {:keys [from to head anchor empty]}]
(cond
(in-string? state from)
(if (= open \")
(if (= \" open)
(u/insertion head "\\\"")
(u/insertion from to open))
;; allow typing escaped bracket
Expand Down
2 changes: 1 addition & 1 deletion src-shared/nextjournal/clojure_mode/util.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
(defn line-content-at [state from]
(-> state
(j/call-in [:doc :lineAt] from)
(j/call :slice)))
(j/get :text)))

(defn map-cursor [^js original-range ^js state update-map]
{:pre [(map? update-map)]}
Expand Down
2 changes: 2 additions & 0 deletions test/nextjournal/clojure_mode_tests.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@
"\"| \"" "\"| \"" ;; do not delete string with whitespace
":x :a |" ":x :a|" ;; do not format on backspace
"\"[|]\"" "\"|]\"" ;; normal deletion inside strings
"( ;;\n|)" "( ;;|\n)" ;; don't put paren behind line comment
"( ;|\n)" "( |\n)"
))

#?(:squint nil
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1176,10 +1176,10 @@ source-map@^0.5.6:
resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz"
integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=

squint-cljs@0.4.81:
version "0.4.81"
resolved "https://registry.yarnpkg.com/squint-cljs/-/squint-cljs-0.4.81.tgz#b1926c112a5caa12ed4ecc6f9035827dc4270bb7"
integrity sha512-ffMxWbL901+xHMlaXeUavfrhK+uX7tsZYzF9/kxJYGZ6+KLOGy1Ke9+osbVNR+Vd/uszX6O/YcpNxCJzThgTUA==
squint-cljs@0.7.105:
version "0.7.105"
resolved "https://registry.yarnpkg.com/squint-cljs/-/squint-cljs-0.7.105.tgz#848a588aaf5d19593b2d8b24bad026382435a4ff"
integrity sha512-YtnPewo1ZM5p9kaC6j/rNw4F/FzsLaAS61Vhikw6z6dRJvns/Y/3rwGcb8BCoD6Abx23/frlk0B4/xhedgCbUw==
dependencies:
chokidar "^3.5.3"

Expand Down

0 comments on commit 145ca14

Please sign in to comment.