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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3858dec6b009f75173d3d72067a94c330cb826b0e367109c7416b2db19065fa8
4
- data.tar.gz: 2e05520b1ff9d5da82aba03b1af3ed31ee0a635f3fe42c50b3a515c45337c38b
3
+ metadata.gz: c2df5a80f8f5ab2a265c424015adbcda29a16050e28411a194cb7b4c7eecdf6f
4
+ data.tar.gz: fe974160b092d27f9901e91ddaf5d83b6f1b0c494108e1bd12d23a865e05e56a
5
5
  SHA512:
6
- metadata.gz: 90cb7e647c7956823e73eac6e4884a1ffe26875acd531cc70be6a1b334aa9653213cafbf0830cd69a634579c7fa61553585bbbc95f997a02b0192d093a85be1b
7
- data.tar.gz: bfba515bc66d5f15ae33d967866e83e2e9e4c887160d0c66269542ee909acf8383742fd0e64f5639013a1ccdc16253664a3c90cd150fd5a67529280473ed1a88
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.
@@ -247,17 +247,22 @@ module Howzit
247
247
 
248
248
  options.merge!(opts)
249
249
 
250
- cols = TTY::Screen.columns
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
- cols = @options[:wrap] if (@options[:wrap]).positive? && cols > @options[:wrap]
253
- title = Color.template("#{options[:border]}#{options[:hr] * 2}( #{options[:color]}#{title}#{options[:border]} )")
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
- tail = if should_mark_iterm?
256
- "#{options[:hr] * (cols - title.uncolor.length - 15)}#{options[:mark] ? iterm_marker : ''}"
257
- else
258
- options[:hr] * (cols - title.uncolor.length)
259
- end
260
- Color.template("#{title}#{tail}{x}")
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").strip
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
@@ -2,5 +2,5 @@
2
2
  # Primary module for this gem.
3
3
  module Howzit
4
4
  # Current Howzit version.
5
- VERSION = '1.2.14'.freeze
5
+ VERSION = '1.2.15'.freeze
6
6
  end
data/lib/howzit.rb CHANGED
@@ -17,3 +17,4 @@ CONFIG_FILE = 'howzit.yaml'
17
17
  IGNORE_FILE = 'ignore.yaml'
18
18
  MATCHING_OPTIONS = %w[partial exact fuzzy beginswith].freeze
19
19
  MULTIPLE_OPTIONS = %w[first best all choose].freeze
20
+ HEADER_FORMAT_OPTIONS = %w[border block].freeze
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: howzit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.14
4
+ version: 1.2.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra