snibbets 2.0.27 → 2.0.28

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: 7f787f19a0ad33d36951029f1d367cb0c8d1b1f4e4b0af0725a678b8b6c55fe5
4
- data.tar.gz: 31ae62df88fbae803a93d3a50a8f3125ed9c6c58e0f3ae2f08c511d1673d6c29
3
+ metadata.gz: 6f9f01ad7e1ae9656d572bbd502f4b0dc1fa7d344509a6a93f07b765d515ddca
4
+ data.tar.gz: 0bc11012e818d56256550af0b3df3fe952307d2f86b8e7da9d91a8a80dfbafee
5
5
  SHA512:
6
- metadata.gz: 76afe13255327745446d6367b2b64f1266692df02ae039442d01437af42ce87488c86c87d0e65d327552a992c1a3eb570f5e071fc5427191a880f04f34039954
7
- data.tar.gz: 3656f676bacce960fe21dfa5e0773d90e3c90059181c80e5836d36ec59709e286bd3dba914162d9b3a30a0afb35bf3e0c7036c73a724e8c609b9113d66acca68
6
+ metadata.gz: a8926027efe84785a45414761eab33b66474a819ed394e52e1f638c95e5ae7a3aad857df95728640f3ccf68ad0d471b93039b694bfa0d72886b682afad13c3c5
7
+ data.tar.gz: bfc6c99b3178fb1f7cb8dc3b7aad350cca53e6f560ab19357924291346e6bc74583c9755a945363122105840ef66abee960a8aa9ca75547f23b239be088761b1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ ### 2.0.28
2
+
3
+ 2023-04-18 09: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
+ - When detecting indented code blocks, require a blank line (or start of file) before them, to avoid picking up lines within indented lists
19
+
1
20
  ### 2.0.27
2
21
 
3
22
  2023-04-17 15:54
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snibbets (2.0.27)
4
+ snibbets (2.0.28)
5
5
  mdless (~> 1.0, >= 1.0.32)
6
6
  tty-reader (~> 0.9, >= 0.9.0)
7
7
  tty-which (~> 0.5, >= 0.5.0)
data/README.md CHANGED
@@ -157,7 +157,7 @@ Snibbet's implementation of Skylighting has limited but better-looking themes, a
157
157
  ### Usage
158
158
 
159
159
  ```
160
- Snibbets v2.0.27
160
+ Snibbets v2.0.28
161
161
 
162
162
  Usage: snibbets [options] query
163
163
  -a, --all If a file contains multiple snippets, output all of them (no menu)
@@ -125,7 +125,7 @@ module Snibbets
125
125
  "<block#{counter}>\n"
126
126
  end
127
127
 
128
- sans_blocks = sans_blocks.gsub(/(?mi)^((?: {4,}|\t+)\S[\S\s]*?)(?=\n\S|\Z)/) do
128
+ sans_blocks = sans_blocks.gsub(/(?mi)(?<=\n\n|\A)\n?((?: {4,}|\t+)\S[\S\s]*?)(?=\n\S|\Z)/) do
129
129
  counter += 1
130
130
  code = Regexp.last_match(1).split(/\n/)
131
131
 
@@ -148,10 +148,9 @@ module Snibbets
148
148
 
149
149
  parts.each do |part|
150
150
  lines = part.split(/\n/).strip_empty
151
-
152
151
  next if lines.blocks == 0
153
152
 
154
- title = lines.count > 1 ? lines.shift.strip.sub(/[.:]$/, '') : 'Default snippet'
153
+ title = lines.count > 1 && lines[0] !~ /<block\d+>/ ? lines.shift.strip.sub(/[.:]$/, '') : 'Default snippet'
155
154
  block = lines.join("\n").gsub(/<(block\d+)>/) { code_blocks[Regexp.last_match(1)] }
156
155
 
157
156
  lang = nil
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Snibbets
4
- VERSION = '2.0.27'
4
+ VERSION = '2.0.28'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snibbets
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.27
4
+ version: 2.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-17 00:00:00.000000000 Z
11
+ date: 2023-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler