Skip to content
Merged
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 @@ -9,7 +9,7 @@ use edit::framebuffer::IndexedColor;
use edit::helpers::*;
use edit::input::vk;
use edit::tui::*;
use edit::{icu, path, sys};
use edit::{icu, path};

use crate::localization::*;
use crate::state::*;
Expand Down Expand Up @@ -114,9 +114,7 @@ pub fn draw_file_picker(ctx: &mut Context, state: &mut State) {
// Check if the file already exists and show an overwrite warning in that case.
if state.wants_file_picker != StateFilePicker::Open
&& let Some(path) = doit.as_deref()
&& let Some(doc) = state.documents.active()
&& let Some(file_id) = &doc.file_id
&& sys::file_id(None, path).is_ok_and(|id| &id == file_id)
&& path.exists()
{
state.file_picker_overwrite_warning = doit.take();
}
Expand Down