class_docstr: Control that shows the meta information of the selected token.
class_docstr_tok: ["Control","that","shows","the","meta","information","of","the","selected","token","."]
docstr: Report the width of the longest meta text as the preferred width of this control.
  
  It could be that we use less width, but this way, we're sure that the
  layout doesn't change when we select another completion (E.g. that
  completions are suddenly shown in more or fewer columns.)
docstr_tok: ["Report","the","width","of","the","longest","meta","text","as","the","preferred","width","of","this","control",".","It","could","be","that","we","use","less","width",",","but","this","way",",","we","'re","sure","that","the","layout","does","n't","change","when","we","select","another","completion","(","E.g",".","that","completions","are","suddenly","shown","in","more","or","fewer","columns",".",")"]
code: def preferred_width(self, cli, max_available_width):
      """
      Report the width of the longest meta text as the preferred width of this control.
  
      It could be that we use less width, but this way, we're sure that the
      layout doesn't change when we select another completion (E.g. that
      completions are suddenly shown in more or fewer columns.)
      """
      if cli.current_buffer.complete_state:
          state = cli.current_buffer.complete_state
          return 2 + max(
              get_cwidth(c.display_meta)
              for c in state.current_completions
          )
      else:
          return 0
  
imports: from __future__ import unicode_literals
  from six.moves import zip_longest, range
  from prompt_toolkit.filters import HasCompletions, IsDone, Condition, to_cli_filter
  from prompt_toolkit.mouse_events import MouseEventType
  from prompt_toolkit.token import Token
  from prompt_toolkit.utils import get_cwidth
  from .containers import Window, HSplit, ConditionalContainer, ScrollOffsets
  from .controls import UIControl, UIContent
  from .dimension import LayoutDimension
  from .margins import ScrollbarMargin
  from .screen import Point, Char
  import math
label_desc: Use image node_id 1 for calling the _SelectedCompletionMetaControl obj's underlying member method code with example usage: obj.preferred_width(cli, max_available_width) and returns: unknown, int