line_commands.py (1251B)
1 import os 2 import os.path 3 import requests 4 import time 5 from pathlib import Path 6 from talon import ctrl, ui, Module, Context, actions, clip 7 import tempfile 8 9 mod = Module() 10 11 mod.tag( 12 "line_commands", 13 desc="Tag for enabling generic line navigation and selection commands", 14 ) 15 16 17 @mod.action_class 18 class Actions: 19 def extend_until_line(line: int): 20 """Extends the selection from current line to the specified line""" 21 22 def select_range(line_start: int, line_end: int): 23 """Selects lines from line_start to line line_end""" 24 actions.edit.jump_line(line_start) 25 actions.edit.extend_line_end() 26 27 number_of_lines = line_end - line_start 28 for i in range(0, number_of_lines): 29 actions.edit.extend_line_down() 30 actions.edit.extend_line_end() 31 32 def extend_camel_left(): 33 """Extends the selection by camel/subword to the left""" 34 35 def extend_camel_right(): 36 """Extends the selection by camel/subword to the right""" 37 38 def camel_left(): 39 """Moves cursor to the left by camel case/subword""" 40 41 def camel_right(): 42 """Move cursor to the right by camel case/subword""" 43 44 def line_clone(line: int): 45 """Clones specified line at current position""" 46