Moved stateColumns to readerColumns in ReaderOptions.
This commit is contained in:
parent
ef0619cc6d
commit
0d4424c21c
3 changed files with 4 additions and 4 deletions
|
@ -55,6 +55,7 @@ data ReaderOptions = ReaderOptions{
|
||||||
, readerSmart :: Bool -- ^ Smart punctuation
|
, readerSmart :: Bool -- ^ Smart punctuation
|
||||||
, readerStrict :: Bool -- ^ FOR TRANSITION ONLY
|
, readerStrict :: Bool -- ^ FOR TRANSITION ONLY
|
||||||
, readerParseRaw :: Bool -- ^ Parse raw HTML, LaTeX
|
, readerParseRaw :: Bool -- ^ Parse raw HTML, LaTeX
|
||||||
|
, readerColumns :: Int -- ^ Number of columns in terminal
|
||||||
} deriving (Show, Read)
|
} deriving (Show, Read)
|
||||||
|
|
||||||
instance Default ReaderOptions
|
instance Default ReaderOptions
|
||||||
|
@ -63,4 +64,5 @@ instance Default ReaderOptions
|
||||||
, readerSmart = False
|
, readerSmart = False
|
||||||
, readerStrict = False
|
, readerStrict = False
|
||||||
, readerParseRaw = False
|
, readerParseRaw = False
|
||||||
|
, readerColumns = 80
|
||||||
}
|
}
|
||||||
|
|
|
@ -545,7 +545,7 @@ tableWith headerParser rowParser lineParser footerParser = try $ do
|
||||||
lines' <- rowParser indices `sepEndBy1` lineParser
|
lines' <- rowParser indices `sepEndBy1` lineParser
|
||||||
footerParser
|
footerParser
|
||||||
state <- getState
|
state <- getState
|
||||||
let numColumns = stateColumns state
|
numColumns <- getOption readerColumns
|
||||||
let widths = if (indices == [])
|
let widths = if (indices == [])
|
||||||
then replicate (length aligns) 0.0
|
then replicate (length aligns) 0.0
|
||||||
else widthsFromIndices numColumns indices
|
else widthsFromIndices numColumns indices
|
||||||
|
@ -705,7 +705,6 @@ data ParserState = ParserState
|
||||||
-- in parsing dashes; -- is em-dash;
|
-- in parsing dashes; -- is em-dash;
|
||||||
-- before numeral is en-dash
|
-- before numeral is en-dash
|
||||||
stateLiterateHaskell :: Bool, -- ^ Treat input as literate haskell
|
stateLiterateHaskell :: Bool, -- ^ Treat input as literate haskell
|
||||||
stateColumns :: Int, -- ^ Number of columns in terminal
|
|
||||||
stateHeaderTable :: [HeaderType], -- ^ Ordered list of header types used
|
stateHeaderTable :: [HeaderType], -- ^ Ordered list of header types used
|
||||||
stateIndentedCodeClasses :: [String], -- ^ Classes to use for indented code blocks
|
stateIndentedCodeClasses :: [String], -- ^ Classes to use for indented code blocks
|
||||||
stateNextExample :: Int, -- ^ Number of next example
|
stateNextExample :: Int, -- ^ Number of next example
|
||||||
|
@ -737,7 +736,6 @@ defaultParserState =
|
||||||
stateDate = [],
|
stateDate = [],
|
||||||
stateOldDashes = False,
|
stateOldDashes = False,
|
||||||
stateLiterateHaskell = False,
|
stateLiterateHaskell = False,
|
||||||
stateColumns = 80,
|
|
||||||
stateHeaderTable = [],
|
stateHeaderTable = [],
|
||||||
stateIndentedCodeClasses = [],
|
stateIndentedCodeClasses = [],
|
||||||
stateNextExample = 1,
|
stateNextExample = 1,
|
||||||
|
|
|
@ -942,12 +942,12 @@ main = do
|
||||||
stateStandalone = standalone',
|
stateStandalone = standalone',
|
||||||
stateCitations = map CSL.refId refs,
|
stateCitations = map CSL.refId refs,
|
||||||
stateOldDashes = oldDashes,
|
stateOldDashes = oldDashes,
|
||||||
stateColumns = columns,
|
|
||||||
stateOptions = def{
|
stateOptions = def{
|
||||||
readerStrict = strict
|
readerStrict = strict
|
||||||
, readerSmart = smart || (texLigatures &&
|
, readerSmart = smart || (texLigatures &&
|
||||||
(laTeXOutput || writerName' == "context"))
|
(laTeXOutput || writerName' == "context"))
|
||||||
, readerParseRaw = parseRaw
|
, readerParseRaw = parseRaw
|
||||||
|
, readerColumns = columns
|
||||||
},
|
},
|
||||||
stateIndentedCodeClasses = codeBlockClasses,
|
stateIndentedCodeClasses = codeBlockClasses,
|
||||||
stateApplyMacros = not laTeXOutput
|
stateApplyMacros = not laTeXOutput
|
||||||
|
|
Loading…
Reference in a new issue