Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Edit option in block context menu #274

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

feat: Edit option in block context menu #274

wants to merge 5 commits into from

Conversation

cpcallen
Copy link
Contributor

@cpcallen cpcallen commented Mar 4, 2025

Introduce an "Edit block contents (→)" block context menu option. This is shown any time the cursor is on a block and not in the rightmost position 'on the current line'; consequently the description may sometimes be slightly misleading, because it might not be the contents of the current block that's being navigated to, but rather that of a sibling or parent block. The menu option weights are adjusted to put edit between insert and delete.

Also:

  • Rename the main directional shortcuts to match the names of the corresponding keys. (The corresponding methods on LineCursorare not renamed, as that seems like a riskier change.)
  • Sort inputs in navigation_controller.ts.

Part of #132.

cpcallen added 5 commits March 2, 2025 12:42
Rename the main directional shortcuts to match the names of
corresponding keys.

Not renaming the corresponding methods on LineCursor yet
as that seems like a riskier change.
If there are no inline nodes to the right of the cursor on the
'current line' of the program, hide the Edit option.

This means the menu item is shown any time the cursor is on a
block and not in the rightmost position 'on the current line';
consequently sometimes the description ("Edit block contents")
is possibly misleading, because it might not be the contents of
the _current_ block that's being navigated to, but rather that
of a sibling or parent block.
@cpcallen cpcallen marked this pull request as ready for review March 4, 2025 19:15
@cpcallen cpcallen requested a review from a team as a code owner March 4, 2025 19:15
@cpcallen cpcallen requested review from BenHenning and removed request for a team March 4, 2025 19:15
@cpcallen cpcallen marked this pull request as draft March 4, 2025 19:25
@cpcallen
Copy link
Contributor Author

cpcallen commented Mar 4, 2025

Marking as draft, as somehow I lost a big chunk of code in last commit!

@cpcallen
Copy link
Contributor Author

cpcallen commented Mar 5, 2025

Turns out this PR is fine; it was my local branch that I had somehow got in to some werid state that was not building.

@cpcallen cpcallen marked this pull request as ready for review March 5, 2025 16:26
OUT = 'out',
UP = 'up',
DOWN = 'down',
RIGHT = 'righ',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RIGHT = 'righ',
RIGHT = 'right',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants