From: wmorgan Date: Sat, 8 Dec 2007 22:51:26 +0000 (+0000) Subject: bugfix: mod by zero in completino mode X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=00eb0941076c694b3ce1eeb5ab8487fc93fcf56e;p=sup bugfix: mod by zero in completino mode git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@750 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- diff --git a/lib/sup/modes/completion-mode.rb b/lib/sup/modes/completion-mode.rb index 638c64e..3cb2fad 100644 --- a/lib/sup/modes/completion-mode.rb +++ b/lib/sup/modes/completion-mode.rb @@ -28,7 +28,7 @@ private def update_lines width = buffer.content_width max_length = @list.max_of { |s| s.length } - num_per = buffer.content_width / (max_length + INTERSTITIAL.length) + num_per = [1, buffer.content_width / (max_length + INTERSTITIAL.length)].max @lines = [@header].compact @list.each_with_index do |s, i| if @prefix_len