Commit 0c5c59c
[closebrackets addon] More refined check for when to close a bracket
Improves the current behavior which auto closes every opening bracket.
- hardcodes a closeBefore list of characters that if the next character is in the list, opening a bracket should be auto-closed.
The list is : ")]}'\":;>"
Basically the closing characters in pairs ; : and >.
- when opening a bracket, it will be auto-closed if:
1. there is no next character,
2. the next character is a white space character.
3. the next character is in the shouldClose list.1 parent 17fa1ea commit 0c5c59c
1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
112 | 116 | | |
113 | 117 | | |
114 | 118 | | |
| |||
136 | 140 | | |
137 | 141 | | |
138 | 142 | | |
139 | | - | |
| 143 | + | |
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
| |||
0 commit comments