mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-06 18:54:44 +08:00
Disable smart_auto_mappings by default
Ref: https://github.com/davidhalter/jedi-vim/issues/568
This commit is contained in:
committed by
Dave Halter
parent
f26b2a8802
commit
914754a04e
@@ -34,7 +34,7 @@ let s:default_settings = {
|
|||||||
\ 'popup_select_first': 1,
|
\ 'popup_select_first': 1,
|
||||||
\ 'quickfix_window_height': 10,
|
\ 'quickfix_window_height': 10,
|
||||||
\ 'force_py_version': "'auto'",
|
\ 'force_py_version': "'auto'",
|
||||||
\ 'smart_auto_mappings': 1,
|
\ 'smart_auto_mappings': 0,
|
||||||
\ 'use_tag_stack': 1
|
\ 'use_tag_stack': 1
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
|
|||||||
@@ -498,14 +498,14 @@ Default: "auto"
|
|||||||
6.13. `g:jedi#smart_auto_mappings` *g:jedi#smart_auto_mappings*
|
6.13. `g:jedi#smart_auto_mappings` *g:jedi#smart_auto_mappings*
|
||||||
|
|
||||||
When you start typing `from module.name<space>` jedi-vim automatically
|
When you start typing `from module.name<space>` jedi-vim automatically
|
||||||
adds the "import" statement and displays the autocomplete popup.
|
can add the "import" statement and trigger the autocompletion popup.
|
||||||
|
|
||||||
This option can be disabled in the .vimrc:
|
You can enable this using: >
|
||||||
|
|
||||||
`let g:jedi#smart_auto_mappings = 0`
|
|
||||||
|
|
||||||
|
let g:jedi#smart_auto_mappings = 1
|
||||||
|
<
|
||||||
Options: 0 or 1
|
Options: 0 or 1
|
||||||
Default: 1 (enabled by default)
|
Default: 0 (disabled by default)
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
6.14. `g:jedi#use_tag_stack` *g:jedi#use_tag_stack*
|
6.14. `g:jedi#use_tag_stack` *g:jedi#use_tag_stack*
|
||||||
|
|||||||
@@ -27,15 +27,9 @@ describe 'completions'
|
|||||||
set completeopt-=longest
|
set completeopt-=longest
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'smart import'
|
it 'no smart import by default'
|
||||||
exec "normal ifrom os "
|
exec "normal ifrom os "
|
||||||
Expect getline('.') == 'from os import '
|
Expect getline('.') == 'from os '
|
||||||
end
|
|
||||||
|
|
||||||
it 'no smart import after space'
|
|
||||||
exec "normal! ifrom os "
|
|
||||||
exec "normal a "
|
|
||||||
Expect getline('.') == 'from os '
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'import'
|
it 'import'
|
||||||
@@ -109,4 +103,29 @@ describe 'completions'
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'smart completions'
|
||||||
|
before
|
||||||
|
new
|
||||||
|
let g:jedi#smart_auto_mappings = 1
|
||||||
|
set filetype=python
|
||||||
|
end
|
||||||
|
|
||||||
|
after
|
||||||
|
" default
|
||||||
|
let g:jedi#smart_auto_mappings = 0
|
||||||
|
bd!
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'smart import'
|
||||||
|
exec "normal ifrom os "
|
||||||
|
Expect getline('.') == 'from os import '
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'no smart import after space'
|
||||||
|
exec "normal! ifrom os "
|
||||||
|
exec "normal a "
|
||||||
|
Expect getline('.') == 'from os '
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
" vim: et:ts=4:sw=4
|
" vim: et:ts=4:sw=4
|
||||||
|
|||||||
Reference in New Issue
Block a user