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)
Change History (20)
by , 13 years ago
Attachment: | usb_davicom.log added |
---|
comment:1 by , 13 years ago
comment:3 by , 13 years ago
Kedit and Kate are able to open it. Kate warns that it contains binary data when saving, though.
by , 13 years ago
Attachment: | usb_davicom_tiny.log added |
---|
comment:5 by , 12 years ago
Blocked By: | 9395 added |
---|
comment:7 by , 5 years ago
Blocking: | 15206 added |
---|
comment:8 by , 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 , 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 , 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:12 by , 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 , 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:16 by , 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 , 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" ?
comment:18 by , 4 years ago
Milestone: | R1 → R1.1 |
---|
Just FYI, Ubuntu's gedit (v 2.30.4) seems to choke on the file as well.