Skip to content

Commit

Permalink
fix: multiple edits write fail (#14)
Browse files Browse the repository at this point in the history
* fix: don't open as preview to prevent only one edit remaining in multiple file edits.

* chore: just place modified diff in column two

* fix: coder may not change correctly
  • Loading branch information
lee88688 authored Nov 15, 2024
1 parent 24a10cd commit 2781530
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 3 additions & 4 deletions server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,15 @@ def update_coder(self):
fnames=(item.fs_path for item in self.reference_list if not item.readonly),
read_only_fnames=(item.fs_path for item in self.reference_list if item.readonly),
)

def chat(self, data: ChatSessionData):
need_update_coder = False
data.reference_list.sort(key=lambda x: x.fs_path)

if data.chat_type != self.chat_type:
if data.chat_type != self.chat_type or data.diff_format != self.diff_format:
need_update_coder = True
self.chat_type = data.chat_type
if data.diff_format != self.diff_format:
self.diff_format = data.diff_format
self.diff_format = data.diff_format
if data.reference_list != self.reference_list:
need_update_coder = True
self.reference_list = data.reference_list
Expand Down
7 changes: 6 additions & 1 deletion src/webViewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,17 @@ class VscodeReactView implements WebviewViewProvider {
});

const name = path.basename(data.path);
// 打开 diff 编辑器

// open diff editor
await vscode.commands.executeCommand(
'vscode.diff',
originalUri,
modifiedUri,
`${name} ${isNewFile ? 'Created' : 'Modified'}`,
{
viewColumn: vscode.ViewColumn.Two,
preview: false,
},
);
} catch (error) {
this.outputChannel.error(`Error opening diff: ${error}`);
Expand Down

0 comments on commit 2781530

Please sign in to comment.