Prevent gutter height from forcing a scrollbar when none is needed

Issue #1999