Commit 2b09e4e
committed
Fix insertText: deprecation: switch to insertText:replacementRange:
All 6 remaining call sites (5 in NSTextView+Autocomplete.m, 1 in
MPDocument.m) were plain 'insert at wherever the cursor/selection
currently is' cases, immediately adjacent in every file to other calls
that already use -insertText:replacementRange:. Converted each to the
same 2-arg NSTextInputClient method, passing NSMakeRange(NSNotFound, 0) --
Apple's documented sentinel meaning 'use the current selection, or the
marked (IME composition) range if there is one', which is exactly what
the deprecated 1-arg -insertText: did. This preserves IME/marked-text
behavior correctly, which plain self.selectedRange would not have during
active composition (this file already special-cases marked text
elsewhere, e.g. hasMarkedText in completeMatchingCharacterForText:atLocation:).1 parent e0df9c8 commit 2b09e4e
2 files changed
Lines changed: 17 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1516 | 1516 | | |
1517 | 1517 | | |
1518 | 1518 | | |
1519 | | - | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
1520 | 1525 | | |
1521 | 1526 | | |
1522 | 1527 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
97 | 102 | | |
98 | 103 | | |
99 | 104 | | |
| |||
583 | 588 | | |
584 | 589 | | |
585 | 590 | | |
586 | | - | |
| 591 | + | |
587 | 592 | | |
588 | 593 | | |
589 | 594 | | |
| |||
598 | 603 | | |
599 | 604 | | |
600 | 605 | | |
601 | | - | |
| 606 | + | |
602 | 607 | | |
603 | 608 | | |
604 | 609 | | |
| |||
639 | 644 | | |
640 | 645 | | |
641 | 646 | | |
642 | | - | |
| 647 | + | |
643 | 648 | | |
644 | 649 | | |
645 | 650 | | |
| |||
658 | 663 | | |
659 | 664 | | |
660 | 665 | | |
661 | | - | |
| 666 | + | |
| 667 | + | |
662 | 668 | | |
663 | 669 | | |
664 | 670 | | |
| |||
0 commit comments