Skip to content

Commit

Permalink
Closes #69
Browse files Browse the repository at this point in the history
  • Loading branch information
alefragnani committed May 23, 2017
1 parent b13f84d commit f6dd524
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/Bookmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ export class Bookmark {

// no bookmark, returns empty
if (this.bookmarks.length === 0) {
resolve({});
resolve(undefined);
return;
}

// file does not exist, returns empty
if (!fs.existsSync(this.fsPath)) {
resolve({});
resolve(undefined);
return;
}

Expand Down
49 changes: 27 additions & 22 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,27 +545,31 @@ export function activate(context: vscode.ExtensionContext) {
for (let element of values) {
// let element = values[index];

// for (let indexInside = 0; indexInside < element.length; indexInside++) {
for (let elementInside of element) {
// let elementInside = element[indexInside];

if (elementInside.detail.toString().toLowerCase() === activeTextEditorPath.toLowerCase()) {
items.push(
{
label: elementInside.label,
description: elementInside.description
}
);
} else {
let itemPath = removeRootPathFrom(elementInside.detail);
items.push(
{
label: elementInside.label,
description: elementInside.description,
detail: itemPath
}
);
}
if (element) {

// for (let indexInside = 0; indexInside < element.length; indexInside++) {
for (let elementInside of element) {
// let elementInside = element[indexInside];

if (elementInside.detail.toString().toLowerCase() === activeTextEditorPath.toLowerCase()) {
items.push(
{
label: elementInside.label,
description: elementInside.description
}
);
} else {
let itemPath = removeRootPathFrom(elementInside.detail);
items.push(
{
label: elementInside.label,
description: elementInside.description,
detail: itemPath
}
);
}
}

}

}
Expand Down Expand Up @@ -622,7 +626,8 @@ export function activate(context: vscode.ExtensionContext) {
} else {
let uriDocument: vscode.Uri = vscode.Uri.file(filePath);
vscode.workspace.openTextDocument(uriDocument).then(doc => {
vscode.window.showTextDocument(doc, undefined, true).then(editor => {
// vscode.window.showTextDocument(doc, undefined, true).then(editor => {
vscode.window.showTextDocument(doc, {preserveFocus: true, preview: true}).then(editor => {
revealLine(parseInt(item.label, 10) - 1);
});
});
Expand Down

0 comments on commit f6dd524

Please sign in to comment.