glimmer-cs-gladiator 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +212 -0
- data/README.md +8 -2
- data/VERSION +1 -1
- data/glimmer-cs-gladiator.gemspec +70 -0
- data/images/glimmer-cs-gladiator-logo.png +0 -0
- data/lib/models/glimmer/gladiator/file.rb +7 -2
- data/lib/views/glimmer/gladiator.rb +76 -16
- metadata +12 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6141168268f00d2c6e7b06ccef409787252f3f71bc38cfe8fda0622618d6f981
|
4
|
+
data.tar.gz: 8a0aaab8d2f7b33cc5e7dae98ebc18988baf9be2b27aa2ab1a449f1c14465802
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4f62df8c478aa25eb0ba23f901324ab65069e602867702d3e2e94356d0bb4a42438d12a72b464aad06bb1a531b150fed6a3a90250f4140ae8f28916cc230816
|
7
|
+
data.tar.gz: 56d8bf8c995534c5f46ddc1baaa761eb5d532ed6ccf194a306ac343e2785dd3e82aa69bb2a0683afafd156692120e004d4a92c7f6c67d5addb2f163a3b5e6777
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,212 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
## 0.6.3
|
4
|
+
|
5
|
+
- Display Gladiator version in window title
|
6
|
+
- Set Gladiator icon on window
|
7
|
+
- Fix issue with wording getting reversed when typing at the end of the file
|
8
|
+
- Fix issue with not being able to add new lines at the end of the file
|
9
|
+
- Fix issue with moving lines down at the end of the file making selection go out of wack
|
10
|
+
- Fix issue with Find keyboard shortcut causing a delay before landing in the Find text field
|
11
|
+
- Fix transient issue of find_next not jumping properly after replacing a term near the end of the line
|
12
|
+
- Fix issue with layout upon split
|
13
|
+
- Fix issue with layout upon opening a new tab
|
14
|
+
- Fix issue with splitting a file showing in both panes and then unsplitting afterwards detaching data-binding
|
15
|
+
- Fix issue with losing changes on exit if I do not focus out on a file
|
16
|
+
|
17
|
+
## 0.6.2
|
18
|
+
|
19
|
+
- Speed up startup time by not truly opening all files beyond showing their tab (till navigated to)
|
20
|
+
- Made CMD+F and CMD+L expand navigation section if collapsed
|
21
|
+
- Made CMD+R expand file lookup section if collapsed
|
22
|
+
- Made CMD+T expand file explorer section if collapsed
|
23
|
+
- Fix this issue: Type till the end of the line. Hit CMD+SHIFT+ENTER to jump to the previous line while inserting a line. It jumps to the next line instead as if I did CMD+ENTER
|
24
|
+
- Fix issue with closing a project shell with an x mouse click requiring multiple presses for every tab open
|
25
|
+
- Fix issue with inserting new line via CMD+ENTER not maintaining indentation
|
26
|
+
|
27
|
+
## 0.6.1
|
28
|
+
|
29
|
+
- Fixed issue relating to not recording text selection correctly when done by mouse
|
30
|
+
|
31
|
+
## 0.6.0
|
32
|
+
|
33
|
+
- Collapsable File Lookup/File Explorer/Navigation Expand Bars
|
34
|
+
- Improve Undo/Redo support by making it work for simple text editing
|
35
|
+
- Clear Undo/Redo history for a file upon closing
|
36
|
+
- Fix issue with the text editor caret dancing uncontrollably
|
37
|
+
- Fix issue with quickly moving multiple lines up or down sometimes splintering and losing multi-line selection
|
38
|
+
|
39
|
+
## 0.5.4
|
40
|
+
|
41
|
+
- CMD+SHIFT+O now splits the Text Editor without requiring Drag & Drop
|
42
|
+
- Close open files when deleting their parent directory
|
43
|
+
- Make rename refocus on the file renamed in the tree if different from the file being edited
|
44
|
+
- Save/Load Config for the Split Orientation
|
45
|
+
- Right aligned line numbers in Scratchpad and new files
|
46
|
+
- Show a friendly progress message when opening last open files
|
47
|
+
- Use SashForm for container/separator of File Lookup List and File Explorer Tree, making them resizable
|
48
|
+
- Enhance startup performance by only loading content of last open files
|
49
|
+
- Avoid extra writes to open files when no changes occurred
|
50
|
+
- Upgrade to glimmer-dsl-swt gem v4.17.10.1
|
51
|
+
- Upgrade to clipboard gem v1.3.5
|
52
|
+
- Fix issue with over-refreshing directories on focus out and back in
|
53
|
+
- Fix glitches with certain single line file operations causing unnecessary text editor scroll jitter
|
54
|
+
- Fix issue with creating directories not allowing save/rename
|
55
|
+
- Fix issue with crashing when closing a file and then trying to delete another file from the tree (might happen if you try to rename closed file) says getData returned nil
|
56
|
+
- Fix issue with line numbers not lining up perfectly with code/text lines in non-ruby files
|
57
|
+
|
58
|
+
## 0.5.3
|
59
|
+
|
60
|
+
- Upgraded to glimmer-dsl-swt v4.17.8.3, with performance optimizations for `code_text`
|
61
|
+
|
62
|
+
## 0.5.2
|
63
|
+
|
64
|
+
- Fix issue with file/directory rename not working
|
65
|
+
- Fix issue with not renaming tab text when renaming file
|
66
|
+
- Fix issue with not closing tab when deleting file
|
67
|
+
|
68
|
+
## 0.5.1
|
69
|
+
|
70
|
+
- Fixed a Windows issue with opening Ruby styled text editors
|
71
|
+
|
72
|
+
## 0.5.0
|
73
|
+
|
74
|
+
- File Menu to allow Opening a Project
|
75
|
+
- Scratchpad for running any Ruby/Glimmer code for experimentation/debugging/instrumenting
|
76
|
+
- CTRL+A and CTRL+E shortcuts for beginning of line and end of line
|
77
|
+
- Minor performance optimization by not syntax highlighting file line numbers (using standard uniform foreground coloring)
|
78
|
+
- Fix issue with going back to top of file when CMD+Tabbing to another app (losing focus) and then coming back (gaining focus)
|
79
|
+
- Fix tree slow refresh and lost refreshes on directory file changes
|
80
|
+
- Fix scroll jitter on move line up/down
|
81
|
+
- Fix issue with opening the last file open on both sides of split text editor upon launching Gladiator
|
82
|
+
- Fix issue with producing extra space at the end of some lines
|
83
|
+
- Fix issue with CMD+4 not working for jumping to the 4th tab
|
84
|
+
- Fix issue with keyboard shortcuts triggered in multiple projects
|
85
|
+
|
86
|
+
## 0.4.1
|
87
|
+
|
88
|
+
- Do not enable Ruby syntax highlighting in non-Ruby files
|
89
|
+
|
90
|
+
## 0.4.0
|
91
|
+
|
92
|
+
- Syntax highlighting
|
93
|
+
- Run menu with current file menu item
|
94
|
+
- View menu with Split Horizontal/Vertical
|
95
|
+
- Change split orientation with CMD+SHIFT+O shortcut
|
96
|
+
- Run current file shortcut CMD+SHIFT+R
|
97
|
+
- Fix issue with line numbers not scrolling perfectly along with open file (off by a few pixels)
|
98
|
+
- Fix select-all with code_text
|
99
|
+
- Fix tab with code_text
|
100
|
+
- Fix caret position after tab with code_text
|
101
|
+
- Fix issue with ENTER key not putting caret parallel to previous line start
|
102
|
+
- Fix issue with jumping to bottom when doing CMD+] or [ for indent
|
103
|
+
- Fix multi-line operations/post-selection with code_text (e.g. comment/uncomment, indent right or left)
|
104
|
+
- Fix issue with jumping one line up or down when doing CMD+] or [ for indent
|
105
|
+
- Fix CMD+ENTER and CMD+SHIFT+ENTER with code_text
|
106
|
+
- Fix Move Line Up or Move Line Down with code_text
|
107
|
+
- Fix jumping across pages of code on Find Next with code_text (it stays in the same page)
|
108
|
+
- Fix issue with jumping back to beginning of file upon very quick indent/outdent
|
109
|
+
|
110
|
+
## 0.3.1
|
111
|
+
|
112
|
+
- Fixed issue with Find/Replace revisiting the same word after Replace, making it jump to the next one.
|
113
|
+
- Add 'vendor' to ignore paths
|
114
|
+
|
115
|
+
## 0.3.0
|
116
|
+
|
117
|
+
- Support Ignore Paths ('packges' and 'tmp' by default) to avoid slowing down editor with irrelevant files
|
118
|
+
- Upgrade support to glimmer-dsl-swt 4.17.2.0 up to 5.0.0.0
|
119
|
+
|
120
|
+
## 0.2.4
|
121
|
+
|
122
|
+
- Remember split windows on restart
|
123
|
+
- Fix issue with not being able to rename file by hitting ENTER
|
124
|
+
|
125
|
+
## 0.2.3
|
126
|
+
|
127
|
+
- Improved performance of file lookup list and display of directories (removing current local directory from file prefix)
|
128
|
+
|
129
|
+
## 0.2.2
|
130
|
+
|
131
|
+
- Upgraded to glimmer-dsl-swt 0.4.0
|
132
|
+
|
133
|
+
## 0.2.1
|
134
|
+
|
135
|
+
- Drag and Drop Text Editor Split Screen Support (drag from tree or file lookup list)
|
136
|
+
- Fix issue with not rendering list and tree sometimes upon opening a small file like VERSION
|
137
|
+
|
138
|
+
## 0.2.0
|
139
|
+
|
140
|
+
- Upgraded to glimmer 0.9.1 / glimmer-dsl-swt 0.1.0
|
141
|
+
- Fixed unopen-file related bugs
|
142
|
+
|
143
|
+
## 0.1.8
|
144
|
+
|
145
|
+
- Undo/Redo
|
146
|
+
- Case-sensitive Find (and Replace by extension)
|
147
|
+
- Make CMD+SHIFT+] at the last tab go to the first tab (and vice versa with CMD+SHIFT+[)
|
148
|
+
- Fix Line/Find/Replace actions when no file is open (to avoid crash)
|
149
|
+
- Fix issue with file lookup list expanding all the way down, covering the file tree
|
150
|
+
- Fix issue with hitting home/end with selection keeping selection instead of removing it
|
151
|
+
- Fix issue with crashing if no file was open, no file is found in lookup list, and you attempt to hit enter in keyboard
|
152
|
+
|
153
|
+
## 0.1.7
|
154
|
+
|
155
|
+
- Relaxed Glimmer version requirement
|
156
|
+
|
157
|
+
## 0.1.6
|
158
|
+
|
159
|
+
- Support Linux explicitly (sort of)
|
160
|
+
- Make file tree maintain expansion state on refreshes caused by internal & external changes
|
161
|
+
|
162
|
+
## 0.1.5
|
163
|
+
|
164
|
+
- Remember all open text editor tabs when closing and reopening
|
165
|
+
- Support closing text editor tabs with keyboard shortcuts (closing current tab, closing all tabs other than current one, closing all tabs)
|
166
|
+
- Support prefix new indented line when hitting CMD+SHIFT+ENTER in the middle of a line
|
167
|
+
- Make CMD+T auto-select open file in file tree
|
168
|
+
- Make gladiator command accept directory argument instead of LOCAL_DIR and automatically open directory passed in
|
169
|
+
- Fix rename bug for when focusing out without changing name
|
170
|
+
- Fix bug with opening file with ENTER key from file tree
|
171
|
+
- Fix issue with changes not persisting when done via find/replace on a newly browsed to tab
|
172
|
+
|
173
|
+
## 0.1.4
|
174
|
+
|
175
|
+
- Fix issue with file explorer tree losing selection on refresh
|
176
|
+
- Fix file explorer opening of files on every selection change instead of just hitting ENTER or mouse click
|
177
|
+
- Fix issue with refreshing the tree on every tab switch after making changes (make it check if change is coming from any of all tabs)
|
178
|
+
- Fix issue with top index not being set from config
|
179
|
+
- Make file explorer tree show file/directory names not paths
|
180
|
+
- Make file explorer tree show current project directory name as the root instead of "."
|
181
|
+
- Make file explorer shortcut auto-reveal open file in file explorer tree
|
182
|
+
- Make hitting ESC button in line number field, file lookup field, find field, or replace field go back to open file to the same caret position as before
|
183
|
+
- Make hitting ESC button in file explorer go back to open file to the same caret position as before and reselect it
|
184
|
+
- Improve file lookup by ignoring dots
|
185
|
+
- Add number command + 2-8 tab shortcuts
|
186
|
+
- Add a new file through File Explorer
|
187
|
+
- Add a new directory through File Explorer
|
188
|
+
- Delete a file or directory through File Explorer
|
189
|
+
- Support auto-indent on hitting ENTER to add a new line
|
190
|
+
- Support insert new indented line when hitting CMD+ENTER in the middle of a line
|
191
|
+
|
192
|
+
## 0.1.3
|
193
|
+
|
194
|
+
- Fix issue with selection getting out of wack when moving a group of lines up or down
|
195
|
+
- Fix issue with Find not working for more than one occurrence in a line
|
196
|
+
- Fix issue with kill line sometimes jumping to the next line afterwards. Seems to happen if following line is empty
|
197
|
+
- Fix issue with line numbers sometimes getting clipped when openig a new file until resizing window
|
198
|
+
- Support multiple tabs
|
199
|
+
- Support tab keyboard shortcuts for next tab, previous tab, first tab, last tab
|
200
|
+
- Remember window size and location
|
201
|
+
|
202
|
+
## 0.1.2
|
203
|
+
|
204
|
+
- Fix issue with file name on top being clipped
|
205
|
+
- Fix issue with Find/Replace not working correctly for first line in the file (being off by one character)
|
206
|
+
|
207
|
+
## 0.1.1
|
208
|
+
|
209
|
+
- Fix issue with tab button killing selection (make it indent instead)
|
210
|
+
- Fix issue with crashing upon permission denied for opening a file
|
211
|
+
- Fix issue with storing .gladiator in running directory instead of LOCAL_DIR when specified
|
212
|
+
- Make entering the file lookup list automatically highlight the first element
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# <img src='https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-cs-gladiator-logo.svg' height=85 /> Gladiator 0.6.
|
1
|
+
# <img src='https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-cs-gladiator-logo.svg' height=85 /> Gladiator 0.6.3 - [Ugliest Text Editor Ever](https://www.reddit.com/r/ruby/comments/hgve8k/gladiator_glimmer_editor_ugliest_text_editor_ever/)
|
2
2
|
## [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=40 /> Glimmer Custom Shell](https://github.com/AndyObtiva/glimmer-dsl-swt#custom-shell-gem)
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/glimmer-cs-gladiator.svg)](http://badge.fury.io/rb/glimmer-cs-gladiator)
|
4
4
|
|
@@ -76,6 +76,8 @@ Gladiator currently supports the following text editing features (including keyb
|
|
76
76
|
|
77
77
|
## Setup Instructions
|
78
78
|
|
79
|
+
Note: if you encounter any issues, check if they are documented in [TODO.md](TODO.md), [issues](https://github.com/AndyObtiva/glimmer-cs-gladiator/issues), or [pull requests](https://github.com/AndyObtiva/glimmer-cs-gladiator/pulls) as they might be on my radar to fix. Otherwise, please report as an [issue](https://github.com/AndyObtiva/glimmer-cs-gladiator/issues) or better yet fix and submit a [pull request](https://github.com/AndyObtiva/glimmer-cs-gladiator/pulls).
|
80
|
+
|
79
81
|
Install Gladiator gem by running (`jgem`, `jruby -S gem`, or `gem` directly if you have [RVM](https://rvm.io/)):
|
80
82
|
|
81
83
|
```
|
@@ -136,7 +138,7 @@ To reuse Gladiator as a Glimmer Custom Shell inside another Glimmer application,
|
|
136
138
|
following to the application's `Gemfile`:
|
137
139
|
|
138
140
|
```
|
139
|
-
gem 'glimmer-cs-gladiator', '
|
141
|
+
gem 'glimmer-cs-gladiator', '>= 0.6.3'
|
140
142
|
```
|
141
143
|
|
142
144
|
Run:
|
@@ -182,6 +184,10 @@ The signal TERM is in use by the JVM and will not work correctly on this platfor
|
|
182
184
|
|
183
185
|
[TODO.md](TODO.md)
|
184
186
|
|
187
|
+
## Change Log
|
188
|
+
|
189
|
+
[CHANGELOG.md](CHANGELOG.md)
|
190
|
+
|
185
191
|
## Contributing to glimmer-cs-gladiator
|
186
192
|
|
187
193
|
- Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.3
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: glimmer-cs-gladiator 0.6.3 ruby lib
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = "glimmer-cs-gladiator".freeze
|
9
|
+
s.version = "0.6.3"
|
10
|
+
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib".freeze]
|
13
|
+
s.authors = ["Andy Maleh".freeze]
|
14
|
+
s.date = "2020-12-29"
|
15
|
+
s.description = "Gladiator (short for Glimmer Editor) is a Glimmer sample project under on-going development. It is not intended to be a full-fledged editor by any means, yet mostly a fun educational exercise in using Glimmer to build a text editor. Gladiator is also a personal tool for shaping an editor exactly the way I like. I leave building truly professional text editors to software tooling experts who would hopefully use Glimmer one day.".freeze
|
16
|
+
s.email = "andy.am@gmail.com".freeze
|
17
|
+
s.executables = ["gladiator".freeze]
|
18
|
+
s.extra_rdoc_files = [
|
19
|
+
"LICENSE.txt",
|
20
|
+
"README.md"
|
21
|
+
]
|
22
|
+
s.files = [
|
23
|
+
"CHANGELOG.md",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.md",
|
26
|
+
"VERSION",
|
27
|
+
"bin/gladiator",
|
28
|
+
"bin/gladiator_runner.rb",
|
29
|
+
"glimmer-cs-gladiator.gemspec",
|
30
|
+
"images/glimmer-cs-gladiator-logo.png",
|
31
|
+
"lib/glimmer-cs-gladiator.rb",
|
32
|
+
"lib/models/glimmer/gladiator/command.rb",
|
33
|
+
"lib/models/glimmer/gladiator/dir.rb",
|
34
|
+
"lib/models/glimmer/gladiator/file.rb",
|
35
|
+
"lib/views/glimmer/gladiator.rb",
|
36
|
+
"lib/views/glimmer/gladiator/text_editor.rb"
|
37
|
+
]
|
38
|
+
s.homepage = "http://github.com/AndyObtiva/glimmer-cs-gladiator".freeze
|
39
|
+
s.licenses = ["MIT".freeze]
|
40
|
+
s.rubygems_version = "3.0.6".freeze
|
41
|
+
s.summary = "Gladiator (Glimmer Editor) - Glimmer Custom Shell".freeze
|
42
|
+
|
43
|
+
if s.respond_to? :specification_version then
|
44
|
+
s.specification_version = 4
|
45
|
+
|
46
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
47
|
+
s.add_runtime_dependency(%q<glimmer-dsl-swt>.freeze, [">= 4.17.10.3", "< 5.0.0.0"])
|
48
|
+
s.add_runtime_dependency(%q<filewatcher>.freeze, ["~> 1.1.1"])
|
49
|
+
s.add_runtime_dependency(%q<clipboard>.freeze, ["~> 1.3.5"])
|
50
|
+
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
|
51
|
+
s.add_development_dependency(%q<jeweler>.freeze, ["= 2.3.9"])
|
52
|
+
s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
|
53
|
+
else
|
54
|
+
s.add_dependency(%q<glimmer-dsl-swt>.freeze, [">= 4.17.10.3", "< 5.0.0.0"])
|
55
|
+
s.add_dependency(%q<filewatcher>.freeze, ["~> 1.1.1"])
|
56
|
+
s.add_dependency(%q<clipboard>.freeze, ["~> 1.3.5"])
|
57
|
+
s.add_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
|
58
|
+
s.add_dependency(%q<jeweler>.freeze, ["= 2.3.9"])
|
59
|
+
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
60
|
+
end
|
61
|
+
else
|
62
|
+
s.add_dependency(%q<glimmer-dsl-swt>.freeze, [">= 4.17.10.3", "< 5.0.0.0"])
|
63
|
+
s.add_dependency(%q<filewatcher>.freeze, ["~> 1.1.1"])
|
64
|
+
s.add_dependency(%q<clipboard>.freeze, ["~> 1.3.5"])
|
65
|
+
s.add_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
|
66
|
+
s.add_dependency(%q<jeweler>.freeze, ["= 2.3.9"])
|
67
|
+
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
Binary file
|
@@ -519,13 +519,18 @@ module Glimmer
|
|
519
519
|
write_dirty_content
|
520
520
|
load path
|
521
521
|
end
|
522
|
-
rescue SyntaxError, StandardError => e
|
522
|
+
rescue LoadError, SyntaxError, StandardError => e
|
523
|
+
# TODO consider showing a message dialog or error message console in the future
|
523
524
|
puts e.full_message
|
524
525
|
end
|
525
526
|
end
|
526
527
|
|
527
528
|
def lines
|
528
|
-
dirty_content.
|
529
|
+
need_padding = dirty_content.to_s.end_with?("\n")
|
530
|
+
splittable_content = need_padding ? "#{dirty_content} " : dirty_content
|
531
|
+
the_lines = splittable_content.split("\n")
|
532
|
+
the_lines[-1] = the_lines[-1].strip if need_padding
|
533
|
+
the_lines
|
529
534
|
end
|
530
535
|
|
531
536
|
def line_for_caret_position(caret_position)
|
@@ -18,6 +18,9 @@ module Glimmer
|
|
18
18
|
APP_ROOT = ::File.expand_path('../../../..', __FILE__)
|
19
19
|
# TODO make sure COMMAND_KEY doesn't clash on Linux/Windows for CMD+CTRL shortcuts
|
20
20
|
COMMAND_KEY = OS.mac? ? :command : :ctrl
|
21
|
+
VERSION = ::File.read(::File.join(APP_ROOT, 'VERSION')).to_s.strip
|
22
|
+
LICENSE = ::File.read(::File.join(APP_ROOT, 'LICENSE.txt')).to_s.strip
|
23
|
+
ICON = ::File.expand_path(::File.join(APP_ROOT, 'images', 'glimmer-cs-gladiator-logo.png'))
|
21
24
|
|
22
25
|
class << self
|
23
26
|
attr_accessor :drag_and_drop
|
@@ -63,17 +66,25 @@ module Glimmer
|
|
63
66
|
before_body {
|
64
67
|
# TODO consider doing loading project files after displaying the GUI instead of holding it up before
|
65
68
|
project_dir #pre-initialize directory
|
66
|
-
at_exit do
|
69
|
+
TOPLEVEL_BINDING.receiver.send(:at_exit) do
|
67
70
|
project_dir.selected_child&.write_raw_dirty_content
|
68
71
|
end
|
69
72
|
Display.setAppName('Gladiator')
|
70
73
|
# make sure the display events are only hooked once if multiple gladiators are created
|
71
74
|
unless defined?(@@display)
|
72
75
|
@@display = display {
|
76
|
+
# TODO look into why a weird java dialog comes up on about (maybe a non-issue once packaged)
|
77
|
+
on_about {
|
78
|
+
display_about_dialog
|
79
|
+
}
|
73
80
|
on_swt_keydown { |key_event|
|
74
81
|
focused_gladiator = display.focus_control.shell&.get_data('custom_shell')
|
75
82
|
focused_gladiator.handle_display_shortcut(key_event) if !focused_gladiator.nil? && key_event.widget.shell == focused_gladiator&.swt_widget
|
76
83
|
}
|
84
|
+
on_swt_Close {
|
85
|
+
save_config
|
86
|
+
project_dir.selected_child&.write_dirty_content
|
87
|
+
}
|
77
88
|
}
|
78
89
|
end
|
79
90
|
|
@@ -95,6 +106,7 @@ module Glimmer
|
|
95
106
|
if selected_file
|
96
107
|
if Gladiator.drag && !@tab_folder2
|
97
108
|
@tab_folder1 = @current_tab_folder
|
109
|
+
async_exec { body_root.pack_same_size}
|
98
110
|
@tab_folder_sash_form.content {
|
99
111
|
@current_tab_folder = @tab_folder2 = tab_folder
|
100
112
|
@current_tab_folder.swt_widget.setData('proxy', @current_tab_folder)
|
@@ -146,7 +158,9 @@ module Glimmer
|
|
146
158
|
}
|
147
159
|
}
|
148
160
|
on_widget_disposed {
|
149
|
-
|
161
|
+
project_dir.selected_child&.write_dirty_content
|
162
|
+
tab_item_file = the_tab_item.swt_tab_item.get_data('file')
|
163
|
+
tab_item_file.close unless [@tab_folder1, @tab_folder2].compact.map(&:items).flatten(1).detect {|ti| ti.get_data('file') == tab_item_file}
|
150
164
|
}
|
151
165
|
}
|
152
166
|
@current_tab_item.swt_tab_item.setData('file_path', selected_file.path)
|
@@ -154,7 +168,9 @@ module Glimmer
|
|
154
168
|
@current_tab_item.swt_tab_item.setData('proxy', @current_tab_item)
|
155
169
|
}
|
156
170
|
@current_tab_folder.swt_widget.setSelection(@current_tab_item.swt_tab_item)
|
171
|
+
|
157
172
|
body_root.pack_same_size
|
173
|
+
async_exec { body_root.pack_same_size}
|
158
174
|
end
|
159
175
|
@current_text_editor&.text_widget&.setFocus
|
160
176
|
end
|
@@ -177,16 +193,17 @@ module Glimmer
|
|
177
193
|
body {
|
178
194
|
shell {
|
179
195
|
grid_layout(2, false)
|
180
|
-
|
181
196
|
text "Gladiator - #{::File.expand_path(project_dir.path)}"
|
182
197
|
minimum_size 520, 250
|
183
198
|
size 1440, 900
|
199
|
+
image ICON
|
184
200
|
|
185
201
|
on_swt_show {
|
186
202
|
swt_widget.setSize(@config[:shell_width], @config[:shell_height]) if @config[:shell_width] && @config[:shell_height]
|
187
203
|
swt_widget.setLocation(@config[:shell_x], @config[:shell_y]) if @config[:shell_x] && @config[:shell_y]
|
188
204
|
@loaded_config = true
|
189
205
|
}
|
206
|
+
|
190
207
|
on_shell_closed {
|
191
208
|
save_config
|
192
209
|
project_dir.selected_child&.write_dirty_content
|
@@ -211,7 +228,13 @@ module Glimmer
|
|
211
228
|
save_config
|
212
229
|
}
|
213
230
|
on_shell_deactivated {
|
214
|
-
|
231
|
+
project_dir.selected_child&.write_dirty_content
|
232
|
+
}
|
233
|
+
|
234
|
+
display.swt_display.system_menu.items.find {|mi| mi.id == swt(:id_quit)}.add_selection_listener {
|
235
|
+
save_config
|
236
|
+
project_dir.selected_child&.write_dirty_content
|
237
|
+
exit(0)
|
215
238
|
}
|
216
239
|
|
217
240
|
menu_bar {
|
@@ -243,13 +266,13 @@ module Glimmer
|
|
243
266
|
menu_item(:radio) {
|
244
267
|
text '&Horizontal'
|
245
268
|
selection bind(self, :split_orientation,
|
246
|
-
on_read: ->(o) { split_pane? && o == swt(:horizontal)},
|
269
|
+
on_read: ->(o) { split_pane? && o == swt(:horizontal) },
|
247
270
|
on_write: ->(b) { b ? swt(:horizontal) : swt(:vertical) })
|
248
271
|
}
|
249
272
|
menu_item(:radio) {
|
250
273
|
text '&Vertical'
|
251
274
|
selection bind(self, :split_orientation,
|
252
|
-
on_read: ->(o) { split_pane? && o == swt(:vertical)},
|
275
|
+
on_read: ->(o) { split_pane? && o == swt(:vertical) },
|
253
276
|
on_write: ->(b) { b ? swt(:vertical) : swt(:horizontal) })
|
254
277
|
}
|
255
278
|
}
|
@@ -276,6 +299,15 @@ module Glimmer
|
|
276
299
|
}
|
277
300
|
}
|
278
301
|
}
|
302
|
+
menu {
|
303
|
+
text '&Help'
|
304
|
+
menu_item {
|
305
|
+
text '&About'
|
306
|
+
on_widget_selected {
|
307
|
+
display_about_dialog
|
308
|
+
}
|
309
|
+
}
|
310
|
+
}
|
279
311
|
}
|
280
312
|
|
281
313
|
composite {
|
@@ -714,7 +746,7 @@ module Glimmer
|
|
714
746
|
minimum_height 576
|
715
747
|
}
|
716
748
|
sash_width 10
|
717
|
-
orientation bind(self, :split_orientation)
|
749
|
+
orientation bind(self, :split_orientation) {|value| async_exec { body_root.pack_same_size}; value}
|
718
750
|
@current_tab_folder = tab_folder {
|
719
751
|
drag_source(DND::DROP_COPY) {
|
720
752
|
transfer [TextTransfer.getInstance].to_java(Transfer)
|
@@ -875,8 +907,8 @@ module Glimmer
|
|
875
907
|
@current_tab_item = @current_tab_folder.swt_widget.getData('selected_tab_item')
|
876
908
|
@current_text_editor = @current_tab_item.swt_tab_item.getData('text_editor')
|
877
909
|
project_dir.selected_child = @current_tab_item.swt_tab_item.getData('file')
|
878
|
-
|
879
|
-
body_root.pack_same_size
|
910
|
+
|
911
|
+
async_exec { body_root.pack_same_size }
|
880
912
|
end
|
881
913
|
end
|
882
914
|
|
@@ -1044,20 +1076,48 @@ module Glimmer
|
|
1044
1076
|
}
|
1045
1077
|
end
|
1046
1078
|
|
1079
|
+
def display_about_dialog
|
1080
|
+
dialog {
|
1081
|
+
grid_layout(2, false) {
|
1082
|
+
margin_width 15
|
1083
|
+
margin_height 15
|
1084
|
+
}
|
1085
|
+
|
1086
|
+
image ICON
|
1087
|
+
text 'About'
|
1088
|
+
background :white
|
1089
|
+
|
1090
|
+
label {
|
1091
|
+
layout_data :center, :center, false, false
|
1092
|
+
image ICON, height: 260
|
1093
|
+
}
|
1094
|
+
label {
|
1095
|
+
layout_data :fill, :fill, true, true
|
1096
|
+
text "Gladiator v#{VERSION}\n\n#{LICENSE}\n\nGladiator icon made by Freepik from www.flaticon.com"
|
1097
|
+
background :white
|
1098
|
+
}
|
1099
|
+
}.open
|
1100
|
+
end
|
1101
|
+
|
1047
1102
|
def handle_display_shortcut(key_event)
|
1048
1103
|
if key_event.stateMask == swt(COMMAND_KEY) && extract_char(key_event) == 'f'
|
1049
|
-
|
1050
|
-
@navigation_expand_item.swt_expand_item.height = @navigation_expand_item_height if @navigation_expand_item_height
|
1051
|
-
async_exec {
|
1052
|
-
body_root.pack_same_size
|
1053
|
-
}
|
1054
|
-
async_exec {
|
1104
|
+
find_action = lambda do
|
1055
1105
|
if current_text_editor&.text_widget&.getSelectionText && current_text_editor&.text_widget&.getSelectionText&.size.to_i > 0
|
1056
1106
|
find_text.swt_widget.setText current_text_editor.text_widget.getSelectionText
|
1057
1107
|
end
|
1058
1108
|
find_text.swt_widget.selectAll
|
1059
1109
|
find_text.swt_widget.setFocus
|
1060
|
-
|
1110
|
+
end
|
1111
|
+
if @navigation_expand_item.swt_expand_item.get_expanded
|
1112
|
+
find_action.call
|
1113
|
+
else
|
1114
|
+
@navigation_expand_item.swt_expand_item.set_expanded true
|
1115
|
+
@navigation_expand_item.swt_expand_item.height = @navigation_expand_item_height if @navigation_expand_item_height
|
1116
|
+
async_exec {
|
1117
|
+
body_root.pack_same_size
|
1118
|
+
}
|
1119
|
+
async_exec(&find_action)
|
1120
|
+
end
|
1061
1121
|
elsif Glimmer::SWT::SWTProxy.include?(key_event.stateMask, COMMAND_KEY, :shift) && extract_char(key_event) == 'c'
|
1062
1122
|
Clipboard.copy(project_dir.selected_child.path)
|
1063
1123
|
elsif Glimmer::SWT::SWTProxy.include?(key_event.stateMask, COMMAND_KEY, :shift) && extract_char(key_event) == 'g'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-cs-gladiator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
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-12-
|
11
|
+
date: 2020-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -20,8 +20,8 @@ dependencies:
|
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: 5.0.0.0
|
22
22
|
name: glimmer-dsl-swt
|
23
|
-
prerelease: false
|
24
23
|
type: :runtime
|
24
|
+
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
@@ -37,8 +37,8 @@ dependencies:
|
|
37
37
|
- !ruby/object:Gem::Version
|
38
38
|
version: 1.1.1
|
39
39
|
name: filewatcher
|
40
|
-
prerelease: false
|
41
40
|
type: :runtime
|
41
|
+
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
@@ -51,8 +51,8 @@ dependencies:
|
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: 1.3.5
|
53
53
|
name: clipboard
|
54
|
-
prerelease: false
|
55
54
|
type: :runtime
|
55
|
+
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
@@ -65,8 +65,8 @@ dependencies:
|
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: 3.5.0
|
67
67
|
name: rspec
|
68
|
-
prerelease: false
|
69
68
|
type: :development
|
69
|
+
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
@@ -79,8 +79,8 @@ dependencies:
|
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: 2.3.9
|
81
81
|
name: jeweler
|
82
|
-
prerelease: false
|
83
82
|
type: :development
|
83
|
+
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - '='
|
@@ -93,8 +93,8 @@ dependencies:
|
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: '0'
|
95
95
|
name: simplecov
|
96
|
-
prerelease: false
|
97
96
|
type: :development
|
97
|
+
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - ">="
|
@@ -114,11 +114,14 @@ extra_rdoc_files:
|
|
114
114
|
- LICENSE.txt
|
115
115
|
- README.md
|
116
116
|
files:
|
117
|
+
- CHANGELOG.md
|
117
118
|
- LICENSE.txt
|
118
119
|
- README.md
|
119
120
|
- VERSION
|
120
121
|
- bin/gladiator
|
121
122
|
- bin/gladiator_runner.rb
|
123
|
+
- glimmer-cs-gladiator.gemspec
|
124
|
+
- images/glimmer-cs-gladiator-logo.png
|
122
125
|
- lib/glimmer-cs-gladiator.rb
|
123
126
|
- lib/models/glimmer/gladiator/command.rb
|
124
127
|
- lib/models/glimmer/gladiator/dir.rb
|
@@ -144,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
147
|
- !ruby/object:Gem::Version
|
145
148
|
version: '0'
|
146
149
|
requirements: []
|
147
|
-
rubygems_version: 3.
|
150
|
+
rubygems_version: 3.0.6
|
148
151
|
signing_key:
|
149
152
|
specification_version: 4
|
150
153
|
summary: Gladiator (Glimmer Editor) - Glimmer Custom Shell
|