diff options
author | Aleksey Kladov <[email protected]> | 2018-08-15 21:24:20 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-15 21:24:20 +0100 |
commit | aa0d344581dcfd7f18c595688a4b2709b0f2421e (patch) | |
tree | 9846f587dcad204e6744ca5ff37faccf4251104c /crates/server/src | |
parent | a7d31b55a4292f55851bc75265643b2ae2e675df (diff) |
Edits with cursors
Diffstat (limited to 'crates/server/src')
-rw-r--r-- | crates/server/src/main_loop/handlers.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/server/src/main_loop/handlers.rs b/crates/server/src/main_loop/handlers.rs index 637bf1b24..078abfbfa 100644 --- a/crates/server/src/main_loop/handlers.rs +++ b/crates/server/src/main_loop/handlers.rs | |||
@@ -187,12 +187,12 @@ pub fn handle_execute_command( | |||
187 | let arg: ActionRequest = from_value(arg)?; | 187 | let arg: ActionRequest = from_value(arg)?; |
188 | let file_id = arg.text_document.try_conv_with(&path_map)?; | 188 | let file_id = arg.text_document.try_conv_with(&path_map)?; |
189 | let file = world.file_syntax(file_id)?; | 189 | let file = world.file_syntax(file_id)?; |
190 | let edit = match arg.id { | 190 | let action_result = match arg.id { |
191 | ActionId::FlipComma => libeditor::flip_comma(&file, arg.offset).map(|edit| edit()), | 191 | ActionId::FlipComma => libeditor::flip_comma(&file, arg.offset).map(|f| f()), |
192 | ActionId::AddDerive => libeditor::add_derive(&file, arg.offset).map(|edit| edit()), | 192 | ActionId::AddDerive => libeditor::add_derive(&file, arg.offset).map(|f| f()), |
193 | }; | 193 | }; |
194 | let edit = match edit { | 194 | let edit = match action_result { |
195 | Some(edit) => edit, | 195 | Some(action_result) => action_result.edit, |
196 | None => bail!("command not applicable"), | 196 | None => bail!("command not applicable"), |
197 | }; | 197 | }; |
198 | let line_index = world.file_line_index(file_id)?; | 198 | let line_index = world.file_line_index(file_id)?; |