quill-delta-dart icon indicating copy to clipboard operation
quill-delta-dart copied to clipboard

Iterator peek next

Open cgestes opened this issue 3 years ago • 3 comments

Please review. Some changes may be better done in another way.

This PR is needed to support Markdown auto formatting rules in Notus.

cgestes avatar Oct 21 '21 01:10 cgestes

I can move the extension in Notus. No issue. I believe they should just exist somewhere cause they are a pain in the ass to write.

I did implement peek before but it makes the code that uses it hard to grok.

And peek now is:

Final newIter = iter.clone()
newIter.next()

Also I believe skipToBeginningOfLineBeforeIndex would be more optimised if we skip to index and then look backward. Otherwise we look for \n on every single line from start of doc.

cgestes avatar Oct 22 '21 08:10 cgestes

For EOF I like the idea too. Will implement in a future PR. I came to it cause the doc on DeltaItarator.next was incorrect, so I reimplement by mistake what the doc was saying...then had to fix the test in Notus and noticed it was all making more sense 😅

cgestes avatar Oct 22 '21 08:10 cgestes

Codecov Report

Merging #26 (b8c13d5) into master (4846633) will decrease coverage by 10.48%. The diff coverage is 43.75%.

:exclamation: Current head b8c13d5 differs from pull request most recent head c950b1b. Consider uploading reports for the commit c950b1b to get more accurate results Impacted file tree graph

@@             Coverage Diff             @@
##           master      #26       +/-   ##
===========================================
- Coverage   93.56%   83.08%   -10.49%     
===========================================
  Files           1        1               
  Lines         342      396       +54     
===========================================
+ Hits          320      329        +9     
- Misses         22       67       +45     
Impacted Files Coverage Δ
lib/quill_delta.dart 83.08% <43.75%> (-10.49%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4846633...c950b1b. Read the comment docs.

codecov[bot] avatar Oct 22 '21 13:10 codecov[bot]