Skip to content

Keyboard Shortcuts for the Home and End Keys #1361

@douglasmatheus

Description

@douglasmatheus

What problem does this feature solve?

Currently, there's no native way to work with the Home and End keys on the keyboard. I tried using the existing API, but the only effect I achieved was setting the cursor to the beginning/end of the line like this:

  const ctx = editor.command.getRangeContext()
  editor.command.focus({ rowNo: ctx.startRowNo, position: 'before' })
  editor.command.focus({ rowNo: ctx.startRowNo, position: 'after' })

But I couldn't use getRangeContext in conjunction with executeSetRange to select the entire remaining part of the line, either to the left or right.

From what I understand, the rangeContext information isn't sufficient to set the selection to the beginning/end of the line.

I don't know if I'm not using the information correctly.

What does the proposed API look like?

I implemented two files for the keydown handler, home and end. It works normally even within tables.

Gravacao.de.Tela.2026-02-24.143702.mp4

I'll send a PR if the author is interested. As I said before, I don't know if the current API provides a way to achieve this result; if so, I would be grateful if the author could guide me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions