Skip to content

Commit 900d0f2

Browse files
committed
Fix: Indented position not holding while editing
1 parent f7d47a1 commit 900d0f2

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## [1.2.1]
2+
* Indented position not holding while editing.
3+
14
## [1.2.0]
25
* Fix image button cancel causes crash.
36

lib/models/documents/nodes/line.dart

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,18 +208,23 @@ class Line extends Container<Leaf?> {
208208
_unwrap();
209209
} else if (blockStyle != parentStyle) {
210210
_unwrap();
211-
final block = Block()..applyAttribute(blockStyle);
212-
_wrap(block);
213-
block.adjust();
211+
_applyBlockStyles(newStyle);
214212
} // else the same style, no-op.
215213
} else if (blockStyle.value != null) {
216214
// Only wrap with a new block if this is not an unset
217-
final block = Block()..applyAttribute(blockStyle);
218-
_wrap(block);
219-
block.adjust();
215+
_applyBlockStyles(newStyle);
220216
}
221217
}
222218

219+
void _applyBlockStyles(Style newStyle) {
220+
var block = Block();
221+
for (final style in newStyle.getBlocksExceptHeader().values) {
222+
block = block..applyAttribute(style);
223+
}
224+
_wrap(block);
225+
block.adjust();
226+
}
227+
223228
/// Wraps this line with new parent [block].
224229
///
225230
/// This line can not be in a [Block] when this method is called.

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_quill
22
description: A rich text editor supporting mobile and web (Demo App @ bulletjournal.us)
3-
version: 1.2.0
3+
version: 1.2.1
44
#author: bulletjournal
55
homepage: https://bulletjournal.us/home/index.html
66
repository: https://github.com/singerdmx/flutter-quill

0 commit comments

Comments
 (0)