Commit b41dd73
fix: prevent negative line index when maxReadFileLine is zero (#1915)
When maxReadFileLine setting was set to zero, the code would attempt to read lines with a negative end index
(maxReadFileLine - 1 = -1), causing the readLines function to reject the request.
This change:
- Checks if maxReadFileLine is greater than zero before calling readLines
- Returns an empty string when maxReadFileLine is zero
- Ensures content is only formatted with line numbers when it's not empty
Signed-off-by: Eric Wheeler <[email protected]>
Co-authored-by: Eric Wheeler <[email protected]>1 parent 2597347 commit b41dd73
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2341 | 2341 | | |
2342 | 2342 | | |
2343 | 2343 | | |
2344 | | - | |
| 2344 | + | |
2345 | 2345 | | |
2346 | 2346 | | |
2347 | 2347 | | |
2348 | | - | |
| 2348 | + | |
2349 | 2349 | | |
2350 | 2350 | | |
2351 | 2351 | | |
| |||
0 commit comments