Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(656)

Issue 4534047: code review 4534047: misc/vim: new Vim indentation script. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years ago by dsymonds
Modified:
13 years ago
Reviewers:
CC:
adg, niemeyer, jnw, dchest, rsc1, Ross Light, golang-dev, rivercheng_gmail.com
Visibility:
Public.

Description

misc/vim: new Vim indentation script. This uses a fully custom function for indenting Go code in Vim. It provides a lot more flexibility than a cindent-based approach, so this version gets the := operator correct, as well as switch labels and jump labels. One outstanding TODO is to handle lines immediately after jump labels.

Patch Set 1 #

Patch Set 2 : diff -r 6112ede59365 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 6112ede59365 https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 4 : diff -r 6112ede59365 https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r 6112ede59365 https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r 6112ede59365 https://go.googlecode.com/hg/ #

Total comments: 6

Patch Set 7 : diff -r 6112ede59365 https://go.googlecode.com/hg/ #

Total comments: 2

Patch Set 8 : diff -r 6112ede59365 https://go.googlecode.com/hg/ #

Patch Set 9 : diff -r 6112ede59365 https://go.googlecode.com/hg/ #

Patch Set 10 : diff -r 71551262fd34 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -17 lines) Patch
M misc/vim/indent/go.vim View 1 2 3 4 5 6 7 8 1 chunk +58 lines, -17 lines 0 comments Download

Messages

