Commits

Anonymous committed 5923886

lisputils: cleaning up create_buffer

  • Participants
  • Parent commits 3646cb1

Comments (0)

Files changed (2)

ropemacs/interface.py

             docs = '\n'.join(docs.split('\n')[:7])
             lisputils.message(docs)
         else:
+            fit_lines = lisp["ropemacs-max-doc-buffer-height"].value()
             buffer = lisputils.make_buffer('*rope-pydoc*', docs,
                                            empty_goto=False,
-                                           fit_lines = lisp["ropemacs-max-doc-buffer-height"].value())
+                                           fit_lines=fit_lines)
             lisp.local_set_key('q', lisp.bury_buffer)
 
     @local_command('a f', shortcut='C-c f')

ropemacs/lisputils.py

         elif window == 'other':
             new_window = lisp.display_buffer(new_buffer)
             lisp.set_window_point(new_window, lisp.point_min())
-            if fit_lines != None:
-                max_height = min(fit_lines,
-                                 lisp.count_lines(lisp.point_min(),
-                                                  lisp.point_max())) + 1
-                lisp.fit_window_to_buffer(new_window, max_height, max_height)
+            if fit_lines is not None:
+                lisp.fit_window_to_buffer(new_window, fit_lines)
 
         lisp.goto_char(lisp.point_min())
     return new_buffer