- Implement caching of individual (newline-separated) text lines; this
behaviour can be enabled with a flag (enabled by MORE):
CON_PAGER_CACHE_INCOMPLETE_LINE.
This feature is necessary when reading a text file, whose text lines
may span across two or more successive temporary read buffers, and is
required for correctly determining whether the lines being read are
blank and may be squeezed.
- When squeezing blank lines, the blank-line check must be done for each
line segment corresponding to the screen line (and following) that
need to be displayed. This matches the behaviour of MS MORE.COM.
- Fix the IsBlankLine() check to not consider FORM-FEEDs as being blank
characters: This is necessary for correctly handling FORM-FEED
expansion. Also note that MS MORE.COM only checks for spaces and TABs,
so we are slightly overdoing these checks (considering other types of
whitespace).
- Get rid of ConCallPagerLine() and the intermediate CON_PAGER_DONT_OUTPUT
state flag that were used repeatedly for each and every small line
chunks. Instead, call directly the user-specified 'PagerLine' callback
when we are about to start treating the next line segment to be
displayed (see comment above).
- Fix the exit return condition of ConPagerWorker(): it should return
TRUE whenever we displayed all the required lines, and FALSE otherwise.
Otherwise, the previous (buggy) condition on the data being read from
the text file, may lead to the prompt not showing when a screenful of
text has been displayed, if it happened that the current text buffer
becomes empty at the same time (even if, overall, the text file hasn't
been fully displayed).
- In MorePagerLine(), when we encounter for the first time a blank line
that will be squeezed with other successive ones, display a single
blank line. But for that, just display one space and a newline: this
single space is especially needed in order to force line wrapping when
the ENABLE_VIRTUAL_TERMINAL_PROCESSING or DISABLE_NEWLINE_AUTO_RETURN
console modes are enabled. Otherwise the cursor remains at the
previous line (without wrapping), and just outputting one newline will
not make it move past 2 lines as one would naively expect.
- The column extent should cover the whole width of the console screenbuffer.
On the contrary, the line extent covers only the number of lines that
cover the current displayed console window.
- Since the console can be resized while the pager is prompting, we need
to actually recalculate in the prompt routine the default number of
lines for a screen.
- Reset s_nNextLineNo when paging a new file.
- Shorten the names of the flags: CON_PAGER_FLAG_*** --> CON_PAGER_***.
- Reorder few members in the CON_PAGER pager structure where they make sense.
- ScreenColumns, ScreenRows --> PageColumns, PageRows: keeping the open
possibility for having a pager controlling a region of different size
than the screen.
- Add doxygen documentation for ConWritePaging().
CORE-17601
Dynamically load SetThreadUILanguage(), so as to support systems where this API is not present.
Hopefully implemented in a thread-safe manner.
And, don't emit \r\n when an \r alone is encountered.
This fixes the problem of extra newlines appearing when redirecting
"more" output to a file.
CORE-14592
- Start to doxygenate the library, focusing in great details on the
functions of the "outstream" module.
- Add a K32LoadStringEx function that expands (K32)LoadString by
allowing a LanguageId parameter to be able to load strings from other
languages than the current one.
- Add "ConResMsg*" helper functions to be able to (format and) print
message strings with inserts that come *NOT* from a message table (as
usual) *BUT* from resource string tables.
Will be helpful for CORE-14265 in particular.
[CMD] Fix the call to ConMsgPrintfV().
As code grows, this will allow for better maintenance of the console
stream code. In particular the input stream module will contain special
code for handling TTYs, and this is something not all console programs
will need. Having this code in a separate module will allow for the linker
to possibly remove this code when it is unused.