1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-22 19:27:42 +00:00

transition tot kernel

This commit is contained in:
kepler155c@gmail.com
2018-01-11 20:53:32 -05:00
parent d224f5df25
commit fc8d44b60d
19 changed files with 425 additions and 366 deletions

View File

@@ -2,6 +2,7 @@ _G.requireInjector()
local Util = require('util')
local kernel = _G.kernel
local keyboard = _G.device.keyboard
local multishell = _ENV.multishell
@@ -16,11 +17,10 @@ end)
-- restart tab
keyboard.addHotkey('control-backspace', function()
local tabs = multishell.getTabs()
local tabId = multishell.getFocus()
local tab = tabs[tabId]
local uid = multishell.getFocus()
local tab = kernel.find(uid)
if not tab.isOverview then
multishell.terminate(tabId)
multishell.terminate(uid)
tab = Util.shallowCopy(tab)
tab.isDead = false
tab.focused = true
@@ -35,7 +35,7 @@ keyboard.addHotkey('control-tab', function()
local currentTabId = multishell.getFocus()
local function compareTab(a, b)
return a.tabId < b.tabId
return a.uid < b.uid
end
for _,tab in Util.spairs(tabs, compareTab) do
if not tab.hidden then
@@ -44,14 +44,14 @@ keyboard.addHotkey('control-tab', function()
end
for k,tab in ipairs(visibleTabs) do
if tab.tabId == currentTabId then
if tab.uid == currentTabId then
if k < #visibleTabs then
multishell.setFocus(visibleTabs[k + 1].tabId)
multishell.setFocus(visibleTabs[k + 1].uid)
return
end
end
end
if #visibleTabs > 0 then
multishell.setFocus(visibleTabs[1].tabId)
multishell.setFocus(visibleTabs[1].uid)
end
end)