Skip to content

Commit

Permalink
Fix deletion off by 1.
Browse files Browse the repository at this point in the history
Close #212.
  • Loading branch information
Junfeng Li committed Dec 14, 2017
1 parent e04725a commit 55bbfac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/languageclient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ impl ILanguageClient for Arc<Mutex<State>> {
lines.pop();
}
self.notify(None, "setline", json!([1, lines]))?;
if lines.len() + 1 < lines_len {
if lines.len() < lines_len {
self.command(&format!("{},{}d", lines.len() + 1, lines_len))?;
}
debug!("End apply WorkspaceEdit");
Expand Down

1 comment on commit 55bbfac

@alok
Copy link

@alok alok commented on 55bbfac Dec 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just make it <= instead of adding 1? Accomplishes the same thing and is a bit clearer.

Please sign in to comment.