Skip to content

Bigword movement doesn't handle non-print non-blank characters very well #7328

@lilyball

Description

@lilyball

Bigword movement uses std::iswblank(c) and std::iswgraph(c) in its implementation, and seems to make the assumption that any character is either blank or graph (or a control character which it doesn't care about). But in the BMP alone there are 6801 codepoints (on my machine running macOS 10.15.6) that are neither blank nor graph or control. Some of these are reserved codepoints, but many are not. For example, Σ (U+03A3 GREEK CAPITAL LETTER SIGMA). Given this, the implementation should probably be using !std::iswblank(c) anywhere it uses std::iswgraph(c).

For that matter, newlines are whitespace but they aren't blank, which means bigword movement stops on every newline, which seems odd. So it should probably be using std::iswspace instead of std::iswblank (the former includes 8 characters the latter doesn't).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions