Refined-github: Add a 80,120 column marker to the code editor

Created on 21 Aug 2018  路  8Comments  路  Source: sindresorhus/refined-github

When I edit markdown etc in GitHub's UI, I often have trouble figuring out where's the 80 character line mark is:

image

Could refined-github add some vertical gray rules indicating some popular breakpoints like 80 and 120 perhaps?

under discussion

Most helpful comment

I would like to request that this is reconsidered. I find that many novice contributors use the GitHub UI to file PRs with small changes.

Additionally, I would like to request that this marker is added in the PR view/page (both unified and split diff), as it makes it easier for people reviewing PRs.

All 8 comments

I like this idea, but I think it should be easily configurable on-the-fly, because different projects (and sometimes even different files in the same project) use different line length conventions.

Possibly NO because

  • Not many people use GitHub UI to edit files
  • As @waldyrious mentioned, different projects use different line length conventions, which needs to be made configurable, and requires additional maintenance without providing any value

GitHub is not a file editor (even if it provides some basic editing features), don't try to use it like one, even if you are trying to do a small change.


Maybe this could be used on each file view, but the UI would end up bad, and there is still the problem of maintenance and extensiblity.

I would like to request that this is reconsidered. I find that many novice contributors use the GitHub UI to file PRs with small changes.

Additionally, I would like to request that this marker is added in the PR view/page (both unified and split diff), as it makes it easier for people reviewing PRs.

Uh, I would like this reconsidered as well. I often end up editing markdown files in my project using GitHub UI (to make sure tables and images display correctly) and would like to have UI indicating where to break the line (as I find it important to have my files editable in terminal, where I spend most of my time).

See discussion in https://github.com/sindresorhus/refined-github/pull/1576

TLDR: 80 is too little and 120 is basically the screen width already (128)

80 is the default and there are still good reasons for it. Using this limit makes it easier to edit code in half a screen and assure that side-by-side diffs/reviews can be comfortably read. It's also relevant for projects, that communicate PRs via mail (like Git itself).

IMO the usefulness of this feature would not be to recommend/encourage a specific line length limit, but to facilitate web-based editing of documents that _already_ use such wrapping limits (which are plenty).

I think it would be fine to just show the 80-character marker if the 120 one is almost redundant due to the screen width.

If such a marker would help you, you can copy-paste this CSS into the box Refined GitHub provides (or via Stylus)

/* Add minimal 80ch marker in the file editor */
pre.CodeMirror-line {
    background: linear-gradient(to right, transparent 80ch, #fcfcfc 80ch) content-box;
}

The best part is that the color and distance are customizable by each user (as the first comment to this issue suggests) so we don't have to stay here and bikeshed it. Consider it an opt-in feature

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexanderadam picture alexanderadam  路  3Comments

fregante picture fregante  路  3Comments

Arcanemagus picture Arcanemagus  路  3Comments

olso picture olso  路  3Comments

mareksuscak picture mareksuscak  路  3Comments