提交 1ea7ce1c 编写于 作者: B Benjamin Pasero

focusFirst/focusLast for list

上级 3dfcf32f
......@@ -210,8 +210,15 @@ export function registerCommands(): void {
const listService = accessor.get(IListService);
const focused = listService.getFocused();
// Tree only
if (!(focused instanceof List)) {
// List
if (focused instanceof List) {
const list = focused;
list.setFocus([0]);
}
// Tree
else if (focused) {
const tree = focused;
tree.focusFirst({ origin: 'keyboard' });
......@@ -229,8 +236,15 @@ export function registerCommands(): void {
const listService = accessor.get(IListService);
const focused = listService.getFocused();
// Tree only
if (!(focused instanceof List)) {
// List
if (focused instanceof List) {
const list = focused;
list.setFocus([list.length - 1]);
}
// Tree
else if (focused) {
const tree = focused;
tree.focusLast({ origin: 'keyboard' });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册