File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -825,7 +825,8 @@ def lsize():
825825 if self .docstring is None :
826826 self .list_win .resize (rows + 2 , w )
827827 else :
828- docstring = self .format_docstring (self .docstring , max_w - 2 )
828+ docstring = self .format_docstring (self .docstring , max_w - 2 ,
829+ max_h - height_offset )
829830 docstring_string = '' .join (docstring )
830831 rows = len (docstring ) - 1
831832 self .list_win .resize (rows + 3 , max_w )
@@ -869,17 +870,21 @@ def lsize():
869870 self .scr .move (* self .scr .getyx ())
870871 self .list_win .refresh ()
871872
872- def format_docstring (self , docstring , width ):
873+ def format_docstring (self , docstring , width , height ):
873874 """Take a string and try to format it into a sane list of strings to be
874875 put into the suggestion box."""
875876
876877 lines = docstring .split ('\n ' )
877878 out = []
879+ i = 0
878880 for line in lines :
879881 out .append ('\n ' )
882+ i += 1
880883 for block in textwrap .wrap (line , width ):
881884 out .append (' ' + block )
882- w = self .scr .getmaxyx ()[1 ]
885+ if i >= height :
886+ return out
887+ i += 1
883888 return out
884889
885890 def mkargspec (self , topline , down ):
You can’t perform that action at this time.
0 commit comments