/
TODO
86 lines (82 loc) · 3.09 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
fmt-signature
. Bind to equalprg.
. Wrap before -> or =>
. Treat ()s as one word.
* basic implementation
* test
- ignore lines with comments
. Any line with a comment goes through unchanged.
. Break input into lines without comments and wrap each section
separately. The only wrinkle is that only the first line of the first
section isn't indented.
- wrap inside ()s
. I want one indent per (, and to wrap at the lowest indent.
. This is what Util.Format does, so maybe I should try to extract and use
it.
. But it has bugs. Or can I do a simpler one? Or maybe the bugs are just
in Util.Format?
- configure indentation
- format non-toplevel declarations
. I think I just need to preserve leading indent.
- can I get vim to expand the selection to the whole signature?
string-literal
* options with --
* --wrapped adds leading space
* ensure single line works
* real tests, empty line handling and round trip
* documentation
* ignore but retain trailing or leading blank lines
- backslash adds 1+3 characters, which means I have to set tw=76, which is
pretty annoying.
. lines also adds 3+1, backslash wrapped adds 2 usually.
. I could dedent by the added characters, but then I wind up with
irregular indents. Some people might not mind that, but I do.
. I can set vim tw-=4, but then I have to set it back when toggling back,
and vim doesn't know which direction I just went.
- I might want to be able to ignore but preserve leading gunk on the first
line, e.g:
( "blah\
\ blah"
, ...
)
- How can I support embedded operators? E.g.
. "blah blah "
<> x <> "blah\
\ blah"
=>
blah blah
<> x <> blah
blah
. "blah" <> blah
<> "e..."
. For stripping, I can just not strip if it's not a \. But once I strip,
it becomes ambiguous.
. I could try to make it non-ambiguous, by replacing quotes with some
magic symbol.
. Hm, I could even remember wrapped or not by using a different symbol.
. It should be typeable, because I want to write these inline:
. •blah blah
blah blah•
<> x <> •blah blah
blah•
- Also I could ignore non-indented leading lines, e.g.
variable =
"blah blah"
* configurable indentation
. I retain existing indentation.
vim:
- vim config uses variable for --wrapped
- What about variable indentation?
. I can infer it easily enough when stripping, but I have to store what it
was to go back.
. Same problem as inferring the style.
/ I can infer the style when going to raw, but then how to go back?
. I could set a vim variable.
. Actually I don't need this, since I keep the indent.
- vip works for a single paragraph, but not if there are spaces inside,
and not if there's a dedented 'variable = ...' header. Is there some
text object that selects everything at and below this indent level, and
is not fooled by blank lines?
lines:
* doesn't dedent properly
- support --wrapped