Bugs item #2222159, was opened at 2008-11-04 21:04
Message generated for change (Comment added) made by lebert
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=2222159&group_id=11005

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: File was not reload when type was changed externaly

Initial Comment:
You open a file in DOS format with nedit, then you modified the type format 
from DOS to UNIX with an external program, then when you refocus on nedit it 
haven't change from DOS to UNIX so if you modified and save in nedit the UNIX 
format of the file was lost.




----------------------------------------------------------------------

Comment By: Bert Wesarg (lebert)
Date: 2008-11-05 10:24

Message:
Too late. But I think this is worth its own commit. I didn't even know of
this option.

----------------------------------------------------------------------

Comment By: Tony Balinski (ajbj)
Date: 2008-11-05 10:19

Message:
Actually, before you do, I looked a bit further; we only want to do this if
GetPrefForceOSConversion() is true. This should be added in a number of
places to stop us performing unwanted conversions behind the user's back:
IncludeFile(), cmpWinAgainstFile() (around your fix and the following 4
lines); and the "Save As...: dialog should not propose save formats when
the forceOSConversion resource is false. (I actually set this to false on
Cygwin where I want to see <cr>s if I'm dealing with DOS windows.)

----------------------------------------------------------------------

Comment By: Bert Wesarg (lebert)
Date: 2008-11-05 10:06

Message:
Thanks for the ACK. Will commit to both branches.

----------------------------------------------------------------------

Comment By: Tony Balinski (ajbj)
Date: 2008-11-05 09:59

Message:
Good fix. Why not check it into the 5.6 branch?
Tony

----------------------------------------------------------------------

Comment By: Bert Wesarg (lebert)
Date: 2008-11-05 08:33

Message:
confirmed. here is a proposed fix:

--- a/source/file.c
+++ b/source/file.c
@@ -2061,6 +2061,13 @@ static int cmpWinAgainstFile(WindowInfo 
         
         nRead += offset;
 
+        /* check for on-disk file format changes, but only for the first
hunk */
+        if (bufPos == 0 && fileFormat != FormatOfFile(fileString)) {
+            fclose(fp);
+            AllWindowsUnbusy();
+            return (1);
+        }
+
         if (fileFormat == MAC_FILE_FORMAT)
             ConvertFromMacFileString(fileString, nRead);
         else if (fileFormat == DOS_FILE_FORMAT)


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=2222159&group_id=11005
-- 
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop

Reply via email to