snibbets 2.0.24 → 2.0.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/snibbets/lexers.rb +6 -0
- data/lib/snibbets/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8268903f7b48cbc4e12e42e09fc99c5062f6b5f1bf49e6e7a0033d1c759a2069
|
4
|
+
data.tar.gz: d880b58db9f6f7b849de94157816a4c48774dadbadc977ea109839201194e56d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a06043d9c6684b6a3fd1d1ec6f813d1a4e1148d99534278561b6359a63083b5766c83c3ff5910b2ba424cef31fc2024f23d147ee20b24ef204c15312f67f601a
|
7
|
+
data.tar.gz: db1de38bd67085f64e9d1c85ff68ed7f03e29ec335f2cd988925fb4b93d49f4ba0b69612831ddfba1414c7e3cad1750c4ddcd8f7f25184935c3b1e69d70656cd
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,38 @@
|
|
1
|
+
### 2.0.26
|
2
|
+
|
3
|
+
2023-04-16 11:18
|
4
|
+
|
5
|
+
#### NEW
|
6
|
+
|
7
|
+
- `--nvultra` will open the selected snippet in nvUltra
|
8
|
+
|
9
|
+
#### IMPROVED
|
10
|
+
|
11
|
+
- Use Readline for entering info with `--paste`, allows for better editing experience
|
12
|
+
- Allow `--edit` with `--paste` to open the new snippet in your editor immediately
|
13
|
+
|
14
|
+
#### FIXED
|
15
|
+
|
16
|
+
- Code indentation with `--paste`
|
17
|
+
- Nil error when highlighting without extension
|
18
|
+
|
19
|
+
### 2.0.25
|
20
|
+
|
21
|
+
2023-04-16 11:09
|
22
|
+
|
23
|
+
#### NEW
|
24
|
+
|
25
|
+
- `--nvultra` will open the selected snippet in nvUltra
|
26
|
+
|
27
|
+
#### IMPROVED
|
28
|
+
|
29
|
+
- Use Readline for entering info with `--paste`, allows for better editing experience
|
30
|
+
- Allow `--edit` with `--paste` to open the new snippet in your editor immediately
|
31
|
+
|
32
|
+
#### FIXED
|
33
|
+
|
34
|
+
- Code indentation with `--paste`
|
35
|
+
|
1
36
|
### 2.0.24
|
2
37
|
|
3
38
|
2023-04-16 10:49
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -155,7 +155,7 @@ Snibbet's implementation of Skylighting has limited but better-looking themes, a
|
|
155
155
|
### Usage
|
156
156
|
|
157
157
|
```
|
158
|
-
Snibbets v2.0.
|
158
|
+
Snibbets v2.0.26
|
159
159
|
|
160
160
|
Usage: snibbets [options] query
|
161
161
|
-a, --all If a file contains multiple snippets, output all of them (no menu)
|
data/lib/snibbets/lexers.rb
CHANGED
@@ -28,17 +28,23 @@ module Snibbets
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def ext_to_lang(ext)
|
31
|
+
return nil if ext.nil?
|
32
|
+
|
31
33
|
matches = lexers.select { |lex| lex[:extensions].map(&:downcase).include?(ext.downcase) }
|
32
34
|
matches.map { |lex| lex[:lexer] }.first || ext
|
33
35
|
end
|
34
36
|
|
35
37
|
def lang_to_ext(lexer)
|
38
|
+
return nil if lexer.nil?
|
39
|
+
|
36
40
|
matches = lexers.select { |lex| lex[:lexer] == lexer || lex[:aliases].map(&:downcase).include?(lexer.downcase) }
|
37
41
|
matches.map { |lex| lex[:extensions].first }.first || lexer
|
38
42
|
end
|
39
43
|
|
40
44
|
def syntax_from_extension(filename)
|
41
45
|
exts = filename.split(/\./)[1..-2]
|
46
|
+
return nil if exts.count.zero?
|
47
|
+
|
42
48
|
ext_to_lang(exts[-1])
|
43
49
|
end
|
44
50
|
end
|
data/lib/snibbets/version.rb
CHANGED