add switch-to-buffer command
This commit is contained in:
parent
69d8aa4131
commit
daa244c0b3
@ -39,4 +39,8 @@
|
||||
:match (fn [s] (collect [name buffer (pairs buffers)]
|
||||
(if (string.find name s)
|
||||
(values name buffer))))
|
||||
:next (fn [buffer]
|
||||
(let [n (or (next buffers buffer.name) (next buffers))]
|
||||
(. buffers n)))
|
||||
|
||||
})
|
||||
|
@ -22,6 +22,15 @@
|
||||
[]
|
||||
#(Gtk.main_quit))
|
||||
|
||||
(define-command
|
||||
"switch-to-buffer"
|
||||
[[:buffer
|
||||
Buffer.match
|
||||
#(. (Buffer.next $1.buffer) :name)]
|
||||
]
|
||||
(fn [{:frame frame :buffer buffer}]
|
||||
(frame:show-buffer buffer)))
|
||||
|
||||
(define-command
|
||||
"visit-location"
|
||||
[[:buffer
|
||||
|
@ -12,8 +12,9 @@
|
||||
"g" ["visit-location" {:buffer #$1.buffer }]
|
||||
"M-q" ["quit-browser" {}]
|
||||
"C-x" {
|
||||
"C-c" ["quit-browser" {}]
|
||||
}
|
||||
"C-c" ["quit-browser" {}]
|
||||
"b" ["switch-to-buffer" {}]
|
||||
}
|
||||
})
|
||||
|
||||
(let [f (Frame.new my-keymap)
|
||||
|
Loading…
Reference in New Issue
Block a user