mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-24 11:06:51 +08:00
opt pub page
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -26,7 +26,7 @@ import 'package:flutter/services.dart';
|
||||
/// created by bggRGjQaUbCoE on 2025/6/27
|
||||
///
|
||||
|
||||
enum RichTextType { text, composing, at, emoji, vote }
|
||||
enum RichTextType { text, composing, at, emoji, vote, common }
|
||||
|
||||
class Emote {
|
||||
late String url;
|
||||
@@ -752,7 +752,7 @@ class RichTextEditingController extends TextEditingController {
|
||||
text: e.text,
|
||||
style: composingRegionOutOfRange ? null : composingStyle,
|
||||
);
|
||||
case RichTextType.at:
|
||||
case RichTextType.at || RichTextType.common:
|
||||
richStyle ??= (style ?? const TextStyle())
|
||||
.copyWith(color: Theme.of(context).colorScheme.primary);
|
||||
return TextSpan(
|
||||
|
||||
@@ -2305,18 +2305,18 @@ class RenderEditable extends RenderBox
|
||||
localPos: localPos,
|
||||
lastTapDownPosition: _lastTapDownPosition!,
|
||||
);
|
||||
position = TextPosition(offset: newOffset);
|
||||
final newSelection = TextSelection.collapsed(offset: newOffset);
|
||||
|
||||
final TextRange word = _textPainter.getWordBoundary(position);
|
||||
late TextSelection newSelection;
|
||||
if (position.offset <= word.start) {
|
||||
newSelection = TextSelection.collapsed(offset: word.start);
|
||||
} else {
|
||||
newSelection = TextSelection.collapsed(
|
||||
offset: word.end,
|
||||
affinity: TextAffinity.upstream,
|
||||
);
|
||||
}
|
||||
// final TextRange word = _textPainter.getWordBoundary(position);
|
||||
// late TextSelection newSelection;
|
||||
// if (position.offset <= word.start) {
|
||||
// newSelection = TextSelection.collapsed(offset: word.start);
|
||||
// } else {
|
||||
// newSelection = TextSelection.collapsed(
|
||||
// offset: word.end,
|
||||
// affinity: TextAffinity.upstream,
|
||||
// );
|
||||
// }
|
||||
_setSelection(newSelection, cause);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user