summaryrefslogtreecommitdiff
path: root/continuedev
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-07-21 01:49:28 -0700
committerNate Sesti <sestinj@gmail.com>2023-07-21 01:49:28 -0700
commit0cd32ba813f5506c0871159658728b8ce31825e1 (patch)
treedd1fe0b3320801f2e92bdaaf5ebfaf39c0585562 /continuedev
parent883219874035f46ca3409901ea186493a2ce46a5 (diff)
downloadsncontinue-0cd32ba813f5506c0871159658728b8ce31825e1.tar.gz
sncontinue-0cd32ba813f5506c0871159658728b8ce31825e1.tar.bz2
sncontinue-0cd32ba813f5506c0871159658728b8ce31825e1.zip
fix for top-of-file pruning in default edit step
Diffstat (limited to 'continuedev')
-rw-r--r--continuedev/src/continuedev/steps/core/core.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/continuedev/src/continuedev/steps/core/core.py b/continuedev/src/continuedev/steps/core/core.py
index 4afc36e8..98600f8b 100644
--- a/continuedev/src/continuedev/steps/core/core.py
+++ b/continuedev/src/continuedev/steps/core/core.py
@@ -220,13 +220,13 @@ class DefaultModelEditCodeStep(Step):
if total_tokens < MAX_TOKENS_FOR_MODEL[model_to_use.name]:
break
- if total_tokens > MAX_TOKENS_FOR_MODEL[model_to_use.name]:
- while cur_start_line < max_start_line:
- cur_start_line += 1
- total_tokens -= model_to_use.count_tokens(
- full_file_contents_lst[cur_end_line])
- if total_tokens < MAX_TOKENS_FOR_MODEL[model_to_use.name]:
- break
+ if total_tokens > MAX_TOKENS_FOR_MODEL[model_to_use.name]:
+ while cur_start_line < max_start_line:
+ cur_start_line += 1
+ total_tokens -= model_to_use.count_tokens(
+ full_file_contents_lst[cur_start_line])
+ if total_tokens < MAX_TOKENS_FOR_MODEL[model_to_use.name]:
+ break
# Now use the found start/end lines to get the prefix and suffix strings
file_prefix = "\n".join(