Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Column number incorrect when using hard tabs #170

@MageLuingil

Description

@MageLuingil

The number being displayed for the cursor position is the character number, not the column number.

Observed behavior:

The issue can be easily demonstrated by using hard tabs instead of soft tabs:

Using spaces:
atom-columns-spaces

Using tabs:
atom-columns-tabs-small

Notice how the cursor after the tab character shows my position as "2". It's right, in a way -- I am at the second character on that line; but that doesn't give me any information on what column the cursor is on. Things get especially confusing when you reach the 80-character Preferred Line Length line, but the status bar shows that you're only on column 78 (or 75 (with two leading tabs), or 72...)

Expected behavior:

Most editors I've used do show the column number rather than the character number (respecting tabs as multi-column characters), and the setting for Cursor Position Format also says it should show the column number, not the character number:

Format for the cursor position status bar element, where %L is the line number and %C is the column number

Additional comments:

I think it would be nice to be able to use both character and column number in the format string (maybe add a %c for character number?), but that might be an enhancement for another day. At the very least, the existing column number value should be fixed to work with wide characters (such as the four-space tab character demonstrated above)

Tested (and screenshot) using:
Atom version: 1.10.2 (safe mode)
OS and version: Linux Mint 17.3


This same issue was reported back in January in the main atom issue tracker: atom/atom#10522

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions