Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Word navigation #83

Open
Open
@dhardy

Description

@dhardy

Text-editors typically make Ctrl+Left jump to the previous start-of-word and Ctrl+Right jump to the next end-of-word (or sometimes start-of-next-word). To implement this, we can usesplit_word_bound_indices to find word boundaries, however, it returnsall word boundaries (start and end).

At first attempt to improve on this, one can skip indices where the next (or previous) char is whitespace. This is an improvement, but not perfect since e.g. ina::b every position is considered a word boundary while the user would expect to skip over:: as a whole (and possibly on until the next word's start/end).

This may not be a problem you wish to solve, in which case, fair enough. But, any idea how it might be done?

BTW if you wish to test this in action, seeKAS. Thelayout example has a passable editor (for small documents). The word-navigation code in question is aroundhere (disregard the TODO comment if you see this before the next commit lands).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp