fix(editor): text align not work (#13740)

#### PR Dependency Tree


* **PR #13740** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved reliability of updating block alignment when the current
selection isn’t explicitly defined. The editor now retrieves the
selection more consistently, reducing cases where alignment controls
appeared unresponsive or had no effect.
* Covers scenarios during initialization or edge cases where selection
was previously missed, resulting in smoother editing and fewer false
negatives when applying alignment.
* No changes to visible UI or shortcuts; behavior is simply more
consistent.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
L-Sun
2025-10-14 11:10:38 +08:00
committed by GitHub
parent 50f41c2212
commit 59d8d0fbae

View File

@@ -22,7 +22,7 @@ export const updateBlockAlign: Command<UpdateBlockAlignConfig> = (
) => {
let { std, textAlign, selectedBlocks } = ctx;
if (selectedBlocks === null) {
if (!selectedBlocks) {
const [result, ctx] = std.command
.chain()
.tryAll(chain => [