8000 Fix documentation class and function text objects don't work in norma… · python-mode/python-mode@c47e6db · GitHub
[go: up one dir, main page]

Skip to content

Commit c47e6db

Browse files
committed
Fix documentation class and function text objects don't work in normal mode
1 parent f78ff46 commit c47e6db

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

doc/pymode.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,10 @@ Key Command
209209
]] Jump to next class or function (normal, visual, operator modes)
210210
[M Jump to previous class or method (normal, visual, operator modes)
211211
]M Jump to next class or method (normal, visual, operator modes)
212-
aC Select a class. Ex: vaC, daC, yaC, caC (normal, operator modes)
213-
iC Select inner class. Ex: viC, diC, yiC, ciC (normal, operator modes)
214-
aM Select a function or method. Ex: vaM, daM, yaM, caM (normal, operator modes)
215-
iM Select inner function or method. Ex: viM, diM, yiM, ciM (normal, operator modes)
212+
aC Select a class. Ex: vaC, daC, yaC, caC (operator modes)
213+
iC Select inner class. Ex: viC, diC, yiC, ciC (operator modes)
214+
aM Select a function or method. Ex: vaM, daM, yaM, caM (operator modes)
215+
iM Select inner function or method. Ex: viM, diM, yiM, ciM (operator modes)
216216
==== ============================
217217

218218
Enable pymode-motion *'g:pymode_motion'*

pymode/rope.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -924,13 +924,17 @@ def _insert_import(name, module, ctx):
924924
@env.catch_exceptions
925925
def select_logical_line():
926926
source, offset = env.get_offset_params()
927+
count = int(env.var('v:count1'))
927928

928929
lines = codeanalyze.SourceLinesAdapter(source)
929-
lineno = lines.get_line_number(offset)
930+
start_line = lines.get_line_number(offset)
930931
line_finder = codeanalyze.LogicalLineFinder(lines)
931-
start, end = line_finder.logical_line_in(lineno)
932932

933-
env.select_line(start, end)
933+
start_lineno, _ = line_finder.logical_line_in(start_line)
934+
for _, (_, end_lineno) in zip(range(count), line_finder.generate_regions(start_line)):
935+
pass
936+
937+
env.select_line(start_lineno, end_lineno)
934938

935939

936940
# Monkey patch Rope

0 commit comments

Comments
 (0)
0