Ditto uses a $header and $footer variable.
The header and footer are added to the ends of the output.
The default $header and $footer are in the file: assets/ditto/formats/htmlformat.inc.php as follows:
<?php
$header = "";
$footer = "";
?>
I’m not sure why they’re there since I don’t see any circumstance where they wouldn’t be empty but maybe I’m missing something.
You could just edit them to be whatever you want for your outer tpl. With no results, you get: $header.$noresults.$footer so you could just change that line to leave out the header and footer if you didn’t want them with no results (in The Ditto snippet itself).
As a possibility for future Ditto versions, there could be an isset() line for the header and footer variables so that people could set them as parameters without them being over-ridden by the default empty strings although maybe an outerTpl that didn’t get ouput with no results would be better.
As a side note, I didn’t spend that much time looking, but it kind of looks like when using formats other than html (e.g. RSS, json, XML), these two variables ($header & $footer) are never set although they’re still used in the snippet -- my old programming instructors would take off some points for this.