Skip to content

Commit 4001e9d

Browse files
authored
Try to sort console history entries in recency order (microsoft#165549)
Fix microsoft#148072
1 parent c91649f commit 4001e9d

File tree

1 file changed

+3
-2
lines changed
  • src/vs/workbench/contrib/debug/browser

1 file changed

+3
-2
lines changed

src/vs/workbench/contrib/debug/browser/repl.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,13 @@ export class Repl extends FilterViewPane implements IHistoryNavigationWidget {
270270

271271
if (this.configurationService.getValue<IDebugConfiguration>('debug').console.historySuggestions) {
272272
const history = this.history.getHistory();
273-
history.forEach(h => suggestions.push({
273+
const idxLength = String(history.length).length;
274+
history.forEach((h, i) => suggestions.push({
274275
label: h,
275276
insertText: h,
276277
kind: CompletionItemKind.Text,
277278
range: computeRange(h.length),
278-
sortText: 'ZZZ'
279+
sortText: 'ZZZ' + String(history.length - i).padStart(idxLength, '0')
279280
}));
280281
}
281282

0 commit comments

Comments
 (0)