memspace / zefyr

Soft and gentle rich text editing for Flutter applications.
https://zefyr-editor.gitbook.io
2.22k stars 550 forks source link

calling document.delete assert always throwing error #255

Open arlindiDev opened 4 years ago

arlindiDev commented 4 years ago

Steps to Reproduce

  1. Im creating a document and giving that to the Controller
    document ??= NotusDocument.fromDelta(
      const NotusHTMLCodec().decode(text),
    )
    ZefyrController(document)
  2. writing text and everything works fine
  3. when I call the line below it always fail (see exception) controller.document.delete(controller.document.length - 2, controller.document.length - 1)

Logs

════════ (52) Exception caught by foundation library ═══════════════════════════════════════════════ 'package:notus/src/document/line.dart': Failed assertion: line 267 pos 14: 'nextLine != null': is not true.

[✓] Flutter (Channel unknown, v1.13.6, on Mac OS X 10.14.6 18G103, locale en-DE) • Flutter version 1.13.6 at /Users/ahajredinaj/Development/flutter • Framework revision 659dc8129d (9 weeks ago), 2019-12-30 09:24:47 -0800 • Engine revision bdc9708d23 • Dart version 2.8.0 (build 2.8.0-dev.0.0 c547f5d933)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0-rc3) • Android SDK at /Users/ahajredinaj/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.0-rc3 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.3.1, Build version 11C504 • CocoaPods version 1.7.5

[✓] Android Studio (version 3.5) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 40.2.2 • Dart plugin version 191.8580 • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] IntelliJ IDEA Community Edition (version 2019.2.3) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin version 40.1.4 • Dart plugin version 192.6817.14

[✓] VS Code (version 1.29.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 2.20.0

[✓] Connected device (2 available) • Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator) • macOS • macOS • darwin-x64 • Mac OS X 10.14.6 18G103

• No issues found!

arlindiDev commented 4 years ago

This is the worst library I've used