Author: Kevin Schoon [kevinschoon@gmail.com]
Hash: d929df01662f1cbd12f86ed2e7a440e6d4e25f8f
Timestamp: Wed, 16 Sep 2020 19:16:16 +0000 (4 years ago)

+12 -10 +/-3 browse
expand list output format
1diff --git a/lib/cmd.ml b/lib/cmd.ml
2index 963f8d5..0a96d26 100644
3--- a/lib/cmd.ml
4+++ b/lib/cmd.ml
5 @@ -270,7 +270,7 @@ note ls
6 in
7 fun () ->
8 let open Note.Filter in
9- let style = if simple then Simple else Fancy in
10+ let style = if simple then Simple else Fixed in
11 let filter_kind = if fulltext then Some Fulltext else None in
12 let notes =
13 Note.Filter.find_many ?strategy:filter_kind ~args:filter_args
14 diff --git a/lib/note.ml b/lib/note.ml
15index 8a24927..3605486 100644
16--- a/lib/note.ml
17+++ b/lib/note.ml
18 @@ -201,7 +201,7 @@ module Display = struct
19
20 open ANSITerminal
21
22- type style = Fancy | Simple
23+ type style = Fixed | Wide | Simple
24
25 type cell = string * ANSITerminal.style list
26
27 @@ -265,12 +265,14 @@ module Display = struct
28 cells
29
30 let print_short ~style notes =
31+ let cells = to_cells notes in
32 match style with
33- | Simple -> List.iter ~f:(fun note -> print_endline (get_title note)) notes
34- | Fancy ->
35- let cells = to_cells notes in
36- let widths = fix_right (fixed_spacing cells) in
37- let spaced = apply widths cells in
38- List.iter ~f:(fun spaced_row -> print_endline spaced_row) spaced
39-
40+ | Simple ->
41+ List.iter
42+ ~f:(fun cell -> print_endline (fst (List.nth_exn cell 0)))
43+ cells
44+ | Fixed -> List.iter ~f:print_endline (apply (fixed_spacing cells) cells)
45+ | Wide ->
46+ List.iter ~f:print_endline
47+ (apply (fix_right (fixed_spacing cells)) cells)
48 end
49 diff --git a/lib/note.mli b/lib/note.mli
50index 99781c7..2969487 100644
51--- a/lib/note.mli
52+++ b/lib/note.mli
53 @@ -57,7 +57,7 @@ module Filter : sig
54 end
55
56 module Display : sig
57- type style = Fancy | Simple
58+ type style = Fixed | Wide | Simple
59
60 type cell = string * ANSITerminal.style list
61