Skip to content

Commit

Permalink
New file patch
Browse files Browse the repository at this point in the history
  • Loading branch information
dotPawel committed Jul 17, 2023
1 parent cd049f2 commit 123b866
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions UniDKIT/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,8 @@ private void newToolStripMenuItem_Click(object sender, EventArgs e)
{
myStream.Close();
File.Create(NewDialog.FileName).Close();
FilePath = NewDialog.FileName;

if (Textbox.Text.Length > 1)

if (Textbox.Text.Length > 1 && FilePath == null)
{
DialogResult dialogResult = MessageBox.Show("Save current editor contents to created file?", "Editor contents detected", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
Expand All @@ -264,6 +263,7 @@ private void newToolStripMenuItem_Click(object sender, EventArgs e)
return;
}
}
FilePath = NewDialog.FileName;
FilePathText.Text = FilePath;
LoadFile(FilePath);
}
Expand Down

0 comments on commit 123b866

Please sign in to comment.