diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-06-30 00:09:52 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-06-30 00:09:52 -0700 |
commit | 0f61888193569f0c2347238b91540ad27e5d290a (patch) | |
tree | 27658c3e18686aa64d7c58f2623e835a23aaae84 /continuedev/src | |
parent | 1da66af471329204dec9749451d533a47212c7fa (diff) | |
download | sncontinue-0f61888193569f0c2347238b91540ad27e5d290a.tar.gz sncontinue-0f61888193569f0c2347238b91540ad27e5d290a.tar.bz2 sncontinue-0f61888193569f0c2347238b91540ad27e5d290a.zip |
require python >=3.7, off-by-one err in streaming
Diffstat (limited to 'continuedev/src')
-rw-r--r-- | continuedev/src/continuedev/steps/core/core.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/continuedev/src/continuedev/steps/core/core.py b/continuedev/src/continuedev/steps/core/core.py index 46c6a615..dfc7d309 100644 --- a/continuedev/src/continuedev/steps/core/core.py +++ b/continuedev/src/continuedev/steps/core/core.py @@ -331,7 +331,7 @@ class DefaultModelEditCodeStep(Step): # So here we will strip all matching lines from the end of current_block_lines lines_stripped = [] index_of_last_line_in_block = first_valid_match[0] - while len(current_block_lines) > 0 and current_block_lines[-1] == original_lines_below_previous_blocks[index_of_last_line_in_block]: + while len(current_block_lines) > 0 and current_block_lines[-1] == original_lines_below_previous_blocks[index_of_last_line_in_block - 1]: lines_stripped.append(current_block_lines.pop()) index_of_last_line_in_block -= 1 @@ -340,7 +340,7 @@ class DefaultModelEditCodeStep(Step): await sdk.ide.showSuggestion(FileEdit( filepath=rif.filepath, range=Range.from_shorthand( - current_block_start, 0, current_block_start + index_of_last_line_in_block, 0), + current_block_start + 1, 0, current_block_start + index_of_last_line_in_block, 0), replacement=replacement )) if replacement == "": @@ -462,7 +462,7 @@ class DefaultModelEditCodeStep(Step): await sdk.ide.showSuggestion(FileEdit( filepath=rif.filepath, range=Range.from_shorthand( - current_block_start, 0, current_block_start + len(original_lines_below_previous_blocks), 0), + current_block_start + 1, 0, current_block_start + len(original_lines_below_previous_blocks), 0), replacement="\n".join(current_block_lines) )) |