Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

auto-indent produces non-equivalent coffeescript #40

Open
tony-kerz opened this issue Sep 8, 2014 · 8 comments
Open

auto-indent produces non-equivalent coffeescript #40

tony-kerz opened this issue Sep 8, 2014 · 8 comments

Comments

@tony-kerz
Copy link

hey kev,

awesome job so far on the cs language plugin and atom in general!

i just wanted to document the following scenario:

i have the following coffeescript:

module.exports =
  build_dir: 'build'
  compile_dir: 'bin'
  app_files:
    js: [ 'src/**/*.js', '!src/**/*.spec.js', '!src/assets/**/*.js' ]
    json: [ 'src/**/*.json' ]
    jsunit: [ 'src/**/*.spec.js' ]
    coffee: [ 'src/**/*.coffee', '!src/**/*.spec.coffee' ]
    coffeeunit: [ 'src/**/*.spec.coffee' ]
    atpl: [ 'src/app/**/*.tpl.html' ]
    ctpl: [ 'src/common/**/*.tpl.html' ]
    html: [ 'src/index.html' ]
    less: 'src/less/main.less'
  test_files:
    js: [ 'vendor/angular-mocks/angular-mocks.js' ]
  vendor_files:
    js: [
      'vendor/angular/angular.js'
      'vendor/angular-bootstrap/ui-bootstrap-tpls.min.js'
      'vendor/bower-angular-placeholders/angular-placeholders.js'
      'vendor/angular-ui-router/release/angular-ui-router.js'
      'vendor/angular-ui-utils/modules/route/route.js'
      # tk
      'vendor/jquery/dist/jquery.js'
      'vendor/bootstrap/dist/js/bootstrap.js'
      #'vendor/bootstrap/js/collapse.js'
      #'vendor/bootstrap/js/transition.js'
      'vendor/angular-flash/dist/angular-flash.js'
      'vendor/lodash/dist/lodash.js'
    ]
    css: []
    assets: [ 'vendor/font-awesome/fonts/*' ]
    fonts: [ 'vendor/font-awesome/fonts/*' ]

and when i run auto-indent on it, i get the following (notice how test_files lines up under less) non-equivalent coffeescript:

module.exports =
  build_dir: 'build'
  compile_dir: 'bin'
  app_files:
    js: [ 'src/**/*.js', '!src/**/*.spec.js', '!src/assets/**/*.js' ]
    json: [ 'src/**/*.json' ]
    jsunit: [ 'src/**/*.spec.js' ]
    coffee: [ 'src/**/*.coffee', '!src/**/*.spec.coffee' ]
    coffeeunit: [ 'src/**/*.spec.coffee' ]
    atpl: [ 'src/app/**/*.tpl.html' ]
    ctpl: [ 'src/common/**/*.tpl.html' ]
    html: [ 'src/index.html' ]
    less: 'src/less/main.less'
    test_files:
      js: [ 'vendor/angular-mocks/angular-mocks.js' ]
      vendor_files:
        js: [
          'vendor/angular/angular.js'
          'vendor/angular-bootstrap/ui-bootstrap-tpls.min.js'
          'vendor/bower-angular-placeholders/angular-placeholders.js'
          'vendor/angular-ui-router/release/angular-ui-router.js'
          'vendor/angular-ui-utils/modules/route/route.js'
          # tk
          'vendor/jquery/dist/jquery.js'
          'vendor/bootstrap/dist/js/bootstrap.js'
          #'vendor/bootstrap/js/collapse.js'
          #'vendor/bootstrap/js/transition.js'
          'vendor/angular-flash/dist/angular-flash.js'
          'vendor/lodash/dist/lodash.js'
        ]
        css: []
        assets: [ 'vendor/font-awesome/fonts/*' ]
        fonts: [ 'vendor/font-awesome/fonts/*' ]

regards,
tony.

@nmccready
Copy link

@valtido
Copy link

valtido commented Nov 19, 2014

I get the same thing when I paste... I think this is probably a problem with v.147 of atom than this plugin (just a gut feeling)

@nmccready
Copy link

Python is broke too.

@afinne
Copy link

afinne commented Dec 12, 2014

Experienced this on 0.153.0. In the first try, I select the block, press tab, with the correct result. In the second try, I do a vertical "multi-cursor", press tab, with unexpected results.
atom-tabbing

@nmccready
Copy link

@afinne nice find this should help narrow it down!

@nmccready
Copy link

Related to #20

@muppetjones
Copy link

The indent problem is atom-wide (since 0.192 as far as I can tell): here.

@nmccready, I noticed it first in python, too

@nmccready
Copy link

Whomever is in charge of this should look at https://atom.io/packages/atom-beautify . As the indenting works perfectly there for CoffeeScript.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants