-
-
Notifications
You must be signed in to change notification settings - Fork 772
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
method motions to include decorators #1015
Conversation
@KamranMaharov can you rebase against the |
ffcb12f
to
4359924
Compare
method motions to include decorators
4359924
to
d4aa916
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 used select_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 been select(pattern, pattern)
to not duplicate pattern all over the script (that would be confusing), we call
select_c(pattern)
and then select_c(pattern)
calls select(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 use async
before decorators right?
So this:
(async<Bslash>s<Bslash>+<Bslash>)<Bslash>=@
have an extra async
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 with async
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