Skip to content

Commit

Permalink
Fix bugs with caret movement and selection changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DataTriny committed May 15, 2024
1 parent 51c93db commit e443a39
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion platforms/atspi-common/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,13 @@ impl<'a> NodeWrapper<'a> {
}

if let Some(selection) = self.0.text_selection() {
if !selection.is_degenerate() {
if !selection.is_degenerate()
|| old
.0
.text_selection()
.map(|selection| !selection.is_degenerate())
.unwrap_or(false)
{
adapter.emit_object_event(self.id(), ObjectEvent::TextSelectionChanged);
}

Expand Down Expand Up @@ -1013,6 +1019,7 @@ impl PlatformNode {
Granularity::Word => start_offset.backward_to_word_start(),
};
let end = match granularity {
_ if start_offset.is_document_end() => return Ok((String::new(), -1, -1)),
Granularity::Char => start_offset.forward_to_character_end(),
Granularity::Line => start_offset.forward_to_line_end(),
Granularity::Paragraph => start_offset.forward_to_paragraph_end(),
Expand Down

0 comments on commit e443a39

Please sign in to comment.