@@ -88,37 +88,39 @@ There are three main principles that the substition follows:
8888 text.
8989
90902. When several patterns match, the shortest match is performed. For example,
91- in ruby, the following switch is defined:
92-
91+ in markdown, the following switch is defined:
9392>
94- { :foo => true }
95- # switches into:
96- { foo: true }
97- <
93+ - [ ] Implement true/false switching
9894
99- This works if the cursor is positioned somewhere on the ":foo =>" part, but
100- if it's on top of "true", the abovementioned true -> false substition will
101- be performed instead. If you want to perform a "larger" substition instead,
102- you could move your cursor away from the "smaller" match. In this case,
103- move the cursor away from the "true" keyword.
95+ switches into:
96+
97+ - [x] Implement true/false switching
98+ <
99+ This works if the cursor is positioned anywhere on the line except if it's
100+ on top of "true" or "false". In that case, the abovementioned true -> false
101+ substition will be performed instead. If you want to perform a "larger"
102+ substition instead, you could move your cursor away from the "smaller"
103+ match. In this case, move the cursor away from the "true" or "false" words.
104104
1051053. When several patterns with the same size match, the order of the
106106 definitions is respected. For instance, in eruby, the following code can be
107107 transformed:
108-
109108>
110109 <% if foo? %>
111- # could switch into:
110+
111+ could switch into:
112+
112113 <%# if foo? %>
113- # but instead, it would switch into:
114+
115+ but instead, it would switch into:
116+
114117 <% if true or (foo?) %>
115118<
116-
117119 The second switch will be performed, simply because in the definition list,
118120 the pattern was placed at a higher spot. In this case, this seems to make
119121 sense to prioritize one over the other. If it's needed to prioritize in a
120- different way, the definition list should be redefined by the user -- see
121- | switch-customization | .
122+ different way (or simply to remove unneeded switches), the definition list
123+ should be redefined by the user -- see | switch-customization | .
122124
123125If you don't like the "smallest match" algorithm described on top, and you'd
124126rather just attempt all matches in order, set the value of
0 commit comments