mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
parent
21431fce38
commit
882cdc0a17
|
@ -84,6 +84,7 @@ function createInsertLinkEdit(activeEditor: vscode.TextEditor, selectedFiles: vs
|
|||
insertAsImage: insertAsImage,
|
||||
placeholderText: selectionText,
|
||||
placeholderStartIndex: (i + 1) * selectedFiles.length,
|
||||
separator: insertAsImage ? '\n' : ' ',
|
||||
});
|
||||
|
||||
return snippet ? new vscode.SnippetTextEdit(selection, snippet) : undefined;
|
||||
|
|
|
@ -67,6 +67,8 @@ interface UriListSnippetOptions {
|
|||
* If `undefined`, tries to infer this from the uri.
|
||||
*/
|
||||
readonly insertAsImage?: boolean;
|
||||
|
||||
readonly separator?: string;
|
||||
}
|
||||
|
||||
export function createUriListSnippet(document: vscode.TextDocument, uris: readonly vscode.Uri[], options?: UriListSnippetOptions): vscode.SnippetString | undefined {
|
||||
|
@ -93,8 +95,8 @@ export function createUriListSnippet(document: vscode.TextDocument, uris: readon
|
|||
|
||||
snippet.appendText(`](${mdPath})`);
|
||||
|
||||
if (i <= uris.length - 1 && uris.length > 1) {
|
||||
snippet.appendText(' ');
|
||||
if (i < uris.length - 1 && uris.length > 1) {
|
||||
snippet.appendText(options?.separator ?? ' ');
|
||||
}
|
||||
});
|
||||
return snippet;
|
||||
|
|
Loading…
Reference in a new issue