clojure-emacs / clojure-emacs/clojure-mode

Reader conditional confuses indentation

Open
#620 0 comments 0 reactions 0 assignees View on GitHub
bug help wanted indentation
Dominant language
Emacs Lisp
Stars
1k
Forks
249
PR merge metrics
No merged PRs in 30d

Description

## Expected behavior

```clj
(reify
Object

#?@(:clj
[(equals
[this other])

(hashCode
[_]
(hash 1))]

:cljs
[(toJSON
[this]
(throw (ex-info "error" {})))

IEquiv

(-equiv
[this other]
true)]))
```

## Actual behavior

```clj

(reify
Object

#?@(:clj
[(equals
[this other]) ; <------

(hashCode
[_]
(hash 1))]

:cljs
[(toJSON
[this] ; <------
(throw (ex-info "error" {})))

IEquiv

(-equiv
[this other]
true)]))

```

## Steps to reproduce the problem

`(setq clojure-indent-style 'align-arguments)`
(But the problem is the same with `'always-align`.)

Paste in a buffer and indent.

(C-x h TAB)

## Environment & Version information

### clojure-mode version

`M-x
clojure-mode-display-version`

clojure-mode (version nil)

When checking in packages:
20220418.2015

### Emacs version

28.1

### Operating system

Ubuntu 18.04.6 LTS

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.