bugGNU nano - Bugs: bug #65560, confusing feedback with --zero...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #65560: confusing feedback with --zero when one of the files is converted

Submitter:  Benno Schulenberg <bens>
Submitted:  Fri 05 Apr 2024 03:15:19 PM UTC
   
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  bens Open/Closed:  Open

Sun 07 Apr 2024 08:32:35 AM UTC, comment #4: 

Fixed in git, commit 2b335060, by suppressing all "Read xx lines" messages for --zero and --mini for new buffers.  The subsequent commit (fe4f74f6) provides information about the file format (when it's DOS or Mac) also on the mini bar, similar to how it's done when --minibar is not used.

Benno Schulenberg <bens>
Group administrator
Sat 06 Apr 2024 09:19:39 AM UTC, comment #3: 

Testing is hard.  :/  The mentioned commit is fine: it works with --minibar too.  I don't know what I did wrong while checking that.

Benno Schulenberg <bens>
Group administrator
Sat 06 Apr 2024 08:41:26 AM UTC, comment #2: 

The mentioned commit (f147131e) was deficient, because the conversion would not get shown for --minibar, only for --zero.  (And arguably its priority should be lower for --zero, as that option implies: suppress any unnecessary feedback).  For --minibar the conversion does get printed, but gets overwritten within milliseconds by the mini bar itself.  So... just forget about this conversion feedback for --mini and --zero, and revert the commit.

Benno Schulenberg <bens>
Group administrator
Sat 06 Apr 2024 07:15:02 AM UTC, comment #1: 

Bug existed since version 6.0, commit f147131e: "elevate two messages, so they get shown with --mini or --zero".

Yes, it would be nice to show them when opening just one file, but that would be inconsistent with opening multiple files when these conversion messages can't be shown.  Hrrm...

Benno Schulenberg <bens>
Group administrator
Fri 05 Apr 2024 03:15:19 PM UTC, original submission:  

To reproduce, run:

printf "aaa\xa" >111
printf " bbb\xd bbb\xd bbb\\xd" >222

src/nano --ignore --zero -x  111 222

See that the status bar briefly says "[ Read 3 lines (Converted from Mac format) ]".  This is confusing because the file in the current buffer has just one line.

(Bug was found when opening an empty file and a compressed tarball at the same time.)

The problem is in src/files.c:844 where feedback for --mini and --zero is suppressed only for normal Unix files, not for DOS or Mac files.  :/

It would have been nice to alert the user to the different format of a file (as it might be unexpected), but... as it causes trouble when opening multiple files (and the feedback is not really needed), just drop all number-of-lines feedback entirely when --mini or --zero are in effect.

If the format of a file is important, the user should not use --zero or --mini, or should use ^O and not ^S to save the buffer.

Benno Schulenberg <bens>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-04-07 bens StatusIn Progress Fixed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code