From 948f4c7796b48f673c843eab1cf4392bcdff39c4 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Wed, 17 Jun 2020 18:31:49 -0400 Subject: [PATCH] reset accessor position when trying next DataFormat --- .../UniversalEditor.UserInterface/MainWindow.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Libraries/UniversalEditor.UserInterface/MainWindow.cs b/Libraries/UniversalEditor.UserInterface/MainWindow.cs index d8c7d0c7..04a967c0 100644 --- a/Libraries/UniversalEditor.UserInterface/MainWindow.cs +++ b/Libraries/UniversalEditor.UserInterface/MainWindow.cs @@ -437,6 +437,9 @@ namespace UniversalEditor.UserInterface { if (doc == null) return; + long initpos = 0; + bool first = true; + bool loaded = false; if (doc.DataFormat == null) { @@ -463,7 +466,17 @@ namespace UniversalEditor.UserInterface try { - doc.Accessor.Open (); + doc.Accessor.Open(); + if (first) + { + initpos = doc.Accessor.Position; + first = false; + } + else + { + doc.Accessor.Position = initpos; + } + doc.Load (); doc.IsSaved = true; loaded = true;