Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 42 lines (35 sloc) 0.901 kb
400bf98 @BurntSushi Massive reorganization. Global wingo state is now in the 'wm' package, a...
authored
1 package main
2
3 import (
4 "fmt"
5
6 "github.com/BurntSushi/wingo/commands"
7 "github.com/BurntSushi/wingo/wm"
8 )
9
10 func newHacks() wm.CommandHacks {
11 return wm.CommandHacks{
12 MouseResizeDirection: mouseResizeDirection,
13 CycleClientRunWithKeyStr: cycleClientRunWithKeyStr,
14 }
15 }
16
4ffaa84 @BurntSushi A lot more progress. Commands are now by default run in their own gorout...
authored
17 func mouseResizeDirection(cmdStr string) (string, error) {
18 cmd, err := commands.Env.Command(cmdStr)
19 if err != nil {
20 return "", err
21 }
22 return cmd.(*commands.MouseResize).Direction, nil
400bf98 @BurntSushi Massive reorganization. Global wingo state is now in the 'wm' package, a...
authored
23 }
24
4ffaa84 @BurntSushi A lot more progress. Commands are now by default run in their own gorout...
authored
25 func cycleClientRunWithKeyStr(keyStr, cmdStr string) (func(), error) {
400bf98 @BurntSushi Massive reorganization. Global wingo state is now in the 'wm' package, a...
authored
26 var run func() = nil
4ffaa84 @BurntSushi A lot more progress. Commands are now by default run in their own gorout...
authored
27 cmd, err := commands.Env.Command(cmdStr)
28 if err != nil {
29 return nil, err
30 }
31
400bf98 @BurntSushi Massive reorganization. Global wingo state is now in the 'wm' package, a...
authored
32 switch t := cmd.(type) {
33 case *commands.CycleClientNext:
34 run = func() { t.RunWithKeyStr(keyStr) }
35 case *commands.CycleClientPrev:
36 run = func() { t.RunWithKeyStr(keyStr) }
37 default:
38 panic(fmt.Sprintf("bug: unknown type %T", t))
39 }
4ffaa84 @BurntSushi A lot more progress. Commands are now by default run in their own gorout...
authored
40 return run, nil
400bf98 @BurntSushi Massive reorganization. Global wingo state is now in the 'wm' package, a...
authored
41 }
Something went wrong with that request. Please try again.