Skip to content

Commit

Permalink
fix: dismiss diff is not working on windows and typo (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
sampellino authored Apr 2, 2024
1 parent e285e71 commit 8409922
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
"when": "false"
},
{
"command": "foldersCompare.dissmissDifference",
"command": "foldersCompare.dismissDifference",
"when": "false"
},
{
Expand Down Expand Up @@ -255,7 +255,7 @@
"group": "1_folderCompares_actions@1"
},
{
"command": "foldersCompare.dissmissDifference",
"command": "foldersCompare.dismissDifference",
"when": "view == foldersCompareAppService && viewItem == file",
"group": "inline"
},
Expand Down Expand Up @@ -292,8 +292,8 @@
"command": "foldersCompare.deleteFile"
},
{
"title": "Dissmiss Difference",
"command": "foldersCompare.dissmissDifference",
"title": "Dismiss Difference",
"command": "foldersCompare.dismissDifference",
"icon": "$(close)"
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/constants/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export const TAKE_COMPARED_FILE = 'foldersCompare.takeComparedFile';
export const DELETE_FILE = 'foldersCompare.deleteFile';
export const PICK_FROM_RECENT_COMPARES = 'foldersCompare.pickFromRecentCompares';
export const CLEAR_RECENT_COMPARES = 'foldersCompare.clearRecentCompares';
export const DISSMISS_DIFFERENCE = 'foldersCompare.dissmissDifference';
export const DISMISS_DIFFERENCE = 'foldersCompare.dismissDifference';
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { window, commands, ExtensionContext, workspace, Uri, version} from 'vscode';
import { CompareFoldersProvider } from './providers/foldersCompareProvider';
import { COMPARE_FILES, CHOOSE_FOLDERS_AND_COMPARE, REFRESH, COMPARE_FOLDERS_AGAINST_EACH_OTHER, COMPARE_FOLDERS_AGAINST_WORKSPACE, COMPARE_SELECTED_FOLDERS, SWAP, COPY_TO_COMPARED, COPY_TO_MY, TAKE_MY_FILE, TAKE_COMPARED_FILE, DELETE_FILE, PICK_FROM_RECENT_COMPARES, CLEAR_RECENT_COMPARES, DISSMISS_DIFFERENCE } from './constants/commands';
import { COMPARE_FILES, CHOOSE_FOLDERS_AND_COMPARE, REFRESH, COMPARE_FOLDERS_AGAINST_EACH_OTHER, COMPARE_FOLDERS_AGAINST_WORKSPACE, COMPARE_SELECTED_FOLDERS, SWAP, COPY_TO_COMPARED, COPY_TO_MY, TAKE_MY_FILE, TAKE_COMPARED_FILE, DELETE_FILE, PICK_FROM_RECENT_COMPARES, CLEAR_RECENT_COMPARES, DISMISS_DIFFERENCE } from './constants/commands';
import { ViewOnlyProvider } from './providers/viewOnlyProvider';
import { globalState } from './services/globalState';
import { pickFromRecents } from './services/pickFromRecentCompares';
Expand All @@ -24,7 +24,7 @@ export async function activate(context: ExtensionContext) {
commands.registerCommand(COMPARE_FOLDERS_AGAINST_EACH_OTHER, foldersCompareProvider.compareFoldersAgainstEachOther),
commands.registerCommand(COMPARE_FOLDERS_AGAINST_WORKSPACE, foldersCompareProvider.chooseFoldersAndCompare),
commands.registerCommand(COMPARE_SELECTED_FOLDERS, foldersCompareProvider.compareSelectedFolders),
commands.registerCommand(DISSMISS_DIFFERENCE, foldersCompareProvider.dismissDifference),
commands.registerCommand(DISMISS_DIFFERENCE, foldersCompareProvider.dismissDifference),
commands.registerCommand(REFRESH, foldersCompareProvider.refresh),
commands.registerCommand(SWAP, foldersCompareProvider.swap),
commands.registerCommand(COPY_TO_COMPARED, foldersCompareProvider.copyToCompared),
Expand Down
6 changes: 5 additions & 1 deletion src/providers/foldersCompareProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ export class CompareFoldersProvider implements TreeDataProvider<File> {
};

dismissDifference = async (e: TreeItem) => {
const {path} = e.resourceUri || {};
const isWindows = process.platform === 'win32';
let {path} = e.resourceUri || {};
if (!path) {
return;
}
if(isWindows && e.resourceUri?.scheme){
path = `${e.resourceUri?.scheme}:${path}`;
}
this.ignoreDifferencesList.add(path);
this.filterIgnoredFromDiffs();
await this.updateUI();
Expand Down

0 comments on commit 8409922

Please sign in to comment.