Skip to content

Commit

Permalink
Add an option to enable/disable case insensitive completion.
Browse files Browse the repository at this point in the history
Options:
- Global option: g:jedi#case_insensitive_completion
- Buffer-local option: b:jedi_case_insensitive_completion

Values:
- 0 to disable case insensitive completion.
- 1 to enable case insensitive completion (default).
  • Loading branch information
jamescherti committed Jan 29, 2022
1 parent 08ad42e commit 873ee93
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@ Stevan Milic (@stevanmilic) <[email protected]>
Konstantin Glukhov (@Konstantin-Glukhov)
Seungchan An (@SeungChan92) <[email protected]>
Thomas Blauth (@ThomasBlauth) <[email protected]>
James Cherti (@jamescherti)

@something are github user names.
1 change: 1 addition & 0 deletions autoload/jedi.vim
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ let s:default_settings = {
\ 'added_sys_path': '[]',
\ 'project_path': "'auto'",
\ 'smart_auto_mappings': 0,
\ 'case_insensitive_completion': 1,
\ 'use_tag_stack': 1
\ }

Expand Down
14 changes: 14 additions & 0 deletions doc/jedi-vim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Contents *jedi-vim-contents*
6.15. environment_path |g:jedi#environment_path|
|b:jedi_environment_path|
6.16. added_sys_path |g:jedi#added_sys_path|
6.17. case_insensitive_completion |g:jedi#case_insensitive_completion|
|b:jedi_case_insensitive_completion|
7. Testing |jedi-vim-testing|
8. Contributing |jedi-vim-contributing|
9. License |jedi-vim-license|
Expand Down Expand Up @@ -533,6 +535,18 @@ To add extra sys_path.
Examples: ["../site-packages"]
Default: []

------------------------------------------------------------------------------
6.17. `g:jedi#case_insensitive_completion` *g:jedi#case_insensitive_completion*
*b:jedi_case_insensitive_completion*

0 to disable case insensitive completion.
1 to enable case insensitive completion (default).

The buffer-local variable `b:jedi_case_insensitive_completion` can be used to
override the global variable `g:jedi#case_insensitive_completion`.

Default: 1

==============================================================================
7. Testing *jedi-vim-testing*

Expand Down
4 changes: 4 additions & 0 deletions pythonx/jedi_vim.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ def get_pos(column=None):
@_check_jedi_availability(show_error=False)
@catch_and_print_exceptions
def completions():
jedi.settings.case_insensitive_completion = \
bool(int(vim_eval("get(b:, 'jedi_case_insensitive_completion', "
"g:jedi#case_insensitive_completion)")))

row, column = vim.current.window.cursor
# Clear call signatures in the buffer so they aren't seen by the completer.
# Call signatures in the command line can stay.
Expand Down

0 comments on commit 873ee93

Please sign in to comment.