- 
                Notifications
    You must be signed in to change notification settings 
- Fork 25
Open
Description
generated by genai from unstructured chat log
Issue Description
Currently, the formatting of array literals in Typstyle can be improved to enhance readability and compactness. This proposal suggests several enhancements to the way array elements are formatted, particularly focusing on multi-line arrays and import sorting.
Proposed Features
- Multi-line Array Literals:
- Allow array elements to be placed on the same line when possible, rather than forcing each element onto a new line. For example:
Instead of:[1, 2, 3, 4, 5, 6, 7, 8] [1, 2, 3, 4] 
- Implement a heuristic to determine when to break lines based on element length and column width. For instance:
- Calculate the length variance of elements.
- Ensure no single element exceeds a certain proportion of the column width (e.g., half or one-quarter).
- If the longest element exceeds the threshold, place each element on a new line.
 
 
- Allow array elements to be placed on the same line when possible, rather than forcing each element onto a new line. For example:
Neved4
Metadata
Metadata
Assignees
Labels
No labels