本文整理汇总了Python中vintage.transform_selection函数的典型用法代码示例。如果您正苦于以下问题:Python transform_selection函数的具体用法?Python transform_selection怎么用?Python transform_selection使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了transform_selection函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: run
def run(self, edit, repeat, extend=True):
line_nr = self.view.rowcol(self.view.sel()[0].a)[0] if \
int(repeat) == 1 else int(repeat) - 1
point = self.view.line(self.view.text_point(line_nr, 0)).a
point = advance_while_white_space_character(self.view, point)
transform_selection(self.view, lambda pt: point, extend)
self.view.run_command('show_at_center')
开发者ID:Acathur,项目名称:sublime,代码行数:7,代码来源:vintage_motions.py
示例2: run
def run(self, edit, extend = True):
screenful = self.view.visible_region()
row_a = self.view.rowcol(screenful.a)[0]
row_b = self.view.rowcol(screenful.b)[0]
middle_row = (row_a + row_b) / 2
middle_point = self.view.text_point(middle_row, 0)
transform_selection(self.view, lambda pt: middle_point, extend=extend)
self.view.run_command('vi_move_to_first_non_white_space_character')
开发者ID:piouPiouM,项目名称:SublimeText2-Config,代码行数:11,代码来源:vintage_motions.py
示例3: run
def run(self, edit, repeat=1):
repeat = int(repeat)
if repeat == 1:
re_brackets = re.compile(r"([(\[{])|([)}\])])")
def move_to_next_bracket(pt):
line = self.view.line(pt)
remaining_line = self.view.substr(sublime.Region(pt, line.b))
match = re_brackets.search(remaining_line)
if match:
return pt + match.start() + (1 if match.group(2) else 0)
else:
return pt
transform_selection(self.view, move_to_next_bracket, extend=True)
self.view.run_command("move_to", {"to": "brackets", "extend": True, "force_outer": True})
else:
self.move_by_percent(repeat)
开发者ID:tom-kuca,项目名称:Vintage,代码行数:16,代码来源:vintage_motions.py
示例4: move_by_percent
def move_by_percent(self, percent):
destination = int(self.view.size() * (percent / 100.0))
transform_selection(self.view, lambda pt: destination)
开发者ID:piouPiouM,项目名称:SublimeText2-Config,代码行数:3,代码来源:vintage_motions.py
示例5: run
def run(self, edit, extend = False):
transform_selection(self.view, lambda pt: self.first_character(pt),
extend=extend)
开发者ID:IanVaughan,项目名称:SublimeTextSettings,代码行数:3,代码来源:vintage_motions.py
示例6: move_by_percent
def move_by_percent(self, percent):
destination = int(self.view.rowcol(self.view.size())[0] * (percent / 100.0))
destination = self.view.line(self.view.text_point(destination, 0)).a
destination = advance_while_white_space_character(self.view, destination)
transform_selection(self.view, lambda pt: destination)
开发者ID:Acathur,项目名称:sublime,代码行数:6,代码来源:vintage_motions.py
注:本文中的vintage.transform_selection函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论