Skip to content

Fix #49: bug with hitting backspace after line comment #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading