Fix ANSI detection regex to not always match (non-ANSI files as well.) Change the * on the outer () group to a +, so that at least one ANSI code must be matched. This behavior is triggered in Ubuntu gawk 4.1.1, for whatever reason it was not triggered on my Mac which I believe was using gawk 4.1.3. Will need to investigate further.
Remove set nocp nomdeline bg=dark from vimcat invokation options from within vimpager. nomodeline is unnecessary as a modeline can't really break anything, and a user may use it to set the filetype or color options. nocp is unnecessary as we always invoke vim with -N now. bg=dark resets the color scheme and breaks the 'hi Normal ctermbg=NONE' command that vimcat runs, turning the background color back on.
Many color schemes set the ctermbg (terminal background color) and this does not work well in vimcat, because it outputs ANSI reset codes at the end of every line. TODO: fix this so that only necessary reset codes are output Add the command: hi Normal ctermbg=NONE to the list of default commands for vimcat. I would suspect most people don't want the background color even if it worked correctly, although fixing this would still be a good thing. This can be overridden with a -c option by e.g. re-running the colors command, like -c 'colors apprentice' . Rebuild vimpager with updated vimcat.
Update LICENSE to specify which parts of the project are BSD 2-clause and which parts are Vim license, and state the dual-license nature of the project more explicitly. Include the Vim license, uganda.txt as required by the Vim license and refer to it in LICENSE. Add willywampa to CONTRIBUTORS for b45896e . Update date stamps on docs. Add a note to doc/vimcat.md about the bg=dark default and how to override it, and give more details about the "-o -" option.
columns in vim are byte offsets, even when multibyte chars are present. Use byte offsets when iterating over lines using the str[off] syntax to get correct column indices. This is also considerably faster and fixes the issues with concealed item checking code.
The conceal support code in vimcat is not working properly yet for some reason, turn it off for now. Split each line with split(line, '\zs') into chars and use the chars array instead of matchstr to get characters at a position. This should be faster.
Go back to using matchstr to get the current column from a line instead of strpart because matchstr works on characters while strpart works only on bytes, and this can break unicode text. Also I did not use strpart correctly anyway, it uses a zero index but the column index is one based, so it was eating the first character of lines. Also check for a concealed item earlier and don't output ANSI codes for concealed items.
Add -o option to specify output file for vimcat, with this option whether or not output is a terminal is ignored. If output_file is - then the output is written to STDOUT, but without the extra newline if there isn't one on the last line. If there is no -o option, then the normal behavior of passing through to cat if the output is not a terminal is preserved. Update docs/vimpager.md to describe the -o option.
Enter visual mode in vimcat as the very first --cmd, so that user --cmd and -c commands are in visual mode. Fix number of :endif commands after the :if 0 block enclosing the shell script portion. The source command for the vim script has to be run through silent! because it complains about the first # shell comment in the :if 0 block, giving the error "trailing characters".
The Makefile now does a real incremental build of vimpager and the man pages. Works perfectly on Solaris make as well. uuencode is no longer necessary for building an up to date repo. AnsiEsc is now stored in vimpager as the three .vim files, not as a tar, this makes the incremental build simpler. The output of the make process is now much more concise and user-friendly. Just one line messages instead of huge screenfulls of cryptic commands.
Put all .vim sources into src/ and use an implicit make rule to build them into uuencoded versions. Use variables for Makefile deps. Put prototypes/ and patches/ into src/ . Put vimpager.md and vimcat.md into doc/ . Update Makefile for these changes. Put ConcealRetab.vim into autoload/ in the built extra runtime path and rewrite the function and the invocation as an autoload function.
A construct such as: if exists('vimpager') let vimpager_some_option = 1 endif did not work because the vim invocation that read the configuration did not set the vimpager variable. Add --cmd 'let vimpager = 1' to the vim invocation that reads the vimpager configuration.
Allow setting vimpager_less_mode = 0 to disabling loading less.vim entirely. Move foldlevel setting into less.vim and only default to scrolloff=5 if less.vim is loaded, this is set in less.vim itself as well. Remove nomodeline setting, as we now use silent! e to load files, modeline errors are not an issue, and allowing modelines can help users get the right filetype and also makes help work correctly.