Commit a9c305c
committed
Improve replacement of rectangular selections
Entities
---------
* correctly size the buffer by using `SCI_GETSELTEXT` to measure the
selection region instead of the wrapper object's relative positions;
fixes an off-by-one bug that could lead to an invalid free and a
fatal exception when using the heap tracer (debug builds only)
* trim trailing newlines from the replacement text
Unicode escapes
---------------
* only replace as many characters as are actually within the selection
*Not (yet) implemented:*
* accurate replacement of Unicode escapes in multiple stream selections
(via the new `... Multi-select` suite of functions)
* accurate replacement of discontinuous selections (i.e., via the new
`Skip Current & Go to Next Multi-select` function). This will
probably require multiple `TextRange` objects, one for each
selection, instead of a straightforward call to `SCI_REPLACESEL`1 parent 8b0a7ec commit a9c305c
2 files changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
| 520 | + | |
520 | 521 | | |
521 | | - | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
522 | 525 | | |
523 | 526 | | |
524 | 527 | | |
| |||
540 | 543 | | |
541 | 544 | | |
542 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
543 | 550 | | |
544 | 551 | | |
545 | 552 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
126 | | - | |
| 127 | + | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| |||
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
164 | | - | |
| 165 | + | |
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| |||
0 commit comments