ncm2 / ncm2-tmux

completion with words from other tmux panes
MIT License
8 stars 0 forks source link

[ncm2_tmux@yarp] ValueError: not enough values to unpack (expected 4, got 1) #2

Closed fcying closed 6 years ago

fcying commented 6 years ago
[ncm2_tmux@yarp] error caught in notification handler 'on_complete [{'filepath': '/home/fcying/t.sh', 'typed': 'cd /home', 'scope_match': '', 'startccol': 5, 'scope_level': 1, 'word_patter
n': '(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\\'\\"\\,\\.\\<\\>\\/\\?\\s]+)', 'time': 1532790571.864301, 'lnum': 1, 'bufnr': 1, 'change
dtick': 21, 'manual': 0, 'base': 'home', 'ccol': 9, 'filetype': 'sh', 'curpos': [0, 1, 9, 0, 9], 'tick': [[0, 1, 9], 0], 'early_cache': 0, 'context_id': 31, 'scope': 'sh', 'matcher': {'nam
e': 'combine', 'matchers': ['abbrfuzzy', 'substr']}, 'source': {'subscope_enable': 0, 'early_cache': 0, 'name': 'tmux', 'priority': 4, 'enable': 1, 'on_warmup': 'ncm2_tmux#on_warmup', 'rea
dy': 1, 'mark': 'T', 'auto_popup': 1, 'on_complete': 'ncm2_tmux#on_complete', 'on_completed': 'ncm2_tmux#on_completed'}, 'bcol': 9, 'match_end': 4}]'
[ncm2_tmux@yarp] Traceback (most recent call last):
[ncm2_tmux@yarp]   File "/home/fcying/.vim/plugged/nvim-yarp/pythonx/yarp.py", line 30, in on_notification
[ncm2_tmux@yarp]     getattr(module_obj, method)(*args)
[ncm2_tmux@yarp]   File "/home/fcying/.vim/plugged/ncm2/pythonx/ncm2.py", line 206, in on_complete
[ncm2_tmux@yarp]     on_complete_impl(context, *args)
[ncm2_tmux@yarp]   File "/home/fcying/.vim/plugged/ncm2-tmux/pythonx/ncm2_tmux.py", line 38, in on_complete
[ncm2_tmux@yarp]     session_id, pane_id, pactive, wactive = line.split(' ')
[ncm2_tmux@yarp] ValueError: not enough values to unpack (expected 4, got 1)

reproduce way:

vim t.sh
cd /home/

ncm2_log_py3_ncm2_core

2018-07-28 23:09:28,609 [INFO @ ncm2_core.py:load_plugin:67] 27580 - send vimscript plugin /home/fcying/.vim/plugged/gen_tags.vim/ncm2-plugin/ncm2_gtags.vim
2018-07-28 23:09:28,610 [INFO @ ncm2_core.py:load_plugin:67] 27580 - send vimscript plugin /home/fcying/.vim/plugged/ncm2-bufword/ncm2-plugin/ncm2_bufword.vim
2018-07-28 23:09:28,610 [INFO @ ncm2_core.py:load_plugin:67] 27580 - send vimscript plugin /home/fcying/.vim/plugged/ncm2-tmux/ncm2-plugin/ncm2_tmux.vim
2018-07-28 23:09:28,611 [INFO @ ncm2_core.py:load_plugin:67] 27580 - send vimscript plugin /home/fcying/.vim/plugged/ncm2-path/ncm2-plugin/ncm2_path.vim
2018-07-28 23:09:28,611 [INFO @ ncm2_core.py:load_plugin:67] 27580 - send vimscript plugin /home/fcying/.vim/plugged/ncm2-pyclang/ncm2-plugin/ncm2_libclang.vim
2018-07-28 23:09:28,611 [INFO @ ncm2_core.py:load_plugin:67] 27580 - send vimscript plugin /home/fcying/.vim/plugged/ncm2-jedi/ncm2-plugin/ncm2_jedi.vim
2018-07-28 23:09:28,611 [INFO @ ncm2_core.py:load_plugin:67] 27580 - send vimscript plugin /home/fcying/.vim/plugged/ncm2-go/ncm2-plugin/ncm2-go.vim
2018-07-28 23:09:28,612 [INFO @ ncm2_core.py:load_plugin:67] 27580 - send vimscript plugin /home/fcying/.vim/plugged/ncm2-vim/ncm2-plugin/ncm2_vim.vim
2018-07-28 23:09:28,612 [INFO @ ncm2_core.py:load_plugin:67] 27580 - send vimscript plugin /home/fcying/.vim/plugged/ncm2-syntax/ncm2-plugin/ncm2_syntax.vim
2018-07-28 23:09:28,852 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: [], startccol: 1, matches cnt: 0
2018-07-28 23:09:28,872 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: [], startccol: 1, matches cnt: 0
2018-07-28 23:09:28,884 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: [], startccol: 1, matches cnt: 0
2018-07-28 23:09:28,993 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: [], startccol: 1, matches cnt: 0
2018-07-28 23:09:29,153 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: [], startccol: 2, matches cnt: 0
2018-07-28 23:09:29,359 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: [], startccol: 3, matches cnt: 0
2018-07-28 23:09:29,544 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: [], startccol: 4, matches cnt: 0
2018-07-28 23:09:30,789 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: [], startccol: 5, matches cnt: 0
2018-07-28 23:09:31,276 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: [], startccol: 6, matches cnt: 0
2018-07-28 23:09:31,380 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: [], startccol: 7, matches cnt: 0
2018-07-28 23:09:31,692 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: [], startccol: 8, matches cnt: 0
2018-07-28 23:09:31,780 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: ['syntax'], startccol: 5, matches cnt: 1
2018-07-28 23:09:31,884 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: ['syntax'], startccol: 5, matches cnt: 1
2018-07-28 23:09:31,894 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: ['syntax', 'rootpath'], startccol: 5, matches cnt: 2
2018-07-28 23:09:31,901 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: ['syntax', 'rootpath'], startccol: 5, matches cnt: 2
2018-07-28 23:09:31,941 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: ['syntax', 'rootpath'], startccol: 5, matches cnt: 2
2018-07-28 23:09:31,942 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: ['syntax', 'rootpath'], startccol: 5, matches cnt: 2
2018-07-28 23:09:32,857 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: [], startccol: 10, matches cnt: 0
2018-07-28 23:09:32,870 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: ['rootpath'], startccol: 10, matches cnt: 5
2018-07-28 23:09:32,874 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: ['rootpath'], startccol: 10, matches cnt: 5
2018-07-28 23:09:32,917 [INFO @ ncm2_core.py:matches_update_popup:652] 27580 - popup names: ['rootpath'], startccol: 10, matches cnt: 5

ncm2_log_py3_ncm2_tmux

2018-07-28 23:09:31,908 [WARNING @ session.py:handler:217] 27618 - error caught while processing notification 'b'on_complete' [{b'filepath': b'/home/fcying/t.sh', b'typed': b'cd /home', b'scope_match': b'', b'startccol': 5, b'scope_level': 1, b'word_pattern': b'(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\\'\\"\\,\\.\\<\\>\\/\\?\\s]+)', b'time': 1532790571.864301, b'lnum': 1, b'bufnr': 1, b'changedtick': 21, b'manual': 0, b'base': b'home', b'ccol': 9, b'filetype': b'sh', b'curpos': [0, 1, 9, 0, 9], b'tick': [[0, 1, 9], 0], b'early_cache': 0, b'context_id': 31, b'scope': b'sh', b'matcher': {b'name': b'combine', b'matchers': [b'abbrfuzzy', b'substr']}, b'source': {b'subscope_enable': 0, b'early_cache': 0, b'name': b'tmux', b'priority': 4, b'enable': 1, b'on_warmup': b'ncm2_tmux#on_warmup', b'ready': 1, b'mark': b'T', b'auto_popup': 1, b'on_complete': b'ncm2_tmux#on_complete', b'on_completed': b'ncm2_tmux#on_completed'}, b'bcol': 9, b'match_end': 4}]': Traceback (most recent call last):
  File "/home/fcying/.pyenv/versions/3.6-dev/lib/python3.6/site-packages/neovim/msgpack_rpc/session.py", line 213, in handler
    self._notification_cb(name, args)
  File "/home/fcying/.pyenv/versions/3.6-dev/lib/python3.6/site-packages/neovim/api/nvim.py", line 210, in filter_notification_cb
    notification_cb(name, args)
  File "/home/fcying/.vim/plugged/nvim-yarp/pythonx/yarp.py", line 30, in on_notification
    getattr(module_obj, method)(*args)
  File "/home/fcying/.vim/plugged/ncm2/pythonx/ncm2.py", line 206, in on_complete
    on_complete_impl(context, *args)
  File "/home/fcying/.vim/plugged/ncm2-tmux/pythonx/ncm2_tmux.py", line 38, in on_complete
    session_id, pane_id, pactive, wactive = line.split(' ')
ValueError: not enough values to unpack (expected 4, got 1)

ncm config

  autocmd fcying_au InsertEnter * call ncm2#enable_for_buffer()
  let g:ncm2#matcher = {
        \ 'name': 'combine',
        \ 'matchers': ['abbrfuzzy', 'substr']
        \ }
  let g:ncm2#sorter = 'abbrfuzzy'
roxma commented 6 years ago

Have you update all ncm2 related plugins to the latest version?

roxma commented 6 years ago

What's the result when you manually execute the shell command?

roxma-pc ~ $ tmux list-panes -a -F  '#{session_id} #{pane_id} #{pane_active} #{window_active}'
$0 %0 0 0
$0 %6 1 0
$0 %8 1 0
$0 %10 0 0
$0 %11 1 0
$0 %13 1 1
fcying commented 6 years ago

yes, I use the last version. Btw, This error occurs when vim is not started in a tmux session. Is it necessary to determine if tmux is started?