Repository navigation
Commit 024d720
fix: center search result line in read-only markdown view
1. Root cause: in read-only markdown view search next/prev called
jumpToLine with keepLineAtCenter=false, so the hidden TextEdit only
scrolled minimally and kept the match at the bottom edge of its own
viewport, while render-page sync only aligns the top visible block;
since the 800px rendered column is taller per source line, the match
fell below the rendered fold (reliably reproducible when maximized)
2. Fix: pass keepLineAtCenter=true in searchKeywordSeletion so
keepCurrentLineAtCenter centers the anchor line; the explicit
scrollbar setValue also drives valueChanged render-page scroll sync
3. Test: add EditWrapper UT cases (maximized/normal window) asserting
the renderer receives scrollToLine near the matched line; all 107
editor_wrapper UT cases pass
Log: fix search result not visible in read-only markdown view
Influence:
1. Test search next/prev in read-only markdown view, verify match is
centered on screen, especially with a maximized window
2. Test search next/prev in edit mode, verify no regression
3. Verify render-page scroll sync follows editor scrollbar
fix: 修复只读Markdown视图下查找结果不在当前屏显示
1. 根因:只读Markdown视图下查找下一个/上一个调用jumpToLine时传入
keepLineAtCenter=false,隐藏的TextEdit仅做最小滚动、匹配项停在
其视口底边缘,而渲染页滚动同步仅按顶部可见行对齐;800px定宽
渲染列每源码行渲染高度更大,匹配项落到渲染视口折叠线下
(窗口最大化时必现)
2. 方案:searchKeywordSeletion中jumpToLine的keepLineAtCenter改为
true,keepCurrentLineAtCenter将锚点行居中,显式scrollbar
setValue同时驱动valueChanged渲染页滚动同步
3. 测试:新增EditWrapper单测(最大化/普通窗口两场景),断言渲染器
收到的scrollToLine行号贴近匹配行;editor_wrapper 107例全部通过
Log: 修复只读Markdown视图下查找结果不在当前屏显示的问题
Influence:
1. 在只读Markdown视图下测试查找下一个/上一个,验证匹配内容居中
显示,重点验证窗口最大化场景
2. 在编辑模式下测试查找功能,验证无回归
3. 验证渲染页滚动与编辑器滚动条同步
PMS: BUG-3807051 parent 3937fd9 commit 024d720
2 files changed
Lines changed: 86 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2724 | 2724 | | |
2725 | 2725 | | |
2726 | 2726 | | |
2727 | | - | |
| 2727 | + | |
2728 | 2728 | | |
2729 | 2729 | | |
2730 | 2730 | | |
| |||
2745 | 2745 | | |
2746 | 2746 | | |
2747 | 2747 | | |
2748 | | - | |
| 2748 | + | |
2749 | 2749 | | |
2750 | 2750 | | |
2751 | 2751 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
638 | 638 | | |
639 | 639 | | |
640 | 640 | | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
641 | 725 | | |
642 | 726 | | |
643 | 727 | | |
| |||
0 commit comments