Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - Exception when deleting at beginning of line while composing action tag #2242

Open
KevinBrendel opened this issue Aug 14, 2024 · 0 comments
Assignees
Labels
area_supereditor Pertains to SuperEditor bounty_junior f:superlist Funded by Superlist time:2 type_bug Something isn't working

Comments

@KevinBrendel
Copy link
Contributor

KevinBrendel commented Aug 14, 2024

Package Version
super_editor, GitHub, main branch

User Info
coneno, QuikFlow

To Reproduce
Steps to reproduce the behavior:

  1. Go to the "Action Tags" section of the example app
  2. Create a second ParagraphNode by pressing enter (doesn't matter what is in the first ParagraphNode)
  3. Type "/" to start composing an action tag
  4. Press left arrow to jump to the beginning of the line
  5. Press backspace
  6. See exception

Actual behavior

════════ Exception caught by services library ══════════════════════════════════
The following _Exception was thrown during method call TextInputClient.performSelectors:
Exception: No such position in document: [DocumentPosition] - node: "f9e20d51-c9ee-4924-b97b-dfaf0324ed9b", position: (TextPosition(offset: 0, affinity: TextAffinity.downstream))

When the exception was thrown, this was the stack:
#0      MutableDocument.getNodesInside (package:super_editor/src/core/editor.dart:1173:7)
editor.dart:1173
#1      RemoveTextAttributionsCommand.execute (package:super_editor/src/default_editor/text.dart:1376:28)
text.dart:1376
#2      _DocumentEditorCommandExecutor.executeCommand (package:super_editor/src/core/editor.dart:701:15)
editor.dart:701
#3      Editor._executeCommand (package:super_editor/src/core/editor.dart:304:22)
editor.dart:304
#4      Editor.execute (package:super_editor/src/core/editor.dart:266:30)
editor.dart:266
#5      ActionTagComposingReaction._cancelComposingTag (package:super_editor/src/default_editor/text_tokenizing/action_tags.dart:437:23)
action_tags.dart:437
#6      ActionTagComposingReaction.react (package:super_editor/src/default_editor/text_tokenizing/action_tags.dart:325:7)
action_tags.dart:325
#7      Editor._reactToChanges (package:super_editor/src/core/editor.dart:357:16)
editor.dart:357
#8      Editor.endTransaction (package:super_editor/src/core/editor.dart:222:5)
editor.dart:222
#9      Editor.execute (package:super_editor/src/core/editor.dart:283:7)
editor.dart:283
#10     CommonEditorOperations.mergeTextNodeWithUpstreamTextNode (package:super_editor/src/default_editor/common_editor_operations.dart:1187:12)
common_editor_operations.dart:1187
#11     CommonEditorOperations.deleteUpstream (package:super_editor/src/default_editor/common_editor_operations.dart:1109:18)
common_editor_operations.dart:1109
#12     deleteBackward (package:super_editor/src/default_editor/document_ime/supereditor_ime_interactor.dart:709:21)
supereditor_ime_interactor.dart:709
#13     SuperEditorImeInteractorState._onPerformSelector (package:super_editor/src/default_editor/document_ime/supereditor_ime_interactor.dart:472:12)
supereditor_ime_interactor.dart:472
#14     DocumentImeInputClient.performSelector (package:super_editor/src/default_editor/document_ime/document_ime_communication.dart:305:22)
document_ime_communication.dart:305
#15     DeltaTextInputClientDecorator.performSelector (package:super_editor/src/default_editor/document_ime/ime_decoration.dart:104:14)
ime_decoration.dart:104
#16     ListBase.forEach (dart:collection/list.dart:51:13)
list.dart:51
#17     TextInput._handleTextInputInvocation (package:flutter/src/services/text_input.dart:1916:19)
text_input.dart:1916
#18     TextInput._loudlyHandleTextInputInvocation (package:flutter/src/services/text_input.dart:1794:20)
text_input.dart:1794
#19     MethodChannel._handleAsMethodCall (package:flutter/src/services/platform_channel.dart:571:55)
platform_channel.dart:571
#20     MethodChannel.setMethodCallHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:564:34)
platform_channel.dart:564
#21     _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:581:35)
binding.dart:581
#22     _invoke2 (dart:ui/hooks.dart:344:13)
hooks.dart:344
#23     _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:45:5)
channel_buffers.dart:45
#24     _Channel.push (dart:ui/channel_buffers.dart:135:31)
channel_buffers.dart:135
#25     ChannelBuffers.push (dart:ui/channel_buffers.dart:343:17)
channel_buffers.dart:343
#26     PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:750:22)
platform_dispatcher.dart:750
#27     _dispatchPlatformMessage (dart:ui/hooks.dart:257:31)
hooks.dart:257

call: MethodCall(TextInputClient.performSelectors, [1, [deleteBackward:]])
════════════════════════════════════════════════════════════════════════════════

Expected behavior
The action tag is cancelled, the "line break" is deleted, and the cancelled "/" is appended to the previous ParagraphNode.

Platform
macOS

Flutter version
Flutter 3.22.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b0850beeb2 (4 weeks ago) • 2024-07-16 21:43:41 -0700
Engine • revision 235db911ba
Tools • Dart 3.4.4 • DevTools 2.34.3

Screenshots
Screenshot 2024-08-14 at 17 29 14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area_supereditor Pertains to SuperEditor bounty_junior f:superlist Funded by Superlist time:2 type_bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants