Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork773
method motions to include decorators#1015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
method motions to include decorators#1015
Uh oh!
There was an error while loading.Please reload this page.
Conversation
@KamranMaharov can you rebase against the |
ffcb12f
to4359924
Comparemethod motions to include decorators
4359924
tod4aa916
Compare@diraol , done. |
onoremap <buffer> iM :<C-U>call pymode#motion#select('^<Bslash>s*<Bslash>(async<Bslash>s<Bslash>+<Bslash>)<Bslash>=def<Bslash>s', 1)<CR> | ||
vnoremap <buffer> aM :<C-U>call pymode#motion#select('^<Bslash>s*<Bslash>(async<Bslash>s<Bslash>+<Bslash>)<Bslash>=def<Bslash>s', 0)<CR> | ||
vnoremap <buffer> iM :<C-U>call pymode#motion#select('^<Bslash>s*<Bslash>(async<Bslash>s<Bslash>+<Bslash>)<Bslash>=def<Bslash>s', 1)<CR> | ||
onoremap <buffer> C :<C-U>call pymode#motion#select_c('^<Bslash>s*class<Bslash>s', 0)<CR> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Hi@KamranMaharov
Why have you usedselect_c
over here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
good point. it could have beenselect(pattern, pattern)
to not duplicate pattern all over the script (that would be confusing), we callselect_c(pattern)
and thenselect_c(pattern)
callsselect(pattern, pattern)
vnoremap <buffer> aC :<C-U>call pymode#motion#select_c('^<Bslash>s*class<Bslash>s', 0)<CR> | ||
vnoremap <buffer> iC :<C-U>call pymode#motion#select_c('^<Bslash>s*class<Bslash>s', 1)<CR> | ||
onoremap <buffer> M :<C-U>call pymode#motion#select('^<Bslash>s*<Bslash>(async<Bslash>s<Bslash>+<Bslash>)<Bslash>=@', '^<Bslash>s*<Bslash>(async<Bslash>s<Bslash>+<Bslash>)<Bslash>=def<Bslash>s', 0)<CR> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Shouldn't@
be an optional "group"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Also, for a decorator, we don't useasync
before decorators right?
So this:
(async<Bslash>s<Bslash>+<Bslash>)<Bslash>=@
have an extraasync
doesn't? [sorry if I didn't understand the regexes correctly].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
i'm not familiar withasync
keyword.
as far as i can tell, it was here before and we could use it for matching decorator pattern.
Also, can you provide a sample code for us to test it? I'm thinking in adding such |
python file for testing motions
@diraol added sample test file. it is based on the code which you provided for testing.
|
method motions to include decorators