File: bookmarks.lua

package info (click to toggle)
ion3-scripts 20050418-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 300 kB
  • ctags: 153
  • sloc: makefile: 18
file content (26 lines) | stat: -rw-r--r-- 477 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
-- Bookmarks support

local bms={}
bookmarks={}

function bookmarks.set(bm, frame)
    bms[bm]=frame
end

function bookmarks.goto(bm)
    if bms[bm] then
        bms[bm]:goto()
    end
end


for k=0, 9 do
    local bm=tostring(k)
    global_bindings{submap(DEFAULT_MOD.."comma", {
        kpress(bm, function() bookmarks.goto(bm) end),
    })}
    genframe_bindings{submap(DEFAULT_MOD.."period", {
        kpress(bm, function(frame) bookmarks.set(bm, frame) end),
    })}
end