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

Ale breaks CTRL-O behavior while in insert mode #2535

Closed
doums opened this issue May 26, 2019 · 5 comments
Closed

Ale breaks CTRL-O behavior while in insert mode #2535

doums opened this issue May 26, 2019 · 5 comments
Labels

Comments

@doums
Copy link

doums commented May 26, 2019

Information

VIM version

VIM - Vi IMproved 8.1 (2018 May 18, compilé Apr 26 2019 21:55:55)
Rustines incluses : 1-1186

Operating System: Linux x1c6 5.1.4-arch1-1-ARCH #1 SMP PREEMPT Wed May 22 08:06:56 UTC 2019 x86_64 GNU/Linux

What went wrong

I have this kind of mapping to move around while in insert mode:

inoremap <M-h> <C-o>h
inoremap <M-j> <C-o>j
inoremap <M-k> <C-o>k
inoremap <M-l> <C-o>l

Pressing CTRL-O while in insert mode switch the user in normal mode for one command and switch back to insert. But in some case, Ale breaks this behavior, and either my mapping or pressing CTRL-O manually does not work.
When the bug occurs, pressing CTRL-O in insert mode don't change to normal. Just nothing happens.

EDIT: remapping <C-o>hjkl by <Up><Down>... is a workaround, CTRL-O still does not work.

Reproducing the bug

I identify that the bug happens for rust files. I tested Typescript/Javascript with no problem.

  1. Open a rust file .rs
  2. Enter in insert mode and write something
  3. Press CTRL-O -> nothing happens

:ALEInfo

 Current Filetype: rust
Available Linters: ['cargo', 'rls', 'rustc']
  Enabled Linters: ['cargo', 'rls', 'rustc']
 Suggested Fixers: 
  'remove_trailing_lines' - Remove all blank lines at the end of a file.
  'rustfmt' - Fix Rust files with Rustfmt.
  'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
 Linter Variables:

let g:ale_rust_cargo_avoid_whole_workspace = 1
let g:ale_rust_cargo_check_all_targets = 0
let g:ale_rust_cargo_check_examples = 0
let g:ale_rust_cargo_check_tests = 0
let g:ale_rust_cargo_clippy_options = ''
let g:ale_rust_cargo_default_feature_behavior = 'default'
let g:ale_rust_cargo_include_features = ''
let g:ale_rust_cargo_use_check = 1
let g:ale_rust_cargo_use_clippy = 0
let g:ale_rust_rls_config = {}
let g:ale_rust_rls_executable = 'rls'
let g:ale_rust_rls_toolchain = ''
let g:ale_rust_rustc_options = '-Z no-codegen'
 Global Variables:

let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = 100
let g:ale_completion_enabled = 1
let g:ale_completion_max_suggestions = 50
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_format = '[%linter%][%severity%] %s'
let g:ale_echo_msg_info_str = 'I'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_enabled = 1
let g:ale_fix_on_save = 0
let g:ale_fixers = {'typescript': ['eslint', 'tsserver'], 'graphql': ['eslint '], 'javascript': ['eslint']}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 0
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'always'
let g:ale_linter_aliases = {}
let g:ale_linters = {'typescript': ['eslint', 'tsserver'], 'graphql': ['eslint '], 'rust': ['cargo', 'rls', 'rustc', 'clippy', 'rustfmt'], 'javascript': ['eslint', 'standard']}
let g:ale_linters_explicit = 1
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '[%linter%][%severity%] %s'
let g:ale_lsp_root = {}
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_set_balloons = 0
let g:ale_set_highlights = 0
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '>>'
let g:ale_sign_info = '--'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '>>'
let g:ale_sign_style_warning = '--'
let g:ale_sign_warning = '--'
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 0
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
  Command History:

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/34/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/35/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/36/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/37/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/38/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/39/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/40/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/41/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/42/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/43/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/44/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/45/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/46/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/47/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/48/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/49/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/50/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/51/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/52/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/bin/sh', '-c', 'rustc --error-format=json -Z no-codegen -L ''/home/pierre/Documents/seap/target/debug/deps'' -L ''/home/pierre/Documents/seap/target/release/deps'' - < ''/tmp/vVvhv5t/53/main.rs''']

<<<OUTPUT STARTS>>>
error: the option `Z` is only accepted on the nightly compiler

<<<OUTPUT ENDS>>>
@w0rp
Copy link
Member

w0rp commented May 26, 2019

Have you tried disabling other plugins to make sure that it's ALE that's somehow triggering this bug?

@doums
Copy link
Author

doums commented May 27, 2019

Yes, I tried with disabling absolutely all other plugin, leaving ALE alone. And the bug still here.

@w0rp
Copy link
Member

w0rp commented May 28, 2019

Thank you. I'll see if I can repeat the bug later.

@doums
Copy link
Author

doums commented May 28, 2019

Yup. By the way thanks you for this amazing tool !

@w0rp
Copy link
Member

w0rp commented May 28, 2019

I was able to repeat the bug by loading up the Rust project I test Rust language server integration with, and I found the issue. ALE's automatic completion opens the omnicompletion menu by sending <C-x><C-o> automatically, and it was doing this even when there were no results. I restructured the code so now ALE only attempts to open the menu if there's something to show. Ctrl+O will still be blocked some of the time when the completion menu is about to open, but it will now be blocked a lot less than it was.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants