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

add OnProperty() for Navigator #626

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add OnProperty() for Navigator #626

wants to merge 1 commit into from

Conversation

shewer
Copy link
Contributor

@shewer shewer commented Mar 12, 2023

Pull request

add property to control Navigator
property name :
_navigator : [right|left]by[char|syllable] , [left|right] [home|end] rewind
move_by_syllable: [-num|num] -left | +right

Issue tracker

Fixes will automatically close the related issue

Fixes #

Feature

Describe feature of pull request

Unit test

  • Done

Manual test

  • Done

Code Review

  1. Unit and manual test pass
  2. GitHub Action CI pass
  3. At least one contributor reviews and votes
  4. Can be merged clean without conflicts
  5. PR will be merged by rebase upstream base

Additional Info

@groverlynn
Copy link
Contributor

groverlynn commented Oct 6, 2023

what you are proposing is a command, action or input, which is short-lived & one-off. It is neither appropriate nor feasible to represent an action by a property which stays unchanged for a long time or even permanently unchanged.

The logic of your codes inverts the causality: when you change the "property" of left_by_char to 3, then the cursor should move 3 characters to the left. But be aware, for every character to the left the cursor moves past, the "property" of left_by_char actually should attain 1 — and you shall find yourself in an infinite loop, should the code be really logically implemented, though that's not the case here.

Even if we pretend that property can be abused in this way, it really doesn't work. Try if you set left_by_char to 3, and after the cursor has moved 3 characters, you set left_by_char to 3 again, then nothing will happen because the property hasn't changed at all but you are forcing the static property to enforce a dynamic action.

Your intention can be easily implemented by key binding

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

Successfully merging this pull request may close these issues.

2 participants