Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide_assists/src/handlers/flip_binexpr.rs')
| -rw-r--r-- | crates/ide_assists/src/handlers/flip_binexpr.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ide_assists/src/handlers/flip_binexpr.rs b/crates/ide_assists/src/handlers/flip_binexpr.rs index 0117b8a84b..19e85b27f9 100644 --- a/crates/ide_assists/src/handlers/flip_binexpr.rs +++ b/crates/ide_assists/src/handlers/flip_binexpr.rs @@ -23,7 +23,7 @@ pub(crate) fn flip_binexpr(acc: &mut Assists, ctx: &AssistContext) -> Option<()> let rhs = expr.rhs()?.syntax().clone(); let op_range = expr.op_token()?.text_range(); // The assist should be applied only if the cursor is on the operator - let cursor_in_range = op_range.contains_range(ctx.frange.range); + let cursor_in_range = op_range.contains_range(ctx.selection_trimmed()); if !cursor_in_range { return None; } |