Total messages: 29
dsymonds
Hello adg, niemeyer (cc: golang-dev@googlegroups.com, rivercheng@gmail.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years ago (2011-05-11 06:14:42 UTC) #1
dsymonds
I'm going to start using this for regularly writing Go code, so shortcomings should bug ...
13 years ago (2011-05-11 06:16:01 UTC) #2
jnw
On 2011/05/11 06:16:01, dsymonds wrote: > I'm going to start using this for regularly writing ...
13 years ago (2011-05-11 09:22:11 UTC) #3
jnw
On 2011/05/11 06:14:42, dsymonds wrote: > Hello adg, niemeyer (cc: mailto:golang-dev@googlegroups.com, mailto:rivercheng@gmail.com), > > I'd ...
13 years ago (2011-05-11 09:30:31 UTC) #4
dsymonds
On Wed, May 11, 2011 at 2:30 AM, <jnwhiteh@gmail.com> wrote: > Any ideas? Have you ...
13 years ago (2011-05-11 15:36:45 UTC) #5
jnw
On Wed, May 11, 2011 at 4:36 PM, David Symonds <dsymonds@golang.org> wrote: > On Wed, ...
13 years ago (2011-05-11 15:39:53 UTC) #6
dsymonds
Wow. I just tried it again, and it's broken for me too. It must have ...
13 years ago (2011-05-11 16:03:13 UTC) #7
dchest
On 2011/05/11 09:30:31, jnw wrote: > The patch applied cleanly and I've verified that the ...
13 years ago (2011-05-11 16:06:24 UTC) #8
jnw
I was able to get this version of the indentation script working, using the fix ...
13 years ago (2011-05-11 16:10:57 UTC) #9
dsymonds
D'oh. I did indeed change that late, trying to get the indentation after jump labels ...
13 years ago (2011-05-11 16:33:01 UTC) #10
jnw
On Wed, May 11, 2011 at 5:32 PM, David Symonds <dsymonds@golang.org> wrote: > D'oh. I ...
13 years ago (2011-05-11 16:37:19 UTC) #11
dsymonds
On Wed, May 11, 2011 at 9:36 AM, Jim Whitehead II <jnwhiteh@gmail.com> wrote: > If ...
13 years ago (2011-05-11 16:51:25 UTC) #12
dsymonds
Cool, got it. PTAL.
13 years ago (2011-05-11 17:00:05 UTC) #13
niemeyer
That's nice, thanks David. A few minor suggestions: http://codereview.appspot.com/4534047/diff/2003/misc/vim/indent/go.vim File misc/vim/indent/go.vim (right): http://codereview.appspot.com/4534047/diff/2003/misc/vim/indent/go.vim#newcode42 misc/vim/indent/go.vim:42: let ...
13 years ago (2011-05-11 18:59:12 UTC) #14
dsymonds
http://codereview.appspot.com/4534047/diff/2003/misc/vim/indent/go.vim File misc/vim/indent/go.vim (right): http://codereview.appspot.com/4534047/diff/2003/misc/vim/indent/go.vim#newcode42 misc/vim/indent/go.vim:42: let ind = ind + &sw On 2011/05/11 18:59:13, ...
13 years ago (2011-05-11 23:57:47 UTC) #15
rsc1
>> let ind += &sw This is wrong on so many levels. I suppose it ...
13 years ago (2011-05-12 02:49:38 UTC) #16
jnw
This looks great, only corner cases seem to different from gofmt and it gets the ...
13 years ago (2011-05-12 08:05:02 UTC) #17
Ross Light
LGTM
13 years ago (2011-05-13 03:08:42 UTC) #18
dsymonds
Okay, I think this has converged. There's plenty of corner-cases still to improve, but I ...
13 years ago (2011-05-13 04:49:31 UTC) #19
jnw
On Fri, May 13, 2011 at 5:49 AM, David Symonds <dsymonds@golang.org> wrote: > Okay, I ...
13 years ago (2011-05-13 07:25:09 UTC) #20
jnw
Sorry for the zero hour report, but I'm a bit concerned about the general approach ...
13 years ago (2011-05-13 13:34:51 UTC) #21
jnw
On 2011/05/13 13:34:51, jnw wrote: > Sorry for the zero hour report, but I'm a ...
13 years ago (2011-05-13 13:49:14 UTC) #22
dsymonds
On Fri, May 13, 2011 at 6:34 AM, <jnwhiteh@gmail.com> wrote: > Sorry for the zero ...
13 years ago (2011-05-13 14:57:57 UTC) #23
rsc1
LGTM
13 years ago (2011-05-13 15:08:18 UTC) #24
jnw
On 2011/05/13 14:57:57, dsymonds wrote: > On Fri, May 13, 2011 at 6:34 AM, <mailto:jnwhiteh@gmail.com> ...
13 years ago (2011-05-13 15:18:51 UTC) #25
dsymonds
Okay, you make a fair case, and it turns out it wasn't hard to fix. ...
13 years ago (2011-05-13 15:23:33 UTC) #26
jnw
On 2011/05/13 15:23:33, dsymonds wrote: > Okay, you make a fair case, and it turns ...
13 years ago (2011-05-13 15:27:50 UTC) #27
dsymonds
*** Submitted as http://code.google.com/p/go/source/detail?r=4a52fe751853 *** misc/vim: new Vim indentation script. This uses a fully custom ...
13 years ago (2011-05-13 15:29:58 UTC) #28
rivercheng_gmail.com
13 years ago (2011-05-14 14:07:18 UTC) #29
The new indent file works very well now. Have not found any issues yet. Will
use it in my daily coding. Thank you all for this prompt help and wonderful
patch. Go community really rocks.


On Fri, May 13, 2011 at 11:29 PM, <dsymonds@golang.org> wrote:

> *** Submitted as
> http://code.google.com/p/go/source/detail?r=4a52fe751853 ***
>
>
> misc/vim: new Vim indentation script.
>
> This uses a fully custom function for indenting Go code in Vim.
> It provides a lot more flexibility than a cindent-based approach,
> so this version gets the := operator correct, as well as switch
> labels and jump labels.
>
> One outstanding TODO is to handle lines immediately after jump labels.
>
> R=adg, n13m3y3r, jnwhiteh, dchest, rsc, rlight2
> CC=golang-dev, rivercheng
>
> http://codereview.appspot.com/4534047
>
>
> http://codereview.appspot.com/4534047/
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b