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

fix: fall back to original indentation keypress functionality #84

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mcauley-penney
Copy link

Problem: the press() function is used to fall back to the original functionality of <tab> and <S-tab> when not in a list context. When it does this, it appends before executing the original keypress, modifying the fall back functionality.

Solution: Do not append before using the fall back functionality of <tab> and <S-tab>.

This commit also refactors handle_indent(),
- removes unused variables
- removes run_recalculate_after_delay(), which appears to have
no effect
- reuses variables when possible (cur_line)
- renames variables for brevity (in_list and at_line_end)

Fixes #79

Problem: the `press()` function is used to fall back to the original
functionality of `<tab>` and `<S-tab>` when not in a list context. When
it does this, it appends before executing the original keypress,
modifying the fall back functionality.

Solution: Do not append before using the fall back functionality of
`<tab>` and `<S-tab>`.

This commit also refactors `handle_indent()`,
     - removes unused variables
     - removes `run_recalculate_after_delay()`, which appears to have
       no effect
     - reuses variables when possible (`cur_line`)
     - renames variables for brevity (`in_list` and `at_line_end`)

Fixes gaoDean#79
@mcauley-penney mcauley-penney marked this pull request as draft December 30, 2023 17:10
@mcauley-penney
Copy link
Author

@gaoDean I'd like a test run of this PR to see how it works for you

@pipoprods
Copy link

Just installed this modified version. I'll (hopefully) post feedback here.

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.

TAB has some bug at Insert mode
2 participants