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: make indent commands return proper command result #343

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

sehyod
Copy link
Collaborator

@sehyod sehyod commented Aug 14, 2023

Problem
indent and unindent commands were returning true to block default behavior of Tab and Shift-Tab shortcuts. However this made the Backspace command believe that the content could be unindented, blocking the fallback behavior of the shortcut, which is merging the line with the previous one.

Solution
This changes the return result of indent and unindent commands back to the proper boolean indicating whether the command can run.
Tab and Shift-Tab shortcuts are now the one responsible for returning true to block the default behavior of these shortcuts.

Fixes #342

@sehyod sehyod requested a review from cguedes August 14, 2023 10:47
@codecov
Copy link

codecov bot commented Aug 14, 2023

Codecov Report

Merging #343 (708f6b1) into main (af4e0b3) will decrease coverage by 0.07%.
The diff coverage is 18.18%.

@@            Coverage Diff             @@
##             main     #343      +/-   ##
==========================================
- Coverage   86.35%   86.28%   -0.07%     
==========================================
  Files         150      150              
  Lines        8491     8497       +6     
  Branches      957      957              
==========================================
  Hits         7332     7332              
- Misses       1148     1154       +6     
  Partials       11       11              
Files Changed Coverage Δ
...ponents/tipTapNodes/notionBlock/commands/indent.ts 23.80% <0.00%> (ø)
...nents/tipTapNodes/notionBlock/commands/unindent.ts 27.02% <0.00%> (ø)
...ponents/tipTapNodes/notionBlock/NotionBlockNode.ts 74.17% <25.00%> (-1.37%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cguedes cguedes merged commit 97c600f into main Aug 15, 2023
9 of 11 checks passed
@cguedes cguedes deleted the 342-pressing-backspace-should-merge-line branch August 15, 2023 15:34
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.

Pressing backspace at the start of a line does not work
2 participants