-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cue/format: don't indent fields on same line as lbrace
Vertical tabs are inserted after struct fields in order to correctly vertically align values via text/tabwriter. A recent CL https://cuelang.org/cl/1170966 made changes to this logic in order to improve indentation of list elements. As part of this change, a field whose value is a binary expression will no longer have a vertical tab inserted. For example, given the following code: x: 1 foo: bar & {baz: 1} The formatter will insert vertical tabs like so: x:<VT>1 foo: bar & {baz:<VT>1} Which means text/tabwriter will output the following: x: 1 foo: bar & {baz: 1} The logic is fixed to now ensure that no vtabs are inserted in a line once an '{' has been written, so that vertical tabs in the above example will now be inserted like this: x:<VT>1 foo: bar & {baz: 1} And the formatted code will now be: x: 1 foo: bar & {baz: 1} In addition, a few typos were fixed and dead code was removed. Fixes #3015 Signed-off-by: Noam Dolovich <noam.tzvi.dolovich@gmail.com> Change-Id: Ibee8ffc617324396523b50a4bb30b9cfc8beb28c Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1193515 Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
- Loading branch information
Showing
7 changed files
with
30 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters