howzit 1.2.14 → 1.2.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 +12 -0
- data/README.md +3 -0
- data/lib/howzit/buildnotes.rb +22 -10
- data/lib/howzit/version.rb +1 -1
- data/lib/howzit.rb +1 -0
- 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: c2df5a80f8f5ab2a265c424015adbcda29a16050e28411a194cb7b4c7eecdf6f
|
4
|
+
data.tar.gz: fe974160b092d27f9901e91ddaf5d83b6f1b0c494108e1bd12d23a865e05e56a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d71faacd4a0d7ae0ce10e089302c2ef8d32ece37479c718690b48b3d969d6725018665299a63d787b36419131ccc8642e94a638580aa38030ec51191a1e29d45
|
7
|
+
data.tar.gz: 997f94412dd2f580ca712aead5d8609fa71044744c5ed0d4437d161331ae9ff58ad5f28f61ed8b969eca158551e131b730285b7e920c5f6347e4641db816385e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
### 1.2.15
|
2
|
+
|
3
|
+
2022-08-02 11:59
|
4
|
+
|
5
|
+
#### NEW
|
6
|
+
|
7
|
+
- Option to set :header_format: to block for alternate topic title appearance
|
8
|
+
|
9
|
+
#### FIXED
|
10
|
+
|
11
|
+
- Missing spacing around topic titles when displaying multiple topics
|
12
|
+
|
1
13
|
### 1.2.14
|
2
14
|
|
3
15
|
2022-08-02 11:01
|
data/README.md
CHANGED
@@ -265,6 +265,7 @@ Some of the command line options can be set as defaults. The first time you run
|
|
265
265
|
:include_upstream: false
|
266
266
|
:log_level: 1
|
267
267
|
:multiple_matches: choose
|
268
|
+
:header_format: border
|
268
269
|
|
269
270
|
If `:color:` is false, output will not be colored, and markdown highlighting will be bypassed.
|
270
271
|
|
@@ -282,6 +283,8 @@ Set `:log_level:` to 0 for debug messages, or 3 to suppress superfluous info mes
|
|
282
283
|
|
283
284
|
`:multiple_matches:` determines how howzit will handle cases where a search results in multiple matches. It can be set to "first" (first match in notes), "best" (shortest topic match), "all" (display all results), or "choose" (displays a menu of results). Default is "choose." When grepping for results, only "all" or "choose" are valid, if the default is something else, "choose" will be used. Can be overridden with the `--multiple TYPE` flag.
|
284
285
|
|
286
|
+
`:header_format:` changes the way topic titles are displayed. Setting it to "border" will add a horizontal rule and brackets around the title. Setting it to "block" will mark topic titles with a unicode block instead.
|
287
|
+
|
285
288
|
### Matching
|
286
289
|
|
287
290
|
All matching is case insensitive. This setting can be overridden by the `--matching TYPE` flag on the command line.
|
data/lib/howzit/buildnotes.rb
CHANGED
@@ -247,17 +247,22 @@ module Howzit
|
|
247
247
|
|
248
248
|
options.merge!(opts)
|
249
249
|
|
250
|
-
|
250
|
+
case @options[:header_format]
|
251
|
+
when :block
|
252
|
+
Color.template("#{options[:color]}\u{258C}#{title}#{should_mark_iterm? && options[:mark] ? iterm_marker : ''}{x}")
|
253
|
+
else
|
254
|
+
cols = TTY::Screen.columns
|
251
255
|
|
252
|
-
|
253
|
-
|
256
|
+
cols = @options[:wrap] if (@options[:wrap]).positive? && cols > @options[:wrap]
|
257
|
+
title = Color.template("#{options[:border]}#{options[:hr] * 2}( #{options[:color]}#{title}#{options[:border]} )")
|
254
258
|
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
259
|
+
tail = if should_mark_iterm?
|
260
|
+
"#{options[:hr] * (cols - title.uncolor.length - 15)}#{options[:mark] ? iterm_marker : ''}"
|
261
|
+
else
|
262
|
+
options[:hr] * (cols - title.uncolor.length)
|
263
|
+
end
|
264
|
+
Color.template("#{title}#{tail}{x}")
|
265
|
+
end
|
261
266
|
end
|
262
267
|
|
263
268
|
def os_open(command)
|
@@ -451,7 +456,7 @@ module Howzit
|
|
451
456
|
else
|
452
457
|
output_topic(key, {single: single})
|
453
458
|
end
|
454
|
-
output.nil? ? '' : output.join("\n")
|
459
|
+
output.nil? ? '' : output.join("\n")
|
455
460
|
end
|
456
461
|
|
457
462
|
# Output a list of topic titles
|
@@ -719,6 +724,7 @@ module Howzit
|
|
719
724
|
include_upstream: false,
|
720
725
|
show_all_code: false,
|
721
726
|
multiple_matches: 'choose',
|
727
|
+
header_format: 'border',
|
722
728
|
log_level: 1 # 0: debug, 1: info, 2: warn, 3: error
|
723
729
|
}
|
724
730
|
|
@@ -882,6 +888,11 @@ module Howzit
|
|
882
888
|
Process.exit 0
|
883
889
|
end
|
884
890
|
|
891
|
+
opts.on('--header-format TYPE', HEADER_FORMAT_OPTIONS,
|
892
|
+
"Formatting style for topic titles (#{HEADER_FORMAT_OPTIONS.join(', ')})") do |t|
|
893
|
+
@options[:header_format] = t
|
894
|
+
end
|
895
|
+
|
885
896
|
opts.on('--[no-]color', 'Colorize output (default on)') do |c|
|
886
897
|
@options[:color] = c
|
887
898
|
@options[:highlight] = false unless c
|
@@ -911,6 +922,7 @@ module Howzit
|
|
911
922
|
end.parse!(args)
|
912
923
|
|
913
924
|
@options[:multiple_matches] = @options[:multiple_matches].to_sym
|
925
|
+
@options[:header_format] = @options[:header_format].to_sym
|
914
926
|
|
915
927
|
@cli_args = args
|
916
928
|
end
|
data/lib/howzit/version.rb
CHANGED
data/lib/howzit.rb
CHANGED