Skip to content
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

Smart import mapping #454

Merged
merged 5 commits into from Aug 19, 2015

Conversation

@aliev
Copy link
Contributor

commented Aug 19, 2015

No description provided.

aliev and others added some commits Aug 17, 2015

Smart completion after "from foo": add "import" and complete
This adds a new setting `jedi#smart_auto_mappings` (default 1).
jedi#smart_auto_mappings: always 'popup_on_dot'
`popup_on_dot=1` means that it should not auto-select the first entry,
which is the case for the new smart-import-mapping.
smart_auto_mappings: use C-r instead of expr-mapping
This makes it work in tests.  Using `<expr>` instead will not trigger
the expansion of the mapping.
This is likely a bug in vim-vspec; I have tried 1.4.1 (currently pinned)
and 1.6.1.

@blueyed blueyed merged commit 91c2a03 into master Aug 19, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

blueyed added a commit that referenced this pull request Aug 19, 2015

Merge pull request #454 from davidhalter/smart-import-mapping
Smart import mapping

Closes #453.
Closes #454.
@blueyed

This comment has been minimized.

Copy link
Collaborator

commented Aug 19, 2015

@aliev
To quote you from #453:

Sorry for another one PR

;)

There wasn't really a need for a new PR - but it's good maybe for looking at it in the future.

Anyway, thanks for adding and pushing this nice feature! 👍

@blueyed blueyed deleted the smart-import-mapping branch Aug 19, 2015

@aliev

This comment has been minimized.

Copy link
Contributor Author

commented Aug 19, 2015

@blueyed oh sorry, I think I missed.It may be better to add <silent> for inoremap <buffer> <space> <C-R>=jedi#smart_auto_mappings()<CR>?

and it seems after changing to the <C-R> appears flashing cursor while typing :-D

@blueyed

This comment has been minimized.

Copy link
Collaborator

commented Aug 19, 2015

It may be better to add

True.

and it seems after changing to the appears flashing cursor :-D

What do you mean? Can you elaborate?

Also, I think we should use some delay: because if you keep typing the "import" yourself, it might get annoying quickly.
I think the mechanism from #436 could be used. But then again an additional timeout will slow it down in general - so therefore you should probably get used to it, or disable it.. :)

@aliev

This comment has been minimized.

Copy link
Contributor Author

commented Aug 19, 2015

@blueyed alright :) what about silent? create another one PR?

What do you mean? Can you elaborate?
Also, I think we should use some delay: because if you keep typing the "import" yourself, it might get annoying quickly.

yes in general it is annoying :) when I typing text, cursor is blinking and "slightly slows"

example:
https://dl.dropboxusercontent.com/u/5837324/blinking.mov

@blueyed

This comment has been minimized.

Copy link
Collaborator

commented Aug 19, 2015

what about silent? create another one PR?

Committed/pushed already.. (3f259c2) :)

I cannot reproduce the general flickering when pressing space (with or without <silent> and with both Vim and Neovim).
The <silent> fixed the display of the popup function (jedi#complete_opened?).
Does the <silent> fix the general flickering for you?

@aliev

This comment has been minimized.

Copy link
Contributor Author

commented Aug 19, 2015

The <silent> fixed the display of the popup function (jedi#complete_opened?).

yes.

Does the <silent> fix the general flickering for you?

nope :( cursor blinking occurs while pressing the space bar. This causes a feeling of braking editor at fast typing

@aliev

This comment has been minimized.

Copy link
Contributor Author

commented Aug 19, 2015

@blueyed I made a more detailed video: https://dl.dropboxusercontent.com/u/5837324/blink.mov

it seems the problem occurs only when the cursor shape is enabled :)

@davidhalter

This comment has been minimized.

Copy link
Owner

commented Aug 20, 2015

Thanks so much @blueyed and @aliev. Really good work.

@blueyed

This comment has been minimized.

Copy link
Collaborator

commented Aug 20, 2015

@aliev

it seems the problem occurs only when the cursor shape is enabled :)

Are you using Neovim? If not, how do you configure it, and what version of Vim are you using?
I assume that it worked better with the `´ mapping?

I have different cursor shapes, too (natively supported by Neovim, custom config with Vim), and it works.

What are you using to record the videos. I've tried https://asciinema.org/, but the (i-beam) cursor shape is not handled/visible in the recorded video.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.