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

Find multiple matches on the same line. #279

Closed
wants to merge 5 commits into from
Closed

Find multiple matches on the same line. #279

wants to merge 5 commits into from

Conversation

mtimaN
Copy link

@mtimaN mtimaN commented Jan 19, 2024

I modified find so that it can show multiple matches on the same line.

  • Changed the last_match variable so that it holds both coordinates of the last match
  • If a key has been found on the current row, the next search is performed in a slice starting after the key.

Copy link

codecov bot commented Jan 19, 2024

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (f63acb5) 48.70% compared to head (03b802b) 48.56%.

Files Patch % Lines
src/editor.rs 0.00% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #279      +/-   ##
==========================================
- Coverage   48.70%   48.56%   -0.14%     
==========================================
  Files          11       11              
  Lines        1043     1046       +3     
==========================================
  Hits          508      508              
- Misses        535      538       +3     
Flag Coverage Δ
wasm32-wasi 50.00% <0.00%> (-0.15%) ⬇️
x86_64-apple-darwin 50.09% <0.00%> (-0.15%) ⬇️
x86_64-pc-windows-gnu 0.20% <0.00%> (-0.01%) ⬇️
x86_64-unknown-linux-gnu 50.00% <0.00%> (-0.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mtimaN
Copy link
Author

mtimaN commented Jan 20, 2024

I fixed the linter error at the expense that parameter names are less suggestive. However I think the comments are insightful enough for the code to be readable.

return Some(current);
let mut cur = lst.unwrap_or_else(|| (usize::MAX, num_rows.saturating_sub(1)));
while {
// TODO: add find backwards on the same line

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
@mtimaN
Copy link
Author

mtimaN commented Jan 20, 2024

I've realized that my code unfortunately doesn't work for searching backwards on the same line and I can't find a solution that wouldn't break the line count. :(

@mtimaN mtimaN closed this Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant