micro-editor / micro-editor/micro

Feature request: `colorcolumn` supporting multiple values (only in `settings.json`)

Open
#2,847 2 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
29.6k
Forks
1.4k
Avg merge
2d 18h
Merged PRs (30d)
10

Description

Having multiple highlighted columns is useful in some cases.

For example, Git commit messages usual practice: first line 50 columns, body text 72 columns.

    "ft:git-commit": {
        "colorcolumn": [50, 72]
    },

In Python, the black formatter defaults to 88 columns for code, but for the docstrings and comments, our team prefers breaking them at 80 columns.

    "ft:python": {
        "colorcolumn": [80, 88]
    },

In general, 80 columns is what I like to have, for any other file type.

    "colorcolumn": 80

This is a similar request to the rejected #2694, but my proposal here would be simpler: no new/renamed commands, no user-noticeable changes on the use of set colorcolumn.

We could keep the interactive use as it is, aiming for the simple/common case: set colorcolumn <integer> to set it to a specific column, or zero to turn it off. No changes here.

But, if the user has manually changed the settings.json file and set the value to a list of numbers, those will be respected.

If this makes more sense, maybe it could be valid only for scoped settings (ft: and glob), since those are already not changed by the interactive set command.

Would that be acceptable?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how settings.json values are parsed for scoped ft: and glob settings, then review the interactive set colorcolumn command and its integer and zero-value behavior. Done means list values from settings.json produce multiple highlighted columns while existing interactive behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.