Opened 13 years ago

Last modified 4 years ago

#7954 new bug

[StyledEdit] shows only small part of file

Reported by: diver Owned by: korli
Priority: normal Milestone: R1.1
Component: Applications/StyledEdit Version: R1/Development
Keywords: Cc:
Blocked By: #6447, #9395 Blocking: #15206
Platform: All

Description

This is hrev42704, gcc2hybrid.

StyledEdit shows several lines of the attached 2,4Mb log file.
Siarzhuk suggested that StyledEdit can't read after 0х88F offset of this file.

Attachments (2)

usb_davicom.log (2.3 MB ) - added by diver 13 years ago.
usb_davicom_tiny.log (16.9 KB ) - added by diver 13 years ago.

Change History (20)

by diver, 13 years ago

Attachment: usb_davicom.log added

comment:1 by luroh, 13 years ago

Just FYI, Ubuntu's gedit (v 2.30.4) seems to choke on the file as well.

comment:2 by diver, 13 years ago

Probably because of line 60.

comment:3 by diver, 13 years ago

Kedit and Kate are able to open it. Kate warns that it contains binary data when saving, though.

by diver, 13 years ago

Attachment: usb_davicom_tiny.log added

comment:4 by siarzhuk, 12 years ago

Blocked By: 6447 added

Potential duplicate of #6447

comment:5 by siarzhuk, 12 years ago

Blocked By: 9395 added

comment:6 by diver, 5 years ago

Still here in hrev53129.

comment:7 by diver, 5 years ago

Blocking: 15206 added

comment:8 by pulkomandy, 4 years ago

The file contains a NUL char which is used in C for end of string (line 10 in the "tiny" version).

What should we do about that? Do not allow opening the file? Ignore the character? Render it in a special way?

comment:9 by diver, 4 years ago

I think not opening a file at all is a bad user experience. Pe renders such characters in a special way so they are immediately visible which I think is a better option.

comment:10 by pulkomandy, 4 years ago

Well, the thing is, StyledEdit is meant to be a very simple text editor a bit like Window's Notepad. Special character handling makes sense in Pe, Koder, or vim, but in StyledEdit I'm not so sure.

comment:11 by diver, 4 years ago

Either case, not being able to open a file at all is the worst.

comment:12 by pulkomandy, 4 years ago

I think pretending to open it but not showing the data is worse than admitting the file cannot be handled. Data loss is worse than not being able to access the data, but at least not destroying it.

comment:13 by humdinger, 4 years ago

Silently failing isn't nice. StyledEdit should put up an alert "The file '%filename%' contains special characters that StyledEdit can't handle. The file can't be opened."

comment:14 by pulkomandy, 4 years ago

No one suggested *silently* failing (of course not...)

comment:15 by humdinger, 4 years ago

Then I was just stating the obvious. :)

comment:16 by bitigchi, 4 years ago

An error message with a button to select a different application maybe? With relevant installed text editors pre-selected or listed on top?

comment:17 by ttcoder, 4 years ago

IIRC StyledEdit has a "read-only" mode that was implemented a while back, when opening files from a partition mounted read-only. Previous to implementing that mode, it would allow invoking Cmd-S, which would then show a "read-only partition" BAlert. After that mode was implemented, it would outright prevent from invoking Save (the Save menu item is SetEnabled(false)), which is better UX.

Maybe that mode could be "forced" here? That would be in addition to displaying a B_ERROR_ALERT warning that "This file contains some binary data which StyledEdit cannot handle and cannot save back to disk reliably; [StyledEdit will attempt to load and display as much as possible of that file, but] saving will be disabled to prevent data loss" ?

Last edited 4 years ago by ttcoder (previous) (diff)

comment:18 by pulkomandy, 4 years ago

Milestone: R1R1.1
Note: See TracTickets for help on using tickets.