Skip to content
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

Vertical alignment doesn't treat , correctly #367

Closed
arrdem opened this issue Feb 24, 2016 · 5 comments
Closed

Vertical alignment doesn't treat , correctly #367

arrdem opened this issue Feb 24, 2016 · 5 comments

Comments

@arrdem
Copy link
Contributor

arrdem commented Feb 24, 2016

(def ^:private start-element
  {:meta "^", :meta* "#^", :vector "[",       :map "{"
   :list "(", :eval "#=",  :uneval "#_",      :fn "#("
   :set "#{", :deref "@",  :reader-macro "#", :unquote "~"
   :var "#'", :quote "'",  :syntax-quote "`", :unquote-splicing "~@"})

indents with align-vertically to

(def ^:private start-element
  {:meta "^"  , :meta* "#^" , :vector        "["  ,       :map        "{"
   :list "("  , :eval  "#=" ,  :uneval       "#_" ,      :fn          "#("
   :set  "#{" , :deref "@"  ,  :reader-macro "#"  , :unquote          "~"
   :var  "#'" , :quote "'"  ,  :syntax-quote "`"  , :unquote-splicing "~@"})

since , is lexical whitespace, the ,s should remain attached to the preceding forms.

@Malabarba
Copy link
Member

That happens because clojure-forward-logical-sexp doesn't skip over the comma. I wonder whether we should fix that in forward-sexp, clojure-forward-logical-sexp, or in clojure-align.

@bbatsov
Copy link
Member

bbatsov commented Mar 17, 2016

Seems to me forward-sexp would be the best place to fix this, as everything else builds on top of it.

@arrdem
Copy link
Contributor Author

arrdem commented Mar 17, 2016

I'll take a swing at this after I get 8hrs.

@bbatsov
Copy link
Member

bbatsov commented Mar 24, 2016

@arrdem I guess you meant to write 8days. :-)

@arrdem
Copy link
Contributor Author

arrdem commented Mar 24, 2016

squints, drags self out of bed

arrdem added a commit to arrdem/clojure-mode that referenced this issue Mar 26, 2016
This causes clojure-forward-logical-sexp to skip over , when for
instance computing vertical alignments.

Fixes clojure-emacs#367
arrdem added a commit to arrdem/clojure-mode that referenced this issue Mar 26, 2016
This causes clojure-forward-logical-sexp to skip over , when for
instance computing vertical alignments.

Fixes clojure-emacs#367
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants