diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-07-06 12:39:17 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-07-06 12:39:17 -0700 |
commit | 7207da47c790aab81f59e777b9d02769b46fb7f4 (patch) | |
tree | 85873f54f238cd9d9be7f64f51484c52a22ef9e1 /continuedev/src/continuedev/core | |
parent | 1e00942edec9c9aa4c69f2a8be7e43f06df684df (diff) | |
download | sncontinue-7207da47c790aab81f59e777b9d02769b46fb7f4.tar.gz sncontinue-7207da47c790aab81f59e777b9d02769b46fb7f4.tar.bz2 sncontinue-7207da47c790aab81f59e777b9d02769b46fb7f4.zip |
details
Diffstat (limited to 'continuedev/src/continuedev/core')
-rw-r--r-- | continuedev/src/continuedev/core/autopilot.py | 18 | ||||
-rw-r--r-- | continuedev/src/continuedev/core/main.py | 2 |
2 files changed, 14 insertions, 6 deletions
diff --git a/continuedev/src/continuedev/core/autopilot.py b/continuedev/src/continuedev/core/autopilot.py index acdc1f0d..4466a01e 100644 --- a/continuedev/src/continuedev/core/autopilot.py +++ b/continuedev/src/continuedev/core/autopilot.py @@ -151,15 +151,23 @@ class Autopilot(ContinueBaseModel): self._highlighted_ranges[0].editing = True async def handle_highlighted_code(self, range_in_files: List[RangeInFileWithContents]): - if not self._adding_highlighted_code and len(self._highlighted_ranges) > 0: - return # If un-highlighting, then remove the range - if len(self._highlighted_ranges) == 1 and len(range_in_files) == 1 and range_in_files[0].range.start == range_in_files[0].range.end: + if len(self._highlighted_ranges) == 1 and len(range_in_files) <= 1 and (len(range_in_files) == 0 or range_in_files[0].range.start == range_in_files[0].range.end): self._highlighted_ranges = [] await self.update_subscribers() return + # If not toggled to be adding context, only edit or add the first range + if not self._adding_highlighted_code and len(self._highlighted_ranges) > 0: + if len(range_in_files) == 0: + return + if range_in_files[0].range.overlaps_with(self._highlighted_ranges[0].range) and range_in_files[0].filepath == self._highlighted_ranges[0].range.filepath: + self._highlighted_ranges = [HighlightedRangeContext( + range=range_in_files[0].range, editing=True, pinned=False)] + await self.update_subscribers() + return + # Filter out rifs from ~/.continue/diffs folder range_in_files = [ rif for rif in range_in_files if not os.path.dirname(rif.filepath) == os.path.expanduser("~/.continue/diffs")] @@ -391,8 +399,8 @@ class Autopilot(ContinueBaseModel): return # Remove context unless pinned - self._highlighted_ranges = [ - hr for hr in self._highlighted_ranges if hr.pinned] + # self._highlighted_ranges = [ + # hr for hr in self._highlighted_ranges if hr.pinned] # await self._request_halt() # Just run the step that takes user input, and diff --git a/continuedev/src/continuedev/core/main.py b/continuedev/src/continuedev/core/main.py index 62cc4936..d8bacb1f 100644 --- a/continuedev/src/continuedev/core/main.py +++ b/continuedev/src/continuedev/core/main.py @@ -259,7 +259,7 @@ class Step(ContinueBaseModel): if self.description is not None: d["description"] = self.description else: - d["description"] = "`Step in progress...`" + d["description"] = "Step in progress..." return d @validator("name", pre=True, always=True) |