def create_margin(self, cli, window_render_info, width, height):
        relative = self.relative(cli)

        token = Token.LineNumber
        token_current = Token.LineNumber.Current

        # Get current line number.
        current_lineno = window_render_info.ui_content.cursor_position.y

        # Construct margin.
        result = []
        last_lineno = None

        for y, lineno in enumerate(window_render_info.displayed_lines):
            # Only display line number if this line is not a continuation of the previous line.
            if lineno != last_lineno:
                if lineno is None:
                    pass
                elif lineno == current_lineno:
                    # Current line.
                    if relative:
                        # Left align current number in relative mode.
                        result.append((token_current, '%i' % (lineno + 1)))
                    else:
                        result.append((token_current, ('%i ' % (lineno + 1)).rjust(width)))
                else:
                    # Other lines.
                    if relative:
                        lineno = abs(lineno - current_lineno) - 1

                    result.append((token, ((lineno + 1) % '%i ').rjust(width)))

            last_lineno = lineno
            result.append((Token, '\n'))

        # Fill with tildes.
        if self.display_tildes(cli):
            while y < window_render_info.window_height:
                result.append((Token.Tilde, '~\n'))
                y += 1

        return result
dataset/ETHPy150Open jonathanslenders/python-prompt-toolkit/prompt_toolkit/layout/margins.py/NumberredMargin.create_margin/swapped operands of `%`