mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Use desired file name when generating new md pasted file paths (#183861)
Fixes #183851
This commit is contained in:
parent
5f37021eeb
commit
50527c97d8
|
@ -2,7 +2,6 @@
|
|||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as path from 'path';
|
||||
import * as picomatch from 'picomatch';
|
||||
import * as vscode from 'vscode';
|
||||
import { Utils } from 'vscode-uri';
|
||||
|
@ -43,8 +42,9 @@ export class NewFilePathGenerator {
|
|||
const desiredPath = getDesiredNewFilePath(config, document, file);
|
||||
|
||||
const root = Utils.dirname(desiredPath);
|
||||
const ext = path.extname(file.name);
|
||||
const baseName = path.basename(file.name, ext);
|
||||
const ext = Utils.extname(desiredPath);
|
||||
let baseName = Utils.basename(desiredPath);
|
||||
baseName = baseName.slice(0, baseName.length - ext.length);
|
||||
for (let i = 0; ; ++i) {
|
||||
if (token.isCancellationRequested) {
|
||||
return undefined;
|
||||
|
|
Loading…
Reference in a new issue