Skip to content

fix: make indent commands return proper command result#343

Merged
cguedes merged 1 commit into
mainfrom
342-pressing-backspace-should-merge-line
Aug 15, 2023
Merged

fix: make indent commands return proper command result#343
cguedes merged 1 commit into
mainfrom
342-pressing-backspace-should-merge-line

Conversation

@sehyod

@sehyod sehyod commented Aug 14, 2023

Copy link
Copy Markdown
Collaborator

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

codecov Bot commented Aug 14, 2023

Copy link
Copy Markdown

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
@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