This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Commit 6c12e39
Introduce ParagraphBoundary subclass for text editing (#116549)
* attempt to extend to paragraph
* second attempt
* clean up implementation
* clean up
* updates
* updates
* Fix implementation
* remove old
* update docs
* update docs
* fix analyzer
* Fix bug where new line character was selected and backwards selection failed
* remove print
* Add test for paragraph boundary
* Add text editing test for extending selection to paragraph for mac and ios
* rename to ExtendSelectionToParagraphBoundaryIntent
* fix analyzer
* Should default to downstream when collapsing selection
* get rid of _getParagraphAtOffset and move into getTextBoundaryAt
* Search for all line terminators
* iterate through code units instead of characters
* Address some reviewer comments"
* Add separate implementations for leading and trailing paragraph boundary methods
* Do not break after a carriage return if it is followed by a line feed
* test carriage return followed by a line feed
* more tests
* Do not continue if the line terminator is at the target text offset
* add hack to extend highlight to line terminator
* Revert "add hack to extend highlight to line terminator"
This reverts commit b4d3c434539b66c3c81c215e87c645b425902825.
* Revert "Do not continue if the line terminator is at the target text offset"
This reverts commit 789e1b838e54e7c25600bfa8852e59431ccaf5dc.
* Update ParagraphBoundary with latest TextBoundary changes
* Update implementation to iterate through indexes
* update getTrailingTextBoundaryAt to include the line terminator
* Updates
* more updates
* more updates
* updates
* updates
* Lets try this again
* clean up
* updates
* more updates
* updates
* fix
* Re-implement using custom paragraph boundary applying method
* Revert "Re-implement using custom paragraph boundary applying method"
This reverts commit cd2f7f4b6eb6726b28f82a43708812e06a49df95.
* Revert "fix"
This reverts commit 8ec1f8f58935cfb3eb86dc6afd2894537af4cf7b.
* updates
* Revert "updates"
This reverts commit 9dcca4a0031fe18ada9d6ffbbe77ba09918e82ae.
* Revert "Revert "fix""
This reverts commit 9cc1332cd3041badc472d0d223a106203e46afb8.
* Revert "Revert "Re-implement using custom paragraph boundary applying method""
This reverts commit 1acb606fb743fd840da20cca26d9a7c26accb71d.
* Fix paragraph boundaries
* Add failing test
* Address some comments
* group tests and fix analyzer
* fix typo
* fix remaining test
* updates
* more fixes and logs
* clean up and add another test
* Fix last test
* Add new test
* Clean up
* more clean up
* clean up comments
* address comments
* updates
* return null when position is out of bounds and 0 or end of text if appropriate
* Clean up cases
* Do not return null when OOB in the direction of iteration
* clean up
* simplify implementation thanks to LongCatIsLooong feedback
* Address comments
* Add line and paragraph separator
* Use _moveBeyondTextBoundary instead of custom _moveToParagraphBoundary
* Change some intent names and revert fromPosition change
* clean up docs
---------
Co-authored-by: Renzo Olivares <roliv@google.com>1 parent 7477d7a commit 6c12e39
7 files changed
Lines changed: 381 additions & 5 deletions
File tree
- packages/flutter
- lib/src
- services
- widgets
- test
- services
- widgets
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
126 | 204 | | |
127 | 205 | | |
128 | | - | |
| 206 | + | |
129 | 207 | | |
130 | 208 | | |
131 | 209 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
57 | 76 | | |
58 | 77 | | |
59 | 78 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
307 | | - | |
| 306 | + | |
| 307 | + | |
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
| |||
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
563 | | - | |
564 | | - | |
| 563 | + | |
| 564 | + | |
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3978 | 3978 | | |
3979 | 3979 | | |
3980 | 3980 | | |
| 3981 | + | |
3981 | 3982 | | |
3982 | 3983 | | |
3983 | 3984 | | |
| |||
4218 | 4219 | | |
4219 | 4220 | | |
4220 | 4221 | | |
| 4222 | + | |
4221 | 4223 | | |
4222 | 4224 | | |
4223 | 4225 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
224 | 239 | | |
225 | 240 | | |
226 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
149 | 256 | | |
150 | 257 | | |
151 | 258 | | |
| |||
0 commit comments