glimmer-cs-gladiator 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10060190546fe60cbf5c1e130191ed12ff17ea7deee820fd9294ad59b04b8dfa
4
- data.tar.gz: f6ad081752171216f5980a1a5d9508d1c433ed9cd35cdcb5c2f5c022254376c8
3
+ metadata.gz: 62d1ccef9ac560b19d5acff7ff5513145fa26fef6f326a9e5d0679890783a0c6
4
+ data.tar.gz: f23b2e85d6158c3e1fa7b3314939042a0fc13a0a2707800ecc3233907ebc4640
5
5
  SHA512:
6
- metadata.gz: '092bcecbbcc5fa79cbc4e085546f3b37760e429369498fb24508cffacef919c0e89d1d84c3faa75fe9a38a35bfbae0fb280a273aa6d0b479134b1724145e7f6d'
7
- data.tar.gz: 50893f0dc416e754ca5e589cc82164cb6214c3b56090759bb085e4a8c61cf96c4423002a986740b923c0ffc6861eb8706fa3d44fefe7d1ca298cd179c835e242
6
+ metadata.gz: 0b46d9f5617ef754cc5b791a8e57b60581a355f6f267300dc3282c8dbe937b78adf6cfe55efb5045dd9d7c46653a5bf0cd7fb79bac6451054c588aef088a7784
7
+ data.tar.gz: b4dbe7eabd3345ce74ea585584ba5e0bf6acd6b0192289f885418cc51ef6ec5fa3ab9f98fd5223a89cd0efbe09a00974f5bf4bb3cbc4038a8f3a3ab08e86e903
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Gladiator (Glimmer Editor) 0.1.1 - Glimmer Custom Shell
1
+ # Gladiator (Glimmer Editor) 0.1.2 - Glimmer Custom Shell
2
2
  [![Gem Version](https://badge.fury.io/rb/glimmer-cs-gladiator.svg)](http://badge.fury.io/rb/glimmer-cs-gladiator)
3
3
 
4
4
  ![Gladiator](images/glimmer-gladiator.png)
@@ -17,6 +17,7 @@ Gladiator currently supports the following text editing features:
17
17
  - Remember last opened file, caret position, and top line
18
18
  - Autosave on focus out/quit/open new file
19
19
  - Watch open file for external changes to reflect in editor
20
+ - Watch subdirectories for changes to reflect in file explorer/file lookup
20
21
  - Duplicate Line(s)
21
22
  - Kill Line(s)
22
23
  - Move up one line
@@ -49,7 +50,7 @@ To reuse Gladiator as a Glimmer Custom Shell inside another Glimmer application,
49
50
  following to the application's `Gemfile`:
50
51
 
51
52
  ```
52
- gem 'glimmer-cs-gladiator', '0.1.1'
53
+ gem 'glimmer-cs-gladiator', '0.1.2'
53
54
  ```
54
55
 
55
56
  Run:
@@ -26,7 +26,8 @@ module Glimmer
26
26
  end
27
27
  observe(self, :line_number) do
28
28
  if line_number
29
- new_caret_position = lines[0...(line_number.to_i - 1)].map(&:size).sum + line_number.to_i - 1
29
+ line_index = line_number - 1
30
+ new_caret_position = caret_position_for_line_index(line_index)
30
31
  self.caret_position = new_caret_position unless line_index_for_caret_position(new_caret_position) == line_index_for_caret_position(caret_position)
31
32
  end
32
33
  end
@@ -318,7 +319,9 @@ module Glimmer
318
319
  end
319
320
 
320
321
  def caret_position_for_line_index(line_index)
321
- lines[0...line_index].join("\n").size + 1
322
+ cp = lines[0...line_index].join("\n").size
323
+ cp += 1 if line_index > 0
324
+ cp
322
325
  end
323
326
 
324
327
  def caret_position_for_caret_position_start_of_line(caret_position)
@@ -55,6 +55,9 @@ module Glimmer
55
55
  ## Uncomment after_body block to setup observers for widgets in body
56
56
  #
57
57
  after_body {
58
+ observe(Gladiator::Dir.local_dir, 'selected_child') do
59
+ @field_container.swt_widget.pack
60
+ end
58
61
  observe(Gladiator::Dir.local_dir, 'selected_child.line_numbers_content') do
59
62
  if @last_line_numbers_content != Gladiator::Dir.local_dir.selected_child.line_numbers_content
60
63
  body_root.pack_same_size
@@ -134,7 +137,7 @@ module Glimmer
134
137
  }
135
138
  on_key_pressed { |key_event|
136
139
  if Glimmer::SWT::SWTProxy.include?(key_event.keyCode, :cr) || Glimmer::SWT::SWTProxy.include?(key_event.keyCode, :lf)
137
- Gladiator::Dir.local_dir.selected_child_path = @tree.swt_widget.getSelection.first.getText
140
+ Gladiator::Dir.local_dir.selected_child_path = @tree.swt_widget.getSelection&.first&.getText
138
141
  @text.swt_widget.setFocus
139
142
  end
140
143
  }
@@ -150,7 +153,7 @@ module Glimmer
150
153
  composite {
151
154
  grid_layout 1, false
152
155
  layout_data :fill, :fill, true, true
153
- composite {
156
+ @field_container = composite {
154
157
  grid_layout 2, false
155
158
  @file_path_label = styled_text(:none) {
156
159
  layout_data(:fill, :fill, true, false) {
@@ -175,7 +178,7 @@ module Glimmer
175
178
  minimum_width 300
176
179
  }
177
180
  text bind(Gladiator::Dir.local_dir, 'selected_child.line_number', on_read: :to_s, on_write: :to_i)
178
- on_key_pressed { |key_event|
181
+ on_key_pressed { |key_event|
179
182
  if key_event.keyCode == swt(:cr)
180
183
  @text.swt_widget.setFocus
181
184
  end
@@ -186,10 +189,10 @@ module Glimmer
186
189
  }
187
190
  @find_text = text {
188
191
  layout_data(:fill, :fill, true, false) {
189
- minimum_width 200
192
+ minimum_width 300
190
193
  }
191
194
  text bind(Gladiator::Dir.local_dir, 'selected_child.find_text')
192
- on_key_pressed { |key_event|
195
+ on_key_pressed { |key_event|
193
196
  if key_event.keyCode == swt(:cr)
194
197
  Gladiator::Dir.local_dir.selected_child.find_next
195
198
  elsif key_event.keyCode == swt(:esc)
@@ -202,13 +205,13 @@ module Glimmer
202
205
  }
203
206
  @replace_text = text {
204
207
  layout_data(:fill, :fill, true, false) {
205
- minimum_width 200
208
+ minimum_width 300
206
209
  }
207
210
  text bind(Gladiator::Dir.local_dir, 'selected_child.replace_text')
208
211
  on_focus_gained {
209
212
  Gladiator::Dir.local_dir.selected_child.ensure_find_next
210
213
  }
211
- on_key_pressed { |key_event|
214
+ on_key_pressed { |key_event|
212
215
  if key_event.keyCode == swt(:cr)
213
216
  Gladiator::Dir.local_dir.selected_child.replace_next!
214
217
  elsif key_event.keyCode == swt(:esc)
metadata CHANGED
@@ -1,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-cs-gladiator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-11 00:00:00.000000000 Z
11
+ date: 2020-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 0.7.0
18
+ version: 0.7.2
19
19
  name: glimmer
20
20
  type: :runtime
21
21
  prerelease: false
@@ -23,7 +23,7 @@ dependencies:
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.7.0
26
+ version: 0.7.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements: