Skip to content

Commit

Permalink
minor style nits
Browse files Browse the repository at this point in the history
* simplification of some imports
* prefer `is_some_and` to `map_or` (`is_some_and` was not yet stable
  when the is_dir comment was written)
* be more specific in the description for 'ui.text.directory' theme key
  • Loading branch information
the-mikedavis committed Dec 18, 2024
1 parent b45d3eb commit 2eca8df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion book/src/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ These scopes are used for theming the editor interface:
| `ui.text.focus` | The currently selected line in the picker |
| `ui.text.inactive` | Same as `ui.text` but when the text is inactive (e.g. suggestions) |
| `ui.text.info` | The key: command text in `ui.popup.info` boxes |
| `ui.text.directory` | Color of directories |
| `ui.text.directory` | Directory names in prompt completion |
| `ui.virtual.ruler` | Ruler columns (see the [`editor.rulers` config][editor-section]) |
| `ui.virtual.whitespace` | Visible whitespace characters |
| `ui.virtual.indent-guide` | Vertical indent width guides |
Expand Down
6 changes: 3 additions & 3 deletions helix-term/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,12 @@ pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> FilePi
}

pub mod completers {
use super::Utf8PathBuf;
use crate::ui::prompt::Completion;
use crate::ui::Utf8PathBuf;
use helix_core::fuzzy::fuzzy_match;
use helix_core::syntax::LanguageServerFeature;
use helix_view::document::SCRATCH_BUFFER_NAME;
use helix_view::theme::{self};
use helix_view::theme;
use helix_view::{editor::Config, Editor};
use once_cell::sync::Lazy;
use std::borrow::Cow;
Expand Down Expand Up @@ -495,7 +495,7 @@ pub mod completers {
return None;
}

let is_dir = entry.file_type().map_or(false, |entry| entry.is_dir());
let is_dir = entry.file_type().is_some_and(|entry| entry.is_dir());

let path = entry.path();
let mut path = if is_tilde {
Expand Down

0 comments on commit 2eca8df

Please sign in to comment.