-
Notifications
You must be signed in to change notification settings - Fork 28
Add the ability to take screen dumps of the color schemes #281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Ho! A visual regression testing framework in vimscript! Will test this and colortemplate v3 ASAP. Thank you. |
This commit adds functions to take screen dumps of the output of the `sample*.vim` scripts already in the repo. This enables the automatic comparison of the visual appearance of a color scheme before and after some changes are applied. In particular, this may turn useful to avoid unwanted changes when one update a template in a way that should not affect the visual appearance of a color scheme.
Also, fix a couple of typos.
echohl ErrorMsg | ||
echo 'ErrorMsg' | ||
echohl ModeMsg | ||
echo 'ModeMsg' | ||
echohl MoreMsg | ||
echo 'MoreMsg' | ||
echohl Question | ||
echo 'Question' | ||
echohl WarningMsg | ||
echo 'WarningMsg' | ||
echohl None | ||
endfunction | ||
call feedkeys(':call Echoes()') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This did not play well with screen dumps, because the code that starts Vim in a terminal window needs to checks that the screen has been drawn and for that it relies on the presence of the ruler. That's why I have rewritten this as below.
One thing that is not clear to me is to what extent the screen dumps taken in different terminals are comparable. It would be great if reference screen dumps could be committed to the repo (as Vim does for |
Add a script to take screen dumps under various conditions, and another script to compare the results.
With the previous version it was way too easy to accidentally set reference and new scripts to the same files.
Related to this PR, today I've noticed this script: https://github.com/vim/vim/blob/master/src/testdir/commondumps.vim. If you decide to merge this PR, then you may also take a look at that. It might be useful for this repository. too. |
The command-line completion would change if files or directories were created. Adding `sample` ensures that the command line shows the same items even if the content of the directory changes between a screen dump and the next one (well, at least if files whose name starts with `sample` are created).
This is needed to avoid type errors when a list passed to `mapnew()` is empty, Without the type annotations, the resulting inferred type would otherwise be `list<any>`.
Signed-off-by: Lifepillar <[email protected]>
This commit adds scripts to take screen dumps of the output of the
sample*.vim
scripts, and verify that such screen dumps match against some reference.This enables the automatic comparison of the visual appearance of a color scheme before and after some changes are applied. In particular, this may turn useful to avoid unwanted changes when a template is updated in a way that should not affect the visual appearance of a color scheme, as is the case, for instance, for #280.
Usage:
$VIMRUNTIME
) and screen dumps to compare against (taken from./colors
):Adjust the variables in
take_screendumps.vim
to take screenshots for different color schemes under various conditions.I'd recommend to run the above in GUI Vim, so that GUI values and all
t_Co
values can be tested.Eye candy:
The following is kept for reference, but is superseded by the above:
You may source this script to get an idea of how that is meant to work:
Edit: added call to
term_dumpdiff()
.