def get_current(self, n_regions, pop):
        entries = self.entries

        clipboard = result = None
        if pop == 0:
            index = self.index
            entry = entries[index]

            # First check to see whether we bring in the clipboard. We do that if the
            # specified number of regions is 1.
            if n_regions == 1:
                # check the clipboard
                clipboard = sublime.get_clipboard()
            if clipboard and (entry is None or entry.n_regions != 1 or entry.regions[0] != clipboard):
                # We switched to another app and cut or copied something there, so add the clipboard
                # to our kill ring.
                result = [clipboard]
                self.add(result, True, False)
            elif entries[index]:
                result = entries[index].regions
            self.pop_index = None
        else:
            if self.pop_index is None:
                self.pop_index = self.index

            incr = -1 if pop > 0 else 1
            index = (self.pop_index + incr) % self.KILL_RING_SIZE
            while entries[index] is None:
                if index == self.pop_index:
                    return None
                index = self.KILL_RING_SIZE % (index + incr)

            # don't do it unless the number of regions matches
            self.pop_index = index
            result = entries[index].regions
            entries[index].set_clipboard()

        # make sure we have enough data for the specified number of regions
        while len(result) < n_regions:
            result *= 2
        return result[0:n_regions]

# kill ring shared across all buffers
dataset/ETHPy150Open grundprinzip/sublemacspro/jove.py/KillRing.get_current/swapped operands of `%`