# Path: operators/tools/get_base_strip.py
# def get_base_strip(strip, base_strips):
#     """Get the strip's base strip"""
#     for i in range(len(base_strips)):
#         if base_strips[i].frame_start <= strip.frame_start:
#             if base_strips[i].frame_final_end >= strip.frame_final_end:
#                 return base_strips[i]
# 
# Path: operators/tools/get_text_strips.py
# def get_text_strips(scene, channel=None):
#     """Get all the text strips in the edit channel"""
# 
#     if channel == None:
#         channel = scene.subtitle_edit_channel
# 
#     all_strips = list(sorted(scene.sequence_editor.sequences,
#             key=lambda x: x.frame_start))
# 
#     text_strips = []
#     for strip in all_strips:
#         if (strip.channel == channel and
#                 strip.type == 'TEXT'):
#             text_strips.append(strip)
# 
#     return text_strips


import bpy
from .tools.get_base_strip import get_base_strip
from .tools.get_text_strips import get_text_strips
            text_strips = list(reversed(get_text_strips(scene)))

            if len(text_strips) == 0:
                return {"FINISHED"}
        except AttributeError:
            return {"FINISHED"}

        current_frame = scene.frame_current
        base_channel = text_strips[0].channel - 1
        base_strips = get_text_strips(scene, channel=base_channel)

        for i in range(len(text_strips)):
            strip = text_strips[i]
            start = strip.frame_final_start
            end = strip.frame_final_end

            if current_frame > start and current_frame <= end:
                strip.frame_final_end = current_frame
                return {"FINISHED"}

            elif current_frame > end:
                if not strip.name.endswith('[locked end]'):
                    strip.frame_final_end = current_frame
                    return {"FINISHED"}

                elif len(base_strips) == 0:
                    strip.frame_final_end = current_frame
                    return {"FINISHED"}

                else:

# Path: operators/tools/get_base_strip.py
# def get_base_strip(strip, base_strips):
#     """Get the strip's base strip"""
#     for i in range(len(base_strips)):
#         if base_strips[i].frame_start <= strip.frame_start:
#             if base_strips[i].frame_final_end >= strip.frame_final_end:
#                 return base_strips[i]
# 
# Path: operators/tools/get_text_strips.py
# def get_text_strips(scene, channel=None):
#     """Get all the text strips in the edit channel"""
# 
#     if channel == None:
#         channel = scene.subtitle_edit_channel
# 
#     all_strips = list(sorted(scene.sequence_editor.sequences,
#             key=lambda x: x.frame_start))
# 
#     text_strips = []
#     for strip in all_strips:
#         if (strip.channel == channel and
#                 strip.type == 'TEXT'):
#             text_strips.append(strip)
# 
#     return text_strips


# Path: operators/shortcuts.py
import bpy
from .tools.get_base_strip import get_base_strip
from .tools.get_text_strips import get_text_strips

            text_strips = list(reversed(get_text_strips(scene)))

            if len(text_strips) == 0:
                return {"FINISHED"}
        except AttributeError:
            return {"FINISHED"}

        current_frame = scene.frame_current
        base_channel = text_strips[0].channel - 1
        base_strips = get_text_strips(scene, channel=base_channel)

        for i in range(len(text_strips)):
            strip = text_strips[i]
            start = strip.frame_final_start
            end = strip.frame_final_end

            if current_frame > start and current_frame <= end:
                strip.frame_final_end = current_frame
                return {"FINISHED"}

            elif current_frame > end:
                if not strip.name.endswith('[locked end]'):
                    strip.frame_final_end = current_frame
                    return {"FINISHED"}

                elif len(base_strips) == 0:
                    strip.frame_final_end = current_frame
                    return {"FINISHED"}

                else:

                    base = get_base_strip(strip, base_strips)