na 1.1.14 → 1.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/bin/na +9 -2
- data/lib/na/string.rb +10 -4
- data/lib/na/version.rb +1 -1
- data/src/README.md +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: d39a0b804774a7d07c6a1154e536798bdc2f09c20e76aa2ca776cc5111c02534
|
4
|
+
data.tar.gz: 66e180d9cf673293e2721d83c8187b06746e352252c7fb1575be33032c088b89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22e0487072dde7c1bf2f76f412ae20a3018fd038300bdb2aac2557ac77ed1909006c4457debbe31c0c32db57439dff2ec7b07a23f8ebda96ad00748a575a8595
|
7
|
+
data.tar.gz: 0e8175309ff9e1d43be62ec03cdd525e34b38c9ba9608e5edbfe90b97b315a43c397e7a318a624ba3f2fa210acc3f30bbadb47590de8a851fac4b092b133a327
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
### 1.1.15
|
2
|
+
|
3
|
+
2022-10-06 16:12
|
4
|
+
|
5
|
+
#### CHANGED
|
6
|
+
|
7
|
+
- If no + or ! tokens are given in search, default to AND search for tokens
|
8
|
+
|
9
|
+
#### IMPROVED
|
10
|
+
|
11
|
+
- Better handling of color in search highlighting
|
12
|
+
|
13
|
+
#### FIXED
|
14
|
+
|
15
|
+
- --regex search broken
|
16
|
+
|
1
17
|
### 1.1.14
|
2
18
|
|
3
19
|
2022-10-06 12:30
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
_If you're one of the rare people like me who find this useful, feel free to
|
10
10
|
[buy me some coffee][donate]._
|
11
11
|
|
12
|
-
The current version of `na` is 1.1.
|
12
|
+
The current version of `na` is 1.1.15
|
13
13
|
.
|
14
14
|
|
15
15
|
`na` ("next action") is a command line tool designed to make it easy to see what your next actions are for any project, right from the command line. It works with TaskPaper-formatted files (but any plain text format will do), looking for `@na` tags (or whatever you specify) in todo files in your current folder.
|
data/bin/na
CHANGED
@@ -269,11 +269,13 @@ class App
|
|
269
269
|
tokens = Regexp.new(args.join(' '), Regexp::IGNORECASE)
|
270
270
|
else
|
271
271
|
tokens = []
|
272
|
+
all_req = args.join(' ') !~ /[+!\-]/
|
273
|
+
|
272
274
|
args.join(' ').split(/ /).each do |arg|
|
273
275
|
m = arg.match(/^(?<req>[+\-!])?(?<tok>.*?)$/)
|
274
276
|
tokens.push({
|
275
277
|
token: m['tok'],
|
276
|
-
required: !m['req'].nil? && m['req'] == '+',
|
278
|
+
required: all_req || (!m['req'].nil? && m['req'] == '+'),
|
277
279
|
negate: !m['req'].nil? && m['req'] =~ /[!\-]/
|
278
280
|
})
|
279
281
|
end
|
@@ -285,7 +287,12 @@ class App
|
|
285
287
|
regex: options[:regex],
|
286
288
|
project: options[:project],
|
287
289
|
require_na: false)
|
288
|
-
|
290
|
+
if tokens.is_a?(Array)
|
291
|
+
regexes = tokens.delete_if { |token| token[:negate] }.map { |token| token[:token] }
|
292
|
+
else
|
293
|
+
regexes = [tokens]
|
294
|
+
end
|
295
|
+
|
289
296
|
NA.output_actions(actions, depth, files: files, regexes: regexes)
|
290
297
|
end
|
291
298
|
end
|
data/lib/na/string.rb
CHANGED
@@ -15,7 +15,7 @@ class ::String
|
|
15
15
|
##
|
16
16
|
## @return [String] string with @tags highlighted
|
17
17
|
##
|
18
|
-
def highlight_tags(color: '{m}', value: '{y}', parens: '{m}', last_color: '{
|
18
|
+
def highlight_tags(color: '{m}', value: '{y}', parens: '{m}', last_color: '{xg}')
|
19
19
|
tag_color = NA::Color.template(color)
|
20
20
|
paren_color = NA::Color.template(parens)
|
21
21
|
value_color = NA::Color.template(value)
|
@@ -23,13 +23,19 @@ class ::String
|
|
23
23
|
"\\1#{tag_color}\\2#{paren_color}\\3#{value_color}\\4#{paren_color}\\5#{last_color}")
|
24
24
|
end
|
25
25
|
|
26
|
-
def highlight_search(regexes, color: '{y}')
|
26
|
+
def highlight_search(regexes, color: '{y}', last_color: '{xg}')
|
27
27
|
string = dup
|
28
28
|
color = NA::Color.template(color)
|
29
29
|
regexes.each do |rx|
|
30
30
|
next if rx.nil?
|
31
31
|
|
32
|
-
|
32
|
+
rx = Regexp.new(rx.wildcard_to_rx, Regexp::IGNORECASE) if rx.is_a?(String)
|
33
|
+
|
34
|
+
string.gsub!(rx) do
|
35
|
+
m = Regexp.last_match
|
36
|
+
last = m.pre_match.last_color
|
37
|
+
"#{color}#{m[0]}#{NA::Color.template(last)}"
|
38
|
+
end
|
33
39
|
end
|
34
40
|
string
|
35
41
|
end
|
@@ -62,7 +68,7 @@ class ::String
|
|
62
68
|
end
|
63
69
|
|
64
70
|
def wildcard_to_rx
|
65
|
-
gsub(/\./, '\\.').gsub(/\*/, '
|
71
|
+
gsub(/\./, '\\.').gsub(/\*/, '[^ ]*?').gsub(/\?/, '.')
|
66
72
|
end
|
67
73
|
|
68
74
|
def cap_first!
|
data/lib/na/version.rb
CHANGED
data/src/README.md
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
_If you're one of the rare people like me who find this useful, feel free to
|
10
10
|
[buy me some coffee][donate]._
|
11
11
|
|
12
|
-
The current version of `na` is <!--VER-->1.1.
|
12
|
+
The current version of `na` is <!--VER-->1.1.14<!--END VER-->.
|
13
13
|
|
14
14
|
`na` ("next action") is a command line tool designed to make it easy to see what your next actions are for any project, right from the command line. It works with TaskPaper-formatted files (but any plain text format will do), looking for `@na` tags (or whatever you specify) in todo files in your current folder.
|
15
15
|
|