Skip to content

Conversation

@Chandan-CV
Copy link
Contributor

This PR fixes the issue #416

Steps I took to fix the issue:

  1. Having a selection is mandatory for formatting. selection.lenght > 0
  2. Hence, when a keyboard shortcut is pressed, a white space is inserted. and the formatting is carried out on the whitespace
  3. from then, any text entered after the shortcut will have the same formatting options.

demo:

Screencast.from.08-09-23.01.22.34.AM.IST.webm

@Chandan-CV
Copy link
Contributor Author

Chandan-CV commented Sep 13, 2023

@Xazin and @LucasXu0, your inputs here will be greatly appreciated :)

Thank you.

@Xazin
Copy link
Contributor

Xazin commented Sep 19, 2023

Hey @Chandan-CV - Sorry about the delay, I'll take a look at this the coming weekend and test it out.

The solution at first glance looks straightforward 👍

@Chandan-CV
Copy link
Contributor Author

Thank you!
Looking forward to hearing from you:)

@Chandan-CV
Copy link
Contributor Author

Hi @Xazin! any updates on the PR?

end: selection.end.copyWith(offset: selection.end.offset),
),
).first ==
" ";
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's abstract this to a const eg. const whiteSpaceCharacter = " ";

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'm on it :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Xazin, I refactored the code accordingly. Does it look right now?

Thank you!

@LucasXu0
Copy link
Collaborator

@Chandan-CV Thank you for your contribution. I have implemented this feature by saving the toggled style.

@Xazin
Copy link
Contributor

Xazin commented Oct 12, 2023

We have implemented a version of this 👍

@Xazin Xazin closed this Oct 12, 2023
@Chandan-CV
Copy link
Contributor Author

That's a really clean implementation of the feature! Thank you for showing me how it's done :)

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.

3 participants