-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
cmark files and multiline fragments #74
Conversation
src/action/interactive.rs
Outdated
@@ -403,11 +403,14 @@ impl UserPicked { | |||
} | |||
|
|||
let event = match crossterm::event::read() | |||
.map(move |event| { | |||
drop(guard); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
src/action/interactive.rs
Outdated
@@ -435,7 +437,6 @@ impl UserPicked { | |||
} | |||
} | |||
|
|||
drop(guard); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That drop()
is unnecessary because drop
for ScopedRaw
in line 424 is called when it goes out of scope and now it's ensured that all earlier guards
are properly dropped right? Just for my understanding :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if the current approach is sane, there seem to be a few artificats in the cli, cursor showing and lines being off by one, just because we leave raw mode, so this might have to be reverted eventually.
.skip_while(|(sub, _span)| sub.end <= start) | ||
.take_while(|(sub, _span)| end <= sub.end) | ||
.skip_while(|(fragment_range, _span)| fragment_range.end <= start) | ||
.take_while(|(fragment_range, _span)| end <= fragment_range.end) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the new variable names 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does fragment_range
means here? if I may ask
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's best explained in the module docs https://github.com/drahnr/cargo-spellcheck/pull/74/files/27c8c0f661e02c310dfa14a9d6475b73f1312cd2#diff-5fe541b5263f70cb56752ad21183cdddR1-R13 if not that must be expanded.
Co-authored-by: Korbinian Maier <[email protected]>
Note that the root cause for dbg!(suggestion) has yet to be investigated.
9d0ee93
to
01aefc2
Compare
01aefc2
to
b8012a3
Compare
return None; | ||
} | ||
.filter_map(|(fragment_range, fragment_span)| { | ||
// trim range so we only capture the relevant part |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is considered an irrelevant part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not about irrelevant, it's a coverage problem of the given input
range on the set of fragmented ranges. Note the fragmentation is caused by clustering of multiple literals. A fragment is a mere description of a range/span couple concept of a chunk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Short question: does this PR helps to fix chunk for single lines? or helps me here: #65?
Co-authored-by: Laysa Uchoa <[email protected]>
@laysauchoa the above is intentional to avoid you having to deal with merge conflicts, the display is going to be a separate PR once #74 and #65 are in master. |
This reverts commit 2e727e5.
Most tests and the manual spans calculated expect that.
The extracted rules are a best effort based on trial and error, far from perfect.
82494df
to
342eb39
Compare
What does this PR accomplish?
Does all handling of multiline literals, except for displaying, which must be handled in a separate PR.
Closes #37 which requires proper handling of chunks with multiline fragments
Changes proposed by this PR:
feather_up!
for testability