GithubHelp home page GithubHelp logo

Comments (6)

carocad avatar carocad commented on September 26, 2024

hey @steveaft,
I think this is a configuration problem, not a bug.

This is my personal tab configuration for Lighttable:
[:editor :lt.objs.editor/tab-settings false 4 2]
You should have something similar in your user.behaviors, if you don't know what that is simply open the command panel, type user behavior and open it. You should be able to configure your tab/spaces whichever way you want. The config that I showed above says to use spaces instead of tabs (false), and indents everything with 2 spaces. tabs are configured to be 4 spaces.

hope that helps

from clojure.

steveaft avatar steveaft commented on September 26, 2024

I agree it is probably some configuration issue but can't figure out what.
When I have some time to look again I'll probably add logging statements to the codemirror files and the lighttable ones

I have my tabs set to false 4 4, for :editor, but I tried yours with same effect. Here is what I have:

 [:editor :lt.objs.editor/tab-settings false 4 4]
 [:editor.clojure :lt.objs.editor/tab-settings false 2 2]
 [:editor.clojurescript :lt.objs.editor/tab-settings false 2 2]

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

(defn x [] 
  (log "foo"))

and I smart indent, it ends up as

(defn x []
    (log "foo"))

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.

from clojure.

carocad avatar carocad commented on September 26, 2024

mmm weird,
I can't reproduce this behavior in my LT. I used your configuration and everything works fine.
Could you tell me your system and LT specifications?

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.

from clojure.

steveaft avatar steveaft commented on September 26, 2024

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.
lighttable 0.8.1

from clojure.

kenny-evitt avatar kenny-evitt commented on September 26, 2024

@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:

from clojure.

steveaft avatar steveaft commented on September 26, 2024

I did try uninstalling plugins but didn't do a complete purge. I'll give that a try

from clojure.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.