def move_selection(self, amount):
        """Jump a number of paths up or down.

        User may optionally extend the selection with
        the items between the path from where we jump
        and the path where we land, by keeping the
        shift key pressed.

        Parameters
        ==========

        amount (integer)
            indicates amount of items to jump back (when
            negative) or forward (when positive).
        """
        ### if there's no paths to be selected, there's
        ### no point in walking any items, so return earlier
        if not self.selectable_paths:
            return

        ### store the length of the selectable paths
        n_of_selectables = len(self.selectable_paths)

        ### store value indicating whether the shift key
        ### was pressed
        shift_pressed = SERVICES_NS.get_pressed_mod_keys() & KMOD_SHIFT

        ### reference last selected index in local variable
        last_selected_index = self.last_selected_index

        ### if shift is not pressed deselect all paths

        if not shift_pressed:

            self.selection_states[:] = [False] * len(self.selection_states)

        ### calculate start index (from where we'll move
        ### the selection) depending on the value of the
        ### last selected index and/or the direction of the
        ### movement

        start_index = (
            ## use the index itself if not None
            last_selected_index
            if last_selected_index is not None
            ## otherwise, define an index based on the
            ## whether you're jumping forward or back
            else (
                # zero
                0
                if amount > 0
                # or the last index
                else -1 % n_of_selectables
            )
        )

        ### calculate the destination index

        destination_index = (
            ## if there were no last selected index before
            ## (it is None) and we are moving a single step
            ## (regardless of direction), make it so the
            ## destination is the start index itself, since
            ## it means we are beginning to select items,
            ## the first one being the start index itself
            start_index
            if last_selected_index is None and abs(amount) == 1
            ## otherwise, the destination index is the start
            ## index plus the amount we'll jump
            else start_index + amount
        )

        ### of course, don't forget to clamp the value to
        ### limit it to the range of selectable paths

        clamped_index = max(0, min(destination_index, n_of_selectables - 1))

        ### make sure the clamped destination index is
        ### selected and marked as the last selected one

        self.selection_states[clamped_index] = True
        self.last_selected_index = clamped_index

        ### if shift is pressed, also select the start
        ### index and then extend the selection

        if shift_pressed:

            self.selection_states[start_index] = True
            self.select_in_range()

        ### perform scrolling if needed in order for the
        ### path of the last selected index to appear on
        ### the screen, storing the return value of the
        ### operation (a boolean indicating whether the
        ### scrolling was performed or not)
        normal_scrolling_needed = self.needed_scrolling()

        ### check whether the destination index was
        ### originally lower than 0 (that is, before
        ### being clampled); if such is the case, it
        ### means that we need to scroll just one
        ### extra path up, so that the first path,
        ### the parent path, appears (the reason the
        ### 'needed_scrolling' method doesn't scroll
        ### per se is that the parent path isn't
        ### selectable, so it is never considered
        ### for selection/jump; it just appears in the
        ### folder as an easy way to get to the parent
        ### folder, so in the end we need to scroll it
        ### ourselves)
        extra_scrolling_needed = destination_index < 0

        ### if such extra scrolling is needed, perform it
        if extra_scrolling_needed:
            self.scroll_up()

        ### if any kind of scrolling was needed, update
        ### the path in each path object and also the
        ### outline rect

        if normal_scrolling_needed or extra_scrolling_needed:

            ## update path of each path object
            self.update_path_objects_paths()

            ## update outline rect attribute
            self.update_outline_rect()

        ### update appearance of all paths
        self.update_path_objs_appearance()

        ### since the selection may have changed, make it
        ### so the file manager updates its path selection
        self.fm.update_entry_with_selected()
Jump a number of paths up or down.

        User may optionally extend the selection with
        the items between the path from where we jump
        and the path where we land, by keeping the
        shift key pressed.

        Parameters
        ==========

        amount (integer)
            indicates amount of items to jump back (when
            negative) or forward (when positive).
        
nodezator/fileman/dirpanel/extraop.py