|
From: | Antonio Diaz Diaz |
Subject: | Re: [Bug-ed] Reading something into an empty file should set "changed" flag |
Date: | Tue, 29 Mar 2011 20:44:56 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.11) Gecko/20050905 |
John Cowan wrote:
Reading in a file certainly counts as a change in the buffer, so a q command in that circumstance should be rejected. I suppose a case could be made that if the read-in file is empty, the modified flag should not be set, but I think that would be more confusing.
I think the case for not setting the modified flag when reading an empty file is indeed strong because, well, the buffer has not been modified, and a subsequent undo won't be able to reset the flag.
$ touch x $ echo foo > y $ ed y 4 r x 0 u ? h Nothing to undo
[Prev in Thread] | Current Thread | [Next in Thread] |