tyru / current-func-info.vim

Get current function name
http://www.vim.org/scripts/script.php?script_id=3197
62 stars 14 forks source link

Support customizing JS function finder #19

Closed somini closed 8 years ago

somini commented 8 years ago

This adds a way to show only the function name in the Javascript cfi.

I think this could be optimized, but the original code is fast, no harm done.

tyru commented 8 years ago

@somini Hmm, there is already similar global variable g:cfi_javascript_show_assignment. How about adding g:cfi_javascript_show like this?

let g:cfi_javascript_show = ["assignment", "varname", "funtype", "funname", "funargs", "funbody"]

g:cfi_javascript_show_assignment should be also deprecated if this variable is merged.

somini commented 8 years ago

Yeah, it's not sustainable to just have a bunch of one-off switches.

I'll follow your advice and implement that.

tyru commented 8 years ago

Thanks! :)

tyru commented 8 years ago

ah, maybe Dictionary is preferrable rather than List.

let g:cfi_javascript_show = {"assignment": 1, "varname": 1, "funtype": 1, "funname": 1, "funargs": 1, "funbody": 1}
somini commented 8 years ago

Here's a first implementation. I'll test this tomorrow.

somini commented 8 years ago

I've fixed this.

This has a lot of junk commits, I'll squash this into a single commit and force push to this PR.

tyru commented 8 years ago

This has a lot of junk commits, I'll squash this into a single commit and force push to this PR.

Okay, no problem. However I don't care if there are a lot of commits in PR :)

tyru commented 8 years ago

@somini is it okay to merge this?

somini commented 8 years ago

Yes, I've been using it regularly and haven't run into any issues yet. If anyone opens new issues related to this, please ping me.

tyru commented 8 years ago

This has a lot of junk commits, I'll squash this into a single commit and force push to this PR.

How is this going?

tyru commented 8 years ago

I also feel this PR has no problems. I was just waiting you squash this. (I'm okay if you choose you don't do that)

somini commented 8 years ago

It's already 1 commit only, you can merge it.

tyru commented 8 years ago

@somini Okay, now merged it! Thanks!