sindresorhus/refined-github

Extend `show-whitespaces` to show mixed line endings #3121

qaisjp posted onGitHub

<!-- 1. Make sure your requested feature makes sense for Refined GitHub: https://github.com/sindresorhus/refined-github/issues/2960 2. Include a full URL where the feature should appear. -->

It would be good if #2073 could be extended to show CRLF / LF indicators if the file has mixed line endings. (Ew!)

It could look like how bat shows non-printable characters:

image

(Compare line 10 and line 11. Ignore the rest of the screenshot, this feature proposal is just about line endings. Not other non-printable characters.)

Why?

The current show-whitespaces feature has been fantastic in stopping tabs appears where they shouldn't (.editorconfig helps, but not everyone uses an IDE that supports it).

This feature will stop pesky CRLFs appearing where we don't want them.


Not possible. GitHub filters them out in the HTML.

Source ✅

curl https://raw.githubusercontent.com/qaisjp/test/line-endings-dodgy/middleclass.lua | bat -A

<img width="359" alt="" src="https://user-images.githubusercontent.com/1402241/82738281-c8bf5a80-9d36-11ea-9941-89c7fc54b2cf.png">

HTML ❌

curl https://github.com/qaisjp/test/pull/31/files | bat -A --paging=never

<img width="641" alt="" src="https://user-images.githubusercontent.com/1402241/82738288-d1b02c00-9d36-11ea-9e68-90d8c6ad139b.png">

posted by fregante almost 5 years ago
posted by fregante over 4 years ago

Heh, mistake. That file is using the "visible lf" glyph

posted by fregante over 4 years ago

Fund this Issue

$0.00
Funded

Pull requests