on master help sign in
clippy: Drop or-patterns for now because they're not on stable rust yet
commit0e9ecccfc12f4972360b516bd56222894f315d58 authorBlaž Hrastnik <blaz@mxxn.io> dateTue 6 Apr 2021, 19:45 (6 years ago) parent91462af
3 files changed+15−13
helix-lsp/src/client.rs+7−9 helix-term/src/commands.rs+3−3 helix-term/src/ui/prompt.rs+5−1
helix-lsp/src/client.rs+7−9
@@ -384,13 +384,11 @@ impl Client {
384384 let capabilities = self.capabilities.as_ref().unwrap();
385385
386386 let sync_capabilities = match capabilities.text_document_sync {
387− Some(
388− lsp::TextDocumentSyncCapability::Kind(kind)
389− | lsp::TextDocumentSyncCapability::Options(lsp::TextDocumentSyncOptions {
390− change: Some(kind),
391− ..
392− }),
393− ) => kind,
387+ Some(lsp::TextDocumentSyncCapability::Kind(kind))
388+ | Some(lsp::TextDocumentSyncCapability::Options(lsp::TextDocumentSyncOptions {
389+ change: Some(kind),
390+ ..
391+ })) => kind,
394392 // None | SyncOptions { changes: None }
395393 _ => return Ok(()),
396394 };
@@ -540,7 +538,7 @@ impl Client {
540538
541539 // check if we're able to format
542540 match capabilities.document_formatting_provider {
543− Some(lsp::OneOf::Left(true) | lsp::OneOf::Right(_)) => (),
541+ Some(lsp::OneOf::Left(true)) | Some(lsp::OneOf::Right(_)) => (),
544542 // None | Some(false)
545543 _ => return Ok(Vec::new()),
546544 };
@@ -569,7 +567,7 @@ impl Client {
569567
570568 // check if we're able to format
571569 match capabilities.document_range_formatting_provider {
572− Some(lsp::OneOf::Left(true) | lsp::OneOf::Right(_)) => (),
570+ Some(lsp::OneOf::Left(true)) | Some(lsp::OneOf::Right(_)) => (),
573571 // None | Some(false)
574572 _ => return Ok(Vec::new()),
575573 };
helix-term/src/commands.rs+3−3
@@ -821,15 +821,15 @@ pub fn command_mode(cx: &mut Context) {
821821 let parts = input.split_ascii_whitespace().collect::<Vec<&str>>();
822822
823823 match *parts.as_slice() {
824− ["q" | "quit"] => {
824+ ["q"] | ["quit"] => {
825825 editor.close(editor.view().id);
826826 // editor.should_close = true,
827827 }
828− ["o" | "open", path] => {
828+ ["o", path] | ["open", path] => {
829829 use helix_view::editor::Action;
830830 editor.open(path.into(), Action::Replace);
831831 }
832− ["w" | "write"] => {
832+ ["w"] | ["write"] => {
833833 // TODO: non-blocking via save() command
834834 let id = editor.view().doc;
835835 let doc = &mut editor.documents[id];
helix-term/src/ui/prompt.rs+5−1
@@ -182,7 +182,11 @@ impl Component for Prompt {
182182 // char or shift char
183183 KeyEvent {
184184 code: KeyCode::Char(c),
185− modifiers: KeyModifiers::NONE | KeyModifiers::SHIFT,
185+ modifiers: KeyModifiers::NONE,
186+ }
187+ | KeyEvent {
188+ code: KeyCode::Char(c),
189+ modifiers: KeyModifiers::SHIFT,
186190 } => {
187191 self.insert_char(c);
188192 (self.callback_fn)(cx.editor, &self.line, PromptEvent::Update);