-
Notifications
You must be signed in to change notification settings - Fork 47
Clojure/Clojurescript smart indent is always 4 spaces #86
Comments
hey @steveaft, This is my personal tab configuration for Lighttable: hope that helps |
I agree it is probably some configuration issue but can't figure out what. I have my tabs set to false 4 4, for :editor, but I tried yours with same effect. Here is what I have:
But if I select a chunk of code and hit shift-tab (smart indent) it doesn't seem to do the two-space indenting (nor if I split a line with a carriage return) So if I have
and I smart indent, it ends up as
If I manually delete the whitespace in front of (log "foo"), then put my cursor at the start of the line and hit tab, it indents 2 spaces If I look at the codemirror clojure file it seems like it should end up knowing my tab is 2 spaces but I get 4 on the smart indent. |
mmm weird, And as a remark: did you manually make the shift + tab keybinding in your LT? because I don't have that keybinding, so do it through the command panel and it works fine with the function and configuration that you gave me. Could you try that please? PS: I get a similar behavior only when working outside of clojure(script) files, for example, if I try shift + tab in a behaviors file, it inserts two extra spaces at the beginning of the line. But that is a correct behavior since your configuration is 4 4 for any editor that is not clojure(script). If I put it in 2 2 then everything works as expected. |
Hmm I don't have shift-tab set to anything, it just seems to always have the same effect as running the smart indent command. I also installed keymapper plugin, and don't see shift-tab set to anything. Running smart-indent through the command panel has the same effect. If I take a cljs file, set the syntax to something else like "C++", then I do smart-indent, it indents quite differently (1 space indents in that case), so it seems that somehow it is the clojure plugin. I'm running on a mac, latest os, all updates installed. |
@steveaft You mentioned you have the Keymapper plugin installed. What other plugins do you have installed? Would you try reproducing this with a clean install without any other plugins (other than the defaults) installed? See this issue for details on uninstalling everything: |
I did try uninstalling plugins but didn't do a complete purge. I'll give that a try |
I've looked through the issues on this repo, and looked through issues on Google Groups, but don't quite know what would be different about my setup -- I don't see any of the behaviors related to clojure formatting correctly.
I just have a regular lighttable install, and I have the closure plugin (latest 0.3.2) I almost always get 4 space indents --
Am I supposed to override something somewhere, or hack the codemirror file actually get 2 space indents?
I have my tabs set to 2 spaces, and if I move the cursor to the leftmost column and hit "tab" I actually get two spaces, so this seems to only be an issue with smart indent, which seems to trigger anytime I hit the enter key
The text was updated successfully, but these errors were encountered: