Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							1c211f8ab8 
							
						 
					 
					
						
						
							
							cln: hlint: Fix redundant return warning.  
						
						
						
					 
					
						2021-08-26 21:00:35 -10:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							1e69fd81ea 
							
						 
					 
					
						
						
							
							cln: hlint: Remove if warnings.  
						
						
						
					 
					
						2021-08-26 07:23:11 -10:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							063aaf35b5 
							
						 
					 
					
						
						
							
							cln: hlint: Rename pattern variables to avoid hlint parsing errors.  
						
						
						
					 
					
						2021-08-25 20:44:36 -10:00 
						 
				 
			
				
					
						
							
							
								Lawrence Wu 
							
						 
					 
					
						
						
						
						
							
						
						
							f3c07144a8 
							
						 
					 
					
						
						
							
							bal: option to view one commodity per row  
						
						... 
						
						
						
						This adds the `--commodity-column` option that displays each commodity
on a separate line and the commodities themselves as a separate column.
The initial design considerations are at
simonmichael.hledger.issues.1559
The single-period balance report with `--commodity-column` does not
interoperate with custom formats. 
						
					 
					
						2021-08-08 09:19:25 -10:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							613efba1bc 
							
						 
					 
					
						
						
							
							ui: Do not log to debug.log when regenerating journal in Transaction  
						
						... 
						
						
						
						screen (#1556 ). Also really clear cost setting when doing so.
Since plog is no longer used anywhere, and tends to create bugs when it
is, we remove it. 
						
					 
					
						2021-06-30 16:07:32 -10:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							46d3eaf920 
							
						 
					 
					
						
						
							
							;lib: clarify/extend/refactor some line parsing helpers ( #1580 )  
						
						
						
					 
					
						2021-06-23 14:12:17 -10:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							68e975adf1 
							
						 
					 
					
						
						
							
							lib,cli,ui,web: Remove unused LANGUAGE pragmas.  
						
						
						
					 
					
						2021-06-07 17:33:54 -10:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							55308e1ca8 
							
						 
					 
					
						
						
							
							lib,cli,ui,web: Remove unnecessary CPP when dropping support for GHC 8.2.  
						
						
						
					 
					
						2021-06-07 17:33:54 -10:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							e80bb37b1c 
							
						 
					 
					
						
						
							
							lib: Remove unused String utility functions.  
						
						
						
					 
					
						2021-06-03 23:23:54 -10:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							0b419adba2 
							
						 
					 
					
						
						
							
							lib: Remove unused Text utility functions.  
						
						
						
					 
					
						2021-06-03 23:23:54 -10:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							0e59fee251 
							
						 
					 
					
						
						
							
							lib,cli: Export Text.Tabular from Text.Tabular.AsciiWide, clean up import lists.  
						
						
						
					 
					
						2021-06-03 23:23:54 -10:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							483fa9682e 
							
						 
					 
					
						
						
							
							cli: ANSI color is now also disabled by -o/--output-file ( #1533 )  
						
						... 
						
						
						
						ANSI color on stdout (not stderr) is now disabled if the
-o/--output-file option is detected (and its value is not "-").
Added outputFileOption, and more advice in comments. 
						
					 
					
						2021-04-17 16:51:08 -10:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							fe846a0c7f 
							
						 
					 
					
						
						
							
							;lib: comments  
						
						
						
					 
					
						2021-04-17 16:06:20 -10:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							21a49b9479 
							
						 
					 
					
						
						
							
							;lib: note caveats with useColor*  
						
						
						
					 
					
						2021-04-14 06:23:21 -10:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							6298722ade 
							
						 
					 
					
						
						
							
							lib: debug output checks for color support on stderr, not stdout  
						
						... 
						
						
						
						This is more accurate.
useColor is replaced by useColorOnStdout, useColorOnStderr. 
						
					 
					
						2021-04-14 06:23:21 -10:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							2b04b76448 
							
						 
					 
					
						
						
							
							lib: debug output now respects --color/NO_COLOR/ANSI support  
						
						... 
						
						
						
						Debug output now selects color or monochrome in the same way as normal
output. 
						
					 
					
						2021-04-14 06:23:21 -10:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							5e57cfb43e 
							
						 
					 
					
						
						
							
							lib: useColor, colorOption helpers usable anywhere  
						
						
						
					 
					
						2021-04-14 06:23:21 -10:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							5d664fc528 
							
						 
					 
					
						
						
							
							lib: Expose textConcatBottomPadded.  
						
						
						
					 
					
						2021-01-15 12:56:48 -08:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							217bfc5e74 
							
						 
					 
					
						
						
							
							lib: Rename alignCell to textCell, minor cleanups.  
						
						
						
					 
					
						2021-01-15 12:56:48 -08:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							9ad0eef69b 
							
						 
					 
					
						
						
							
							lib: Update textConcatTopPadded to use Tabular.AsciiWide, same as concatTopPadded.  
						
						
						
					 
					
						2021-01-15 12:56:48 -08:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							2c2bd8b27e 
							
						 
					 
					
						
						
							
							lib: Refactor unlinesB to be cleaner and more efficient.  
						
						
						
					 
					
						2021-01-15 12:56:48 -08:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							b203822cd1 
							
						 
					 
					
						
						
							
							lib: Make sure to add a newline to the end of aregister report.  
						
						
						
					 
					
						2021-01-10 20:50:46 -08:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							1ad919bc6d 
							
						 
					 
					
						
						
							
							lib: add level argument to fix traceAtWith  
						
						
						
					 
					
						2021-01-07 08:57:25 -08:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							e63138ef7d 
							
						 
					 
					
						
						
							
							lib,cli: Assorted fixes for older GHC.  
						
						
						
					 
					
						2021-01-02 15:08:09 +11:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							e4e533eb9f 
							
						 
					 
					
						
						
							
							lib,cli,ui: Replace some uses of String with Text, get rid of some unpacks, clean up showMixed options.  
						
						
						
					 
					
						2021-01-02 15:08:09 +11:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							07a7c3d3a8 
							
						 
					 
					
						
						
							
							lib: Use Text and Text builder only in postingAsLines.  
						
						
						
					 
					
						2021-01-02 15:08:09 +11:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							13c111da73 
							
						 
					 
					
						
						
							
							lib,cli,ui: Use WideBuilder for Tabular.AsciiWide.  
						
						... 
						
						
						
						Move WideBuilder to Text.WideString. 
						
					 
					
						2021-01-02 15:08:09 +11:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							0a686e220e 
							
						 
					 
					
						
						
							
							lib: Use AmountDisplayOpts for showAmount*, reducing need for many different named functions.  
						
						
						
					 
					
						2021-01-02 15:08:09 +11:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							5dedec83da 
							
						 
					 
					
						
						
							
							lib: showamountquantity shows directly, rather than parsing string output of show instance for Quantity.  
						
						
						
					 
					
						2021-01-02 15:08:09 +11:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							f998a791cf 
							
						 
					 
					
						
						
							
							lib: Remove unused optional width argument for StringFormat.  
						
						
						
					 
					
						2021-01-02 15:08:09 +11:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							462a13cad7 
							
						 
					 
					
						
						
							
							lib,cli: Use Text Builder for Balance commands.  
						
						
						
					 
					
						2021-01-02 15:08:09 +11:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							74b296f865 
							
						 
					 
					
						
						
							
							lib,cli: Make showTransaction return Text rather than String.  
						
						
						
					 
					
						2021-01-02 15:08:09 +11:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							12a6435c51 
							
						 
					 
					
						
						
							
							lib: Add wrap convenience function.  
						
						
						
					 
					
						2021-01-02 15:08:09 +11:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							31ea37a785 
							
						 
					 
					
						
						
							
							;check: accounts, commodities, payees, ordereddates: improve errors  
						
						... 
						
						
						
						Error messages for these four are now a bit fancier and more
consistent. But not yet optimised for machine readability.
Cf #1436 .
Added to hledger-lib: chomp1, linesPrepend[2]. 
						
					 
					
						2020-12-30 18:13:34 -08:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							12447ffab7 
							
						 
					 
					
						
						
							
							;lib: restore list of hledger debug levels  
						
						
						
					 
					
						2020-12-26 17:27:28 -08:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							a10f9f4ea9 
							
						 
					 
					
						
						
							
							;lib: comment  
						
						
						
					 
					
						2020-12-11 11:11:15 -08:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							44d59eab23 
							
						 
					 
					
						
						
							
							;lib: Hledger.Utils.Debug: haddock  
						
						
						
					 
					
						2020-12-09 13:55:55 -08:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							51e3e9cbfa 
							
						 
					 
					
						
						
							
							;lib: Hledger.Utils.Debug: improve module haddock  
						
						
						
					 
					
						2020-12-09 13:23:30 -08:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							0dc8eca68a 
							
						 
					 
					
						
						
							
							lib: remove partial code from journalApplyAliases etc.  
						
						
						
					 
					
						2020-11-25 21:06:31 -08:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							9b9f2543d8 
							
						 
					 
					
						
						
							
							;lib: regexReplace: note the kind of RegexError still possible  
						
						
						
					 
					
						2020-11-24 09:16:08 -08:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							a97daaf322 
							
						 
					 
					
						
						
							
							lib: replace pretty-show with pretty-simple  
						
						... 
						
						
						
						pretty-simple, already used in .ghci, will hopefully give nicer debug
output, including for values which don't have Read-able Show output.
This should mean that we can start removing custom string-like Show
instances that were a workaround for pretty-show.
We are using the latest version (4.0.0.0) to get compact output.
Here's some old pretty-show output:
 CsvRules
   { rdirectives = [ ( "skip" , "1" ) ]
   , rcsvfieldindexes = [ ( "date" , 1 ) , ( "amount" , 2 ) ]
   , rassignments = [ ( "amount" , "%2" ) , ( "date" , "%1" ) ]
   , rconditionalblocks = []
   }
And the new pretty-simple output:
 CsvRules
   { rdirectives=
     [ ( "skip", "1" ) ]
   , rcsvfieldindexes=
     [ ( "date", 1 ), ( "amount", 2 ) ]
   , rassignments=
     [ ( "amount", "%2" ), ( "date", "%1" ) ]
   , rconditionalblocks= []
   }
Non-compact pretty-simple output would be:
 CsvRules
     { rdirectives=
         [
             ( "skip"
             , "1B"
             )
         ]
     , rcsvfieldindexes=
         [
             ( "date"
             , 1
             )
         ,
             ( "amount"
             , 2
             )
         ]
     , rassignments=
         [
             ( "amount"
             , "%2"
             )
         ,
             ( "date"
             , "%1"
             )
         ]
     , rconditionalblocks=[]
     }
Also:
- Account's Show instance no longer converts : to _ in account names
- drop unused pretty-show dependency from hledger, hledger-ui packages
- regenerate hledger-lib with the older hpack that's shipped in stack 
						
					 
					
						2020-11-10 08:06:11 -08:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							6d7bd9e475 
							
						 
					 
					
						
						
							
							lib: Implement concat(Top|Bottom)Padded in terms of renderRow, allowing them to be width aware.  
						
						
						
					 
					
						2020-11-04 14:25:21 +11:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							a2b7a03fc4 
							
						 
					 
					
						
						
							
							lib,cli: bal uses new amount display functions, no longer needs to strip ansi.  
						
						
						
					 
					
						2020-11-04 14:25:20 +11:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							97545018f4 
							
						 
					 
					
						
						
							
							lib: quoteIfNeeded should not escape the backslashes in unicode code points.  
						
						
						
					 
					
						2020-10-18 21:08:25 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							f78dc639a5 
							
						 
					 
					
						
						
							
							fix a slowdown with report rendering in 1.19.1 ( #1350 )  
						
						... 
						
						
						
						stripAnsi is called many times during rendering (by strWidth), so
should be fast. It was originally a regex replacement, and more
recently a custom parser. The parser was slower, particularly the one
in 1.19.1. See #1350 , and this rough test:
time118ish = timeIt $ print $ length $ concat $ map (fromRight undefined . regexReplace (toRegex' "\ESC\\[([0-9]+;)*([0-9]+)?[ABCDHJKfmsu]") "") testdata
time119    = timeparser (many (takeWhile1P Nothing (/='\ESC') <|> "" <$ ansi))
time1191   = timeparser (many ("" <$ try ansi <|> pure <$> anySingle))
timeparser p = timeIt $ print $ length $ concat $ map (concat . fromJust . parseMaybe p) testdata
testdata = concat $ replicate 10000
    [ "2008-01-01 income               assets🏦 checking            $1            $1"
    , "2008-06-01 gift                 assets🏦 checking            $1            $2"
    , "2008-06-02 save                 assets🏦 saving              $1            $3"
    , "                                assets🏦 checking  ..m$-1\ESC[m\ESC[m            $2"
    , "2008-06-03 eat & shop           assets:cash           ..m$-2\ESC[m\ESC[m             0"
    , "2008-12-31 pay off              assets🏦 checking  ..m$-1\ESC[m\ESC[m  ..m$-1\ESC[m\ESC[m"
    ]
ghci> time118ish
4560000
CPU time:   0.17s
ghci> time119
4560000
CPU time:   0.91s
ghci> time1191
4560000
CPU time:   2.76s
Possibly a more careful parser could beat regexReplace. Note the
latter does memoisation, which could be faster and/or could also use
more resident memory in some situations.
Ideally we would calculate all widths before adding ANSI colour codes,
so we wouldn't have to wastefully strip them. 
						
					 
					
						2020-09-10 18:07:40 -07:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							600dab3976 
							
						 
					 
					
						
						
							
							lib: Correctly strip ansi sequences with no numbers/semicolons.  
						
						
						
					 
					
						2020-09-06 19:11:28 -07:00 
						 
				 
			
				
					
						
							
							
								Simon Michael 
							
						 
					 
					
						
						
						
						
							
						
						
							a9fbaaf284 
							
						 
					 
					
						
						
							
							;partial comment cleanups  
						
						
						
					 
					
						2020-09-03 09:52:00 -07:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							7d1e6d7d12 
							
						 
					 
					
						
						
							
							lib: Fix quoteIfNeeded so it actually escapes quotes.  
						
						
						
					 
					
						2020-09-01 11:41:55 +10:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							07dd30c1e5 
							
						 
					 
					
						
						
							
							lib,cli,ui: Change to consistent naming scheme for Hledger.Utils.Regex.  
						
						
						
					 
					
						2020-09-01 11:36:34 +10:00 
						 
				 
			
				
					
						
							
							
								Stephen Morgan 
							
						 
					 
					
						
						
						
						
							
						
						
							b91b391d08 
							
						 
					 
					
						
						
							
							lib: Replace some regex functions with parsers.  
						
						
						
					 
					
						2020-08-31 22:44:41 +10:00