Skip to content

Commit

Permalink
Simplify comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
snowsignal authored Apr 23, 2024
1 parent 8c4eb74 commit 8c3130e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/ruff_server/src/server/api/requests/hover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub(crate) fn hover(
.try_into()
.expect("column number should fit within a usize");
let word = code_regex.find_iter(codes_match.as_str()).find(|code| {
cursor > (code.start() + codes_start) - 1 && cursor < (code.end() + codes_start)
cursor >= (code.start() + codes_start) && cursor < (code.end() + codes_start)
})?;

// Get rule for the code under the cursor.
Expand Down

0 comments on commit 8c3130e

Please sign in to comment.