Support icon indicating copy to clipboard operation
Support copied to clipboard

Can't display certain file types

Open NordicAngel opened this issue 2 years ago • 6 comments

GitFiend won't display the diffs for some types of files when in the changes tab or during merge, but will after they have been committed or stashed. I know .ext files doesn't work even though I can read them in Notepad as plain text. Is there anything I can do on my end?

NordicAngel avatar Sep 01 '23 10:09 NordicAngel

After messing with this for a bit I found that some times the files show and after using git diff to find out why some work, I found that the one that doesn't work, don't have CR but the ones that work do. So the problem might be that it's trying to diff files with different or mixed line endings.

NordicAngel avatar Sep 01 '23 11:09 NordicAngel

Update apparently the thing that breaks it is not EOL but special characters like "æÆøØåÅ" is there some way of helping that on my end?

NordicAngel avatar Sep 05 '23 12:09 NordicAngel

Thanks for investigating. I can try a file with all the special characters I can find and see if I can reproduce it. If I can reproduce the issue, I'll have a fix in the next version.

GitFiend avatar Sep 05 '23 23:09 GitFiend

I've been trying some unicode testing pages and haven't been able to replicate the issue. If could get a minimal repo or a file that shows the issue, that would be great.

GitFiend avatar Sep 06 '23 03:09 GitFiend

I have been able to recreate the problem in a repo here. Apparently the problem is special characters in ansi encoding.

NordicAngel avatar Sep 06 '23 08:09 NordicAngel

Thanks for the repo, that helped a lot. It looks like strings in Rust are guaranteed utf8, so that file can't be read into a standard string for diffing. It looks like the best solution is to switch to a different kind of string, but that will involve quite a lot of changes. I'll probably start this soon.

GitFiend avatar Sep 07 '23 05:09 GitFiend