markdown: Fix markdown table selection hit testing#47720
markdown: Fix markdown table selection hit testing#47720ConradIrwin merged 1 commit intozed-industries:mainfrom
Conversation
|
Before: before.movAfter: after.mov |
|
Amazing, thank you for the fix! Is there a way to factor things such that we iterate over the layouts just once? Maybe we keep track of the "fallback line" as we go, but remove the early returns from the loop. |
d658fdf to
3b88512
Compare
|
Hi @ConradIrwin , refactor done. |
crates/markdown/src/markdown.rs
Outdated
|
|
||
| continue; | ||
| if line_containing_position.is_none() && line_bounds.contains(&position) { | ||
| line_containing_position = Some(line); |
There was a problem hiding this comment.
@cppcoffee we can just return here, or do you want the last such matching line?
There was a problem hiding this comment.
Logic simplification done
0d3a749 to
e7cc675
Compare
|
Now we're iterating over the list twice again? Maybe I'm missing something... |
Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
e7cc675 to
98bd355
Compare
Changed to a single loop Handle both exact match and Y-coordinate fallback match in a single loop |
|
Thanks, and sorry for the back and forth! |
Release Notes: