Skip to content

Commit

Permalink
fix: ignore lines without problems
Browse files Browse the repository at this point in the history
  • Loading branch information
lvjiaxuan committed Oct 29, 2022
1 parent 191c85d commit 6250ad3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ const disposes = [

activeTextEditor.selections.forEach(selection => {

if (!Object.keys(lineRuleIdsMap).some(problemLine =>
selection.start.line + 1 <= +problemLine && +problemLine <= selection.end.line + 1)) {
log('No problem rules found on selected lines.', true, 'OK')
return
}

const text = getTextBylines(selection.start.line, selection.end.line)
if (!text?.replace(/\n|\r/g, '')) {
Expand Down

0 comments on commit 6250ad3

Please sign in to comment.