Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/bin/edit/draw_filepicker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,12 @@ pub fn draw_file_picker(ctx: &mut Context, state: &mut State) {
},
);
ctx.attr_background_rgba(ctx.indexed_alpha(IndexedColor::Black, 1, 4));
ctx.next_block_id_mixin(state.file_picker_pending_dir.as_str().len() as u64);
ctx.next_block_id_mixin(state.file_picker_pending_dir_revision);
{
ctx.list_begin("files");
ctx.inherit_focus();
for entry in files {
match ctx
.list_item(state.file_picker_pending_name == entry.as_path(), entry.as_str())
{
match ctx.list_item(false, entry.as_str()) {
ListSelection::Unchanged => {}
ListSelection::Selected => {
state.file_picker_pending_name = entry.as_path().into()
Expand Down
1 change: 1 addition & 0 deletions src/bin/edit/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ fn handle_args(state: &mut State) -> apperr::Result<bool> {
}

state.file_picker_pending_dir = DisplayablePathBuf::from_path(cwd);
state.file_picker_pending_dir_revision = state.file_picker_pending_dir_revision.wrapping_add(1);
Ok(false)
}

Expand Down
2 changes: 2 additions & 0 deletions src/bin/edit/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ pub struct State {

pub wants_file_picker: StateFilePicker,
pub file_picker_pending_dir: DisplayablePathBuf,
pub file_picker_pending_dir_revision: u64, // Bumped every time `file_picker_pending_dir` changes.
pub file_picker_pending_name: PathBuf,
pub file_picker_entries: Option<Vec<DisplayablePathBuf>>,
pub file_picker_overwrite_warning: Option<PathBuf>, // The path the warning is about.
Expand Down Expand Up @@ -175,6 +176,7 @@ impl State {

wants_file_picker: StateFilePicker::None,
file_picker_pending_dir: Default::default(),
file_picker_pending_dir_revision: 0,
file_picker_pending_name: Default::default(),
file_picker_entries: None,
file_picker_overwrite_warning: None,
Expand Down