glimmer-cs-gladiator 0.10.0 → 0.11.1

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: d01657c9b03099dad70892558d43a585ff5d26a01227081cd94a3b8b9d8f224a
4
- data.tar.gz: d81be798b72b493faaf307b3e888fe1a02bd4bfe6e609d1171e6720254a178d5
3
+ metadata.gz: 3fe3696b0a87eb8158d519cbe9480113e82226259d547020ca9fababe255d5d3
4
+ data.tar.gz: c8af0b5d4917d7373367941a59c06dc79ed171cc13295588a35c09e6b9b98f9c
5
5
  SHA512:
6
- metadata.gz: b6d107d000349c67c0e101e369a510683735000650cac6aa1fc0367690e5cabbd5c3777c52cd1ab72732c4ebb00abf0bbfa9d4ef3d208a1af5f056542245e0b7
7
- data.tar.gz: 34d47289ce397dff8750f33be12e2aa0a3fb5efbb36a62870803f9bf7009f87541f7ed14f1028ce7a0a3abecc29700cc444f0971de69ba63891658a6f88ad849
6
+ metadata.gz: ee65bef582e89f4791b0b4f2f682d143a0b793a6fa2bc6afcfa094d1ee0fae8823b03ab88e1bf57cbbac7a10204fc3e10be12f281c1a7f73bf56368008d2b326
7
+ data.tar.gz: 43e2c2563d1121027563d5985ce716ecb0e2a7e57846fb88a2b20340b6ae60127fca85e79dca29a00d5aa60dee3d1fc211ea0eac008e428d513cd1f798876e49
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.11.1
4
+
5
+ - [CONTRIBUTION BY keeperotphones] Support Ruby file formats: `'rbw', 'gemspec'`
6
+ - Support new file formats: Elixir (`'ex', 'exs'`) & Embedded Elixir (`'eex', 'leex', 'heex'`)
7
+
8
+ ## 0.11.0
9
+
10
+ - Support new file formats: 'ts' (TypeScript), 'tsx', 'rs' (Rust), and 'cs' (C#)
11
+ - Use the correct single line comment prefix for each programming language (e.g. `//` in JS/Java/C and `#` in Ruby/Perl/Python)
12
+ - Improve Undo/Redo support by storing data for in-progress text entry every 1 second (or ENV['UNDO_TIME_INTERVAL_SECONDS'] if specified) while typing to enable undoing partial text instead of everything
13
+ - File Lookup ignores `:` in filename search terms to enable looking up files for namespaced Ruby class (e.g. `Glimmer::Gladiator::Command` will find `lib/models/glimmer/gladiator/command.rb`)
14
+ - Upgrade to JRuby 9.3.4.0
15
+ - Upgrade to Glimmer DSL for SWT 4.24.3.1
16
+
3
17
  ## 0.10.0
4
18
 
5
19
  - Upgrade to glimmer-dsl-swt 4.23.0.0
data/README.md CHANGED
@@ -1,7 +1,11 @@
1
- # <img src='https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-cs-gladiator-logo.svg' height=85 /> Gladiator 0.10.0 - [Ugliest Text Editor Ever!](https://www.reddit.com/r/ruby/comments/hgve8k/gladiator_glimmer_editor_ugliest_text_editor_ever/)
1
+ # <img src='https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-cs-gladiator-logo.svg' height=85 /> Gladiator 0.11.1 - [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
 
5
+ (**[***Montreal.rb Talk - How I Built My Code Editor in Ruby***](https://andymaleh.blogspot.com/2022/07/montrealrb-2022-07-07-talk-how-i-built.html)**)
6
+
7
+ ![rapid prototyping of desktop app GUI with Gladiator](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-swt/master/images/glimmer-dsl-swt-demo-hello-world.gif)
8
+
5
9
  Mac
6
10
 
7
11
  ![Gladiator](images/glimmer-gladiator.png)
@@ -10,12 +14,12 @@ Windows
10
14
 
11
15
  ![Gladiator](images/glimmer-gladiator-windows.png)
12
16
 
13
- [Gladiator](https://rubygems.org/gems/glimmer-cs-gladiator) (short for Glimmer Editor) is a [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) sample beta project under on-going development that demonstrates how to build a text editor in Ruby using [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) (JRuby Desktop Development GUI Library).
17
+ [Gladiator](https://rubygems.org/gems/glimmer-cs-gladiator) (short for Glimmer Editor) is a [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) beta project under on-going development that explores how to build a text editor in Ruby using [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) (JRuby Desktop Development GUI Library).
14
18
  It is not intended to be a full-fledged editor by any means, yet mostly a fun educational exercise in using [Glimmer](https://github.com/AndyObtiva/glimmer).
15
19
  [Gladiator](https://rubygems.org/gems/glimmer-cs-gladiator) is also a personal tool for shaping an editor exactly the way I like, with all the keyboard shortcuts I prefer.
16
20
  I leave building truly professional text editors to software tooling experts who would hopefully use [Glimmer](https://github.com/AndyObtiva/glimmer) one day. Otherwise, I have been happily using [Gladiator](https://rubygems.org/gems/glimmer-cs-gladiator) to develop all my [projects](https://github.com/AndyObtiva) since May of 2020.
17
21
 
18
- You may now [download](#download) a packaged version of [Gladiator](https://rubygems.org/gems/glimmer-cs-gladiator), including new support for Mac ARM64.
22
+ [<img src='https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-cs-gladiator-logo.svg' height=40 /> You may now download a packaged version of Gladiator, including new support for Mac ARM64](#download)
19
23
 
20
24
  ## Features
21
25
 
@@ -87,10 +91,13 @@ You may now [download](#download) a packaged version of [Gladiator](https://ruby
87
91
  Here is an exhaustive list of the file formats supported by [Gladiator](https://rubygems.org/gems/glimmer-cs-gladiator):
88
92
  1. C (`'c', 'h'`)
89
93
  1. C++ (`'cpp', 'cc', 'C', 'cxx', 'c++', 'hpp', 'hh', 'H', 'hxx', 'h++'`)
94
+ 1. C# (`'cs'`)
90
95
  1. Crystal (`'cr'`)
91
96
  1. CSS (`'css'`)
92
97
  1. Conf (`'conf'`)
93
98
  1. CoffeeScript (`'coffee'`)
99
+ 1. Elixir (`'ex', 'exs'`)
100
+ 1. Embedded Elixir (`'eex', 'leex', 'heex'`)
94
101
  1. ERB (`'erb'`)
95
102
  1. Gherkin Feature (`'feature'`)
96
103
  1. Gradle (`'gradle'`)
@@ -113,13 +120,16 @@ Here is an exhaustive list of the file formats supported by [Gladiator](https://
113
120
  1. PostScript (`'ps'`)
114
121
  1. PowerShell (`'ps1'`)
115
122
  1. Python (`'py'`)
116
- 1. Ruby (`'rb'`, `'rake'`)
123
+ 1. Ruby (`'rb'`, `'rbw'`, `'rake'`, `'gemspec'`)
124
+ 1. Rust (`'rs'`)
117
125
  1. SASS (`'sass'`)
118
126
  1. Scheme (`'scm', 'sps', 'sls', 'sld'`)
119
127
  1. SCSS (`'scss'`)
120
128
  1. Shell (`'sh'`)
121
129
  1. SQL (`'sql'`)
122
130
  1. Tcl (`'tcl'`)
131
+ 1. TypeScript (`'ts'`)
132
+ 1. TSX (`'tsx'`)
123
133
  1. Yaml (`'yaml', 'yml'`)
124
134
  1. XML (`'xml'`)
125
135
 
@@ -137,7 +147,9 @@ Here is an exhaustive list of the file formats supported by [Gladiator](https://
137
147
 
138
148
  ## Download
139
149
 
140
- [<img src='https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-cs-gladiator-logo.svg' height=40 /> Download Gladiator 0.10.0 Mac DMG Installer (ARM64 Monterey & Older)](https://www.dropbox.com/s/7qagm9hsm1dyqel/Gladiator-0.10.0-arm64.dmg?dl=1)
150
+ [<img src='https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-cs-gladiator-logo.svg' height=40 /> Download Gladiator 0.11.1 Mac DMG Installer (ARM64 Ventura 13.4.1 & Older)](https://www.dropbox.com/scl/fi/iyyubcqekhtn4rv91feka/Gladiator-0.11.1-arm64-ventura-13.4.1.dmg?rlkey=ht2bt4jqf6bmgfjy0aurt2fem&dl=1) (this version starts in about 2.5 seconds)
151
+
152
+ [<img src='https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-cs-gladiator-logo.svg' height=40 /> Download Gladiator 0.10.0 Mac DMG Installer (x64 Monterey & Big Sur)](https://www.dropbox.com/s/6155qdxv7j6hnsi/Gladiator-0.10.0-x64-monterey.dmg?dl=1)
141
153
 
142
154
  [<img src='https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-cs-gladiator-logo.svg' height=40 /> Download Gladiator 0.10.0 Mac DMG Installer (x64 Catalina & Older)](https://www.dropbox.com/s/rxta4yio71mei8f/Gladiator-0.10.0.dmg?dl=1)
143
155
 
@@ -154,7 +166,7 @@ Note: if you encounter any issues, check if they are documented in [TODO.md](TOD
154
166
  Install [Gladiator](https://rubygems.org/gems/glimmer-cs-gladiator) gem by running (`jgem`, `jruby -S gem`, or `gem` directly if you have [RVM](https://rvm.io/)):
155
167
 
156
168
  ```
157
- jgem install glimmer-cs-gladiator -v0.10.0
169
+ jgem install glimmer-cs-gladiator -v0.11.1
158
170
  ```
159
171
 
160
172
  Or add to a JRuby project Bundler `Gemfile` under the `:developement` group:
@@ -218,7 +230,7 @@ To reuse [Gladiator](https://rubygems.org/gems/glimmer-cs-gladiator) as a Glimme
218
230
  following to the application's `Gemfile`:
219
231
 
220
232
  ```
221
- gem 'glimmer-cs-gladiator', '~> 0.10.0'
233
+ gem 'glimmer-cs-gladiator', '~> 0.11.1'
222
234
  ```
223
235
 
224
236
  Run:
@@ -291,6 +303,10 @@ Also, if you encounter this issue with projects that contain a lot of extra file
291
303
  could later open the generated `.gladiator` file at the root of the project directory and add unnecessary subdirectories
292
304
  to the `ignore_paths` array.
293
305
 
306
+ ### Freezing in large projects
307
+
308
+ Gladiator right now assumes smaller projects with a few files only as it always opens all file contents in memory for better searching. So, when a file is updated externally (e.g. change git branch), it reloads its entire tree, including all the file contents too, which causes a temporary freeze. This may get fixed in the future, but it is not annoying enough in smaller projects to be fixed right away. The change might include diffing the tree to avoid refreshing file contents for unchanged files, and perhaps multi-threaded loading of file contents to avoid freezing the GUI.
309
+
294
310
  ## TODO
295
311
 
296
312
  [TODO.md](TODO.md)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.10.0
1
+ 0.11.1
data/bin/gladiator CHANGED
File without changes
data/bin/gladiator-setup CHANGED
File without changes
File without changes
@@ -2,21 +2,20 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: glimmer-cs-gladiator 0.10.0 ruby lib
5
+ # stub: glimmer-cs-gladiator 0.11.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "glimmer-cs-gladiator".freeze
9
- s.version = "0.10.0"
9
+ s.version = "0.11.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Andy Maleh".freeze]
14
- s.date = "2022-07-04"
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
14
+ s.date = "2023-08-15"
15
+ s.description = "Gladiator (short for Glimmer Editor) is a Code Editor / IDE beta 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.".freeze
16
16
  s.email = "andy.am@gmail.com".freeze
17
17
  s.executables = ["glimmer-cs-gladiator".freeze, "gladiator".freeze, "gladiator-setup".freeze]
18
18
  s.extra_rdoc_files = [
19
- "CHANGELOG.md",
20
19
  "LICENSE.txt",
21
20
  "README.md"
22
21
  ]
@@ -47,29 +46,27 @@ Gem::Specification.new do |s|
47
46
  s.licenses = ["MIT".freeze]
48
47
  s.post_install_message = "\nTo make the gladiator command available system-wide (especially with RVM), make sure you run this command with jruby in path: gladiator-setup\n\n".freeze
49
48
  s.rubygems_version = "3.2.29".freeze
50
- s.summary = "Gladiator (Glimmer Editor) - Glimmer Custom Shell - Text Editor Built in Ruby".freeze
49
+ s.summary = "Gladiator (Glimmer Editor) - Glimmer Custom Shell - Code Editor / IDE Built in Ruby".freeze
51
50
 
52
51
  if s.respond_to? :specification_version then
53
52
  s.specification_version = 4
54
53
  end
55
54
 
56
55
  if s.respond_to? :add_runtime_dependency then
57
- s.add_runtime_dependency(%q<glimmer-dsl-swt>.freeze, ["~> 4.24.0.0"])
56
+ s.add_runtime_dependency(%q<glimmer-dsl-swt>.freeze, ["~> 4.24.3.1"])
58
57
  s.add_runtime_dependency(%q<filewatcher>.freeze, ["~> 1.1.1"])
59
58
  s.add_runtime_dependency(%q<clipboard>.freeze, ["~> 1.3.5"])
60
59
  s.add_development_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
61
60
  s.add_development_dependency(%q<jeweler>.freeze, ["= 2.3.9"])
62
61
  s.add_development_dependency(%q<warbler>.freeze, ["= 2.0.5"])
63
- s.add_development_dependency(%q<jruby-jars>.freeze, ["= 9.2.19.0"])
64
62
  s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
65
63
  else
66
- s.add_dependency(%q<glimmer-dsl-swt>.freeze, ["~> 4.24.0.0"])
64
+ s.add_dependency(%q<glimmer-dsl-swt>.freeze, ["~> 4.24.3.1"])
67
65
  s.add_dependency(%q<filewatcher>.freeze, ["~> 1.1.1"])
68
66
  s.add_dependency(%q<clipboard>.freeze, ["~> 1.3.5"])
69
67
  s.add_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
70
68
  s.add_dependency(%q<jeweler>.freeze, ["= 2.3.9"])
71
69
  s.add_dependency(%q<warbler>.freeze, ["= 2.0.5"])
72
- s.add_dependency(%q<jruby-jars>.freeze, ["= 9.2.19.0"])
73
70
  s.add_dependency(%q<simplecov>.freeze, [">= 0"])
74
71
  end
75
72
  end
@@ -38,13 +38,12 @@ module Glimmer
38
38
 
39
39
  def do(file, method = nil, *args, command: nil)
40
40
  if command.nil?
41
- command ||= Command.new(file, method, *args)
41
+ command = Command.new(file, method, *args)
42
42
  command.previous_command = command_history_for(file).last
43
- unless command_history_for(file).last.method == :change_content! && method == :change_content!
44
- command_history_for(file).last.next_command = command
45
- end
43
+ save_new_command = command_history_for(file).last.method == :change_content! && method == :change_content! && !time_for_new_command?
44
+ command_history_for(file).last.next_command = command unless save_new_command
46
45
  command.do
47
- command_history_for(file) << command unless command_history_for(file).last.method == :change_content! && method == :change_content!
46
+ command_history_for(file) << command unless save_new_command
48
47
  else
49
48
  command_history_for(file) << command
50
49
  end
@@ -64,7 +63,16 @@ module Glimmer
64
63
  def clear(file)
65
64
  command_history[file] = [Command.new(file)]
66
65
  end
66
+
67
+ def time_for_new_command?
68
+ @time ||= Time.now
69
+ time_for_new_command = (Time.now - @time) > TIME_INTERVAL_SECONDS_NEW_COMMAND
70
+ @time = Time.now if time_for_new_command
71
+ time_for_new_command
72
+ end
67
73
  end
74
+
75
+ TIME_INTERVAL_SECONDS_NEW_COMMAND = (ENV['UNDO_TIME_INTERVAL_SECONDS'] || 1).to_f # seconds
68
76
 
69
77
  attr_accessor :file, :method, :args, :previous_command, :next_command,
70
78
  :file_dirty_content, :file_caret_position, :file_selection_count, :previous_file_dirty_content, :previous_file_caret_position, :previous_file_selection_count
@@ -28,6 +28,7 @@ module Glimmer
28
28
  include Glimmer::DataBinding::ObservableModel
29
29
 
30
30
  IGNORE_PATHS = ['.gladiator', '.gladiator-scratchpad', '.git', 'coverage', 'packages', 'node_modules', 'tmp', 'vendor', 'pkg', 'dist', 'log', 'test/reports']
31
+ REGEXP_FILTER = /[:_\/.-]/
31
32
 
32
33
  attr_accessor :selected_child, :filter, :children, :filtered_path_options, :filtered_path, :display_path, :ignore_paths
33
34
  attr_reader :name, :parent, :path
@@ -184,7 +185,7 @@ module Glimmer
184
185
  children_files.select do |child|
185
186
  child_path = child.path.to_s.sub(project_dir.path, '')
186
187
  child_path.downcase.include?(filter.downcase) ||
187
- child_path.downcase.gsub(/[_\/.-]/, '').include?(filter.downcase.gsub(/[_\/.-]/, ''))
188
+ child_path.downcase.gsub(REGEXP_FILTER, '').include?(filter.downcase.gsub(REGEXP_FILTER, ''))
188
189
  end.sort_by {|c| c.path.to_s.downcase}
189
190
  end
190
191
 
@@ -41,9 +41,12 @@ module Glimmer
41
41
  @init = nil
42
42
  end
43
43
 
44
+ def extension
45
+ path.split('.').last if path.to_s.include?('.')
46
+ end
47
+
44
48
  def language
45
49
  # TODO consider using Rouge::Lexer.guess_by_filename instead and perhaps guess_by_source when it fails
46
- extension = path.split('.').last if path.to_s.include?('.')
47
50
  return 'ruby' if scratchpad?
48
51
  return 'ruby' if path.to_s.end_with?('Gemfile') || path.to_s.end_with?('Rakefile')
49
52
  return 'ruby' if dirty_content.start_with?('#!/usr/bin/env ruby') || dirty_content.start_with?('#!/usr/bin/env jruby')
@@ -58,14 +61,20 @@ module Glimmer
58
61
  'cpp'
59
62
  when 'cr'
60
63
  'crystal'
64
+ when 'cs'
65
+ 'csharp'
61
66
  when 'css'
62
67
  'css'
63
68
  when 'conf'
64
69
  'conf'
65
70
  when 'coffee'
66
71
  'coffeescript'
72
+ when 'eex', 'leex', 'heex'
73
+ 'eex' # embedded elixir
67
74
  when 'erb'
68
75
  'erb'
76
+ when 'ex', 'exs'
77
+ 'elixir'
69
78
  when 'feature'
70
79
  'gherkin'
71
80
  when 'gradle'
@@ -106,7 +115,9 @@ module Glimmer
106
115
  'powershell'
107
116
  when 'py'
108
117
  'python'
109
- when 'rb', 'rake'
118
+ when 'rs'
119
+ 'rust'
120
+ when 'rb', 'rbw', 'rake', 'gemspec'
110
121
  'ruby'
111
122
  when 'sass'
112
123
  'sass'
@@ -120,15 +131,86 @@ module Glimmer
120
131
  'sql'
121
132
  when 'tcl'
122
133
  'tcl'
134
+ when 'ts'
135
+ 'typescript'
136
+ when 'tsx'
137
+ 'tsx'
123
138
  when 'txt', nil
124
- 'plain_text'
139
+ 'plaintext'
125
140
  when 'yaml', 'yml'
126
141
  'yaml'
127
142
  when 'xml'
128
143
  'xml'
144
+ else
145
+ 'plaintext'
129
146
  end
130
147
  end
131
148
 
149
+ def single_line_comment_prefix
150
+ # TODO redo this implementation using language instead of extension
151
+ case extension
152
+ when 'c', 'h',
153
+ 'cpp', 'cc', 'C', 'cxx', 'c++', 'hpp', 'hh', 'H', 'hxx', 'h++',
154
+ 'cs',
155
+ 'gradle',
156
+ 'java',
157
+ 'js', 'cjs', 'mjs', 'es6', 'es',
158
+ 'jsx',
159
+ 'kt', 'ktm', 'kts',
160
+ 'rs',
161
+ 'ts',
162
+ 'tsx',
163
+ 'sass',
164
+ 'scss'
165
+ '//'
166
+ when 'cr',
167
+ 'conf',
168
+ 'coffee',
169
+ 'ex', 'exs',
170
+ 'feature',
171
+ 'ini',
172
+ 'pl',
173
+ 'pp',
174
+ 'properties',
175
+ 'ps1',
176
+ 'py',
177
+ 'rb', 'rbw', 'rake', 'gemspec',
178
+ 'sh',
179
+ 'tcl',
180
+ 'yaml', 'yml'
181
+ '#'
182
+ when 'css'
183
+ '/*'
184
+ when 'eex', 'leex', 'heex',
185
+ 'erb',
186
+ 'html',
187
+ 'jsp',
188
+ 'plist',
189
+ 'xml'
190
+ # TODO in the future, have .erb support `#` single line comment inside Ruby code scriptlets as opposed to scriptlet-free code
191
+ '<!--'
192
+ when 'haml'
193
+ '/'
194
+ when 'md', 'markdown'
195
+ '<!---'
196
+ when 'ps'
197
+ '%'
198
+ when 'scm', 'sps', 'sls', 'sld'
199
+ ';'
200
+ when 'sql'
201
+ '--'
202
+ when 'json',
203
+ 'patch',
204
+ 'txt',
205
+ nil
206
+ nil
207
+ else
208
+ '#'
209
+ end
210
+ end
211
+
212
+ # TODO support: def single_line_comment_postfix
213
+
132
214
  def init_content
133
215
  unless @init
134
216
  @init = true
@@ -386,14 +468,17 @@ module Glimmer
386
468
  delta = 0
387
469
  the_line = old_lines[the_line_index]
388
470
  return if the_line.nil?
389
- if the_line.strip.start_with?('# ')
390
- new_lines[the_line_index] = the_line.sub(/# /, '')
471
+ if the_line.strip.start_with?("#{single_line_comment_prefix} ")
472
+ new_lines[the_line_index] = the_line.sub(/#{single_line_comment_prefix} /, '')
473
+ # TODO single_line_comment_postfix if needed
391
474
  delta -= 2
392
- elsif the_line.strip.start_with?('#')
393
- new_lines[the_line_index] = the_line.sub(/#/, '')
475
+ elsif the_line.strip.start_with?(single_line_comment_prefix)
476
+ new_lines[the_line_index] = the_line.sub(/#{single_line_comment_prefix}/, '')
477
+ # TODO single_line_comment_postfix if needed
394
478
  delta -= 1
395
479
  else
396
- new_lines[the_line_index] = "# #{the_line}"
480
+ new_lines[the_line_index] = "#{single_line_comment_prefix} #{the_line}"
481
+ # TODO single_line_comment_postfix if needed
397
482
  delta += 2
398
483
  end
399
484
  end
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.10.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-04 00:00:00.000000000 Z
11
+ date: 2023-08-15 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: 4.24.0.0
18
+ version: 4.24.3.1
19
19
  name: glimmer-dsl-swt
20
20
  prerelease: false
21
21
  type: :runtime
@@ -23,7 +23,7 @@ dependencies:
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 4.24.0.0
26
+ version: 4.24.3.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
@@ -94,20 +94,6 @@ dependencies:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
96
  version: 2.0.5
97
- - !ruby/object:Gem::Dependency
98
- requirement: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - '='
101
- - !ruby/object:Gem::Version
102
- version: 9.2.19.0
103
- name: jruby-jars
104
- prerelease: false
105
- type: :development
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - '='
109
- - !ruby/object:Gem::Version
110
- version: 9.2.19.0
111
97
  - !ruby/object:Gem::Dependency
112
98
  requirement: !ruby/object:Gem::Requirement
113
99
  requirements:
@@ -122,12 +108,10 @@ dependencies:
122
108
  - - ">="
123
109
  - !ruby/object:Gem::Version
124
110
  version: '0'
125
- description: Gladiator (short for Glimmer Editor) is a Glimmer sample project under
126
- on-going development. It is not intended to be a full-fledged editor by any means,
127
- yet mostly a fun educational exercise in using Glimmer to build a text editor. Gladiator
128
- is also a personal tool for shaping an editor exactly the way I like. I leave building
129
- truly professional text editors to software tooling experts who would hopefully
130
- use Glimmer one day.
111
+ description: Gladiator (short for Glimmer Editor) is a Code Editor / IDE beta project
112
+ under on-going development. It is not intended to be a full-fledged editor by any
113
+ means, yet mostly a fun educational exercise in using Glimmer to build a text editor.
114
+ Gladiator is also a personal tool for shaping an editor exactly the way I like.
131
115
  email: andy.am@gmail.com
132
116
  executables:
133
117
  - glimmer-cs-gladiator
@@ -135,7 +119,6 @@ executables:
135
119
  - gladiator-setup
136
120
  extensions: []
137
121
  extra_rdoc_files:
138
- - CHANGELOG.md
139
122
  - LICENSE.txt
140
123
  - README.md
141
124
  files:
@@ -185,6 +168,6 @@ requirements: []
185
168
  rubygems_version: 3.2.29
186
169
  signing_key:
187
170
  specification_version: 4
188
- summary: Gladiator (Glimmer Editor) - Glimmer Custom Shell - Text Editor Built in
189
- Ruby
171
+ summary: Gladiator (Glimmer Editor) - Glimmer Custom Shell - Code Editor / IDE Built
172
+ in Ruby
190
173
  test_files: []