xtabbedwindow 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f782f9fd6864e703d60e1faed74244e2a64c4c47b7f8e31c1dc5df846ba5998
4
- data.tar.gz: 9f04fb5929e23d077b9497e134ab7631665a7252004e44c309d1ed5762c01739
3
+ metadata.gz: 74d5a290405adfb95f058e3d2402c8e8340da60ae8e3c96a694eb157ecd70e9d
4
+ data.tar.gz: 05f397721e4a8cb5e6b9387fc030dddad891f161d6a88c72e6b3d323ea000d77
5
5
  SHA512:
6
- metadata.gz: 1f991f22a68db96f21083e476c48deb868c4275e08e3e277f75a6788a44b1b0b747ce999fcef72bf77819ec3fd47de1a05b3f7f2ecef8b7fc4b28420944a51ff
7
- data.tar.gz: 5ed5c6e5af4c80e154ea15921f0ceacfd5381cdd8b1db2a90b1ac49dc36038e680def0f0a029458d0e46e7c97a7c1fd34cb0daeaa016eb517eb196d13cc8d000
6
+ metadata.gz: 644e1b8fc7d95a85d3270dab77d3e1dddb7c35a1259d54c3121bbf79389773137a6ad021334271a8f386719708a8960171c418e0074739fd84682221afe9f88a
7
+ data.tar.gz: 1346fead1d70744cca4f2be978f8f23dc2bb883ed8c45a88213c5698602c7dc7ee41c063dcce2c342e45f3bd0a652fe994a410b7b60f611365d0bee99cee0d0b
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/xtabbedwindow.rb CHANGED
@@ -14,9 +14,9 @@ class XTabbedWindow
14
14
  # next_tab values e.g. Ctrl+Tab (default), Ctrl+Alt+Page_Up
15
15
  #
16
16
  def initialize(name, new_tab: "Ctrl+t", scan_tabs: true,
17
- next_tab: "Ctrl+Tab")
17
+ next_tab: "Ctrl+Tab", location_key: 'Ctrl+l')
18
18
 
19
- @new_tab, @next_tab = new_tab, next_tab
19
+ @new_tab, @next_tab, @location_key = new_tab, next_tab, location_key
20
20
  a = WMCtrl.instance.windows
21
21
  @window = a.detect {|x| x.title =~ /#{name}/i}
22
22
 
@@ -45,18 +45,29 @@ class XTabbedWindow
45
45
  r = a.grep(regex)
46
46
  end
47
47
 
48
- return if r.empty?
48
+ if r.empty? then
49
+
50
+ new_tab()
51
+
52
+ # open the document
53
+ XDo::Keyboard.char(@location_key)
54
+
55
+ block_given? ? yield : return
56
+
57
+ else
49
58
 
50
- i = a.index(r.first)
59
+ i = a.index(r.first)
51
60
 
52
- @window.activate
53
- sleep 0.1
61
+ @window.activate
62
+ sleep 0.1
54
63
 
55
- XDo::Keyboard.char("Alt+1")
56
- sleep 0.1
57
- i.times { XDo::Keyboard.char(@next_tab) }
64
+ XDo::Keyboard.char("Alt+1")
65
+ sleep 0.1
66
+ i.times { XDo::Keyboard.char(@next_tab) }
67
+
68
+ true
58
69
 
59
- true
70
+ end
60
71
 
61
72
  end
62
73
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xtabbedwindow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file