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

functions in parentheses not indenting #4

Open
GoogleCodeExporter opened this issue Feb 25, 2016 · 5 comments
Open

functions in parentheses not indenting #4

GoogleCodeExporter opened this issue Feb 25, 2016 · 5 comments

Comments

@GoogleCodeExporter
Copy link

With the following code:

var f = (function () {
  if (true) {
    //do something
  }
  return something;
}());

the indentation inside the function won't work. It is indented like this:

var f = (function () {
    if (true) {
    //do something
    }
    return something;
    }());

The only way to make the indentation work is to remove the parens wrapping the 
function (which are there to indicate that the function is being immediately 
called - a common idiom).

Original issue reported on code.google.com by [email protected] on 15 Nov 2010 at 5:16

@GoogleCodeExporter
Copy link
Author

Hmm...I'm going to have to re-address anonymous functions from a different 
standpoint.  I'm so sorry this didn't work out for you.  I will address this as 
soon as possible and get back to you.  I'm currently overhauling the entire 
script, so if you have any input, I'd love to get your suggestions.  Thanks so 
much for your support!

Original comment by [email protected] on 2 Apr 2011 at 1:33

@GoogleCodeExporter
Copy link
Author

Hey, I looked into your issue as well.  I was able to simply copy past your 
example and successfully indented everything.  Are you sure you're using the 
latest version?  There were lots of changes between each version.


Original comment by [email protected] on 17 Apr 2011 at 10:22

@GoogleCodeExporter
Copy link
Author

Hi, thanks for looking into this. I think it was my fault - conflicting 
indentation code.

Original comment by [email protected] on 18 Apr 2011 at 8:30

@GoogleCodeExporter
Copy link
Author

I'm having the same issue. From the previous comment, it appears the OP figured 
out what had happened. Any light on the subject?

I'm using vim 7.3 on a mac, pathogen 2.0, and the latest version of this plugin 
(1.0)

I have a very simple .vimrc:



call pathogen#infect()

set shiftwidth=4 tabstop=4 softtabstop=4 expandtab smarttab
set cindent autoindent smartindent
set hls incsearch
set laststatus=2
set ruler number

autocmd Filetype ruby setlocal ts=2 sw=2 sts=2 nocindent

Original comment by [email protected] on 17 Sep 2011 at 5:11

@GoogleCodeExporter
Copy link
Author

Hi grignaak

I don't know exactly how I sorted it, but have a look at my .vimrc and .vim 
directory if you want to see my current (working) setup: 
https://github.com/skilldrick/vimrc

Original comment by [email protected] on 17 Sep 2011 at 6:36

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

No branches or pull requests

1 participant