Показывать ошибки многострочного потока в строке состояния Vim?

Я использую NVIM v0.2.2 с 'w0rp/ale', настроенным на анализ ошибок Flow. Я вижу однострочное сообщение об ошибке в строке состояния. Однако ошибки потока, как правило, являются многострочными ошибками. Как настроить редактор для отображения полной многострочной ошибки Flow?

Вот что я вижу: введите здесь описание изображения

Вот мой nvim/init.vim файл:

" Install Vim Plug if not installed
if empty(glob('~/.config/nvim/autoload/plug.vim'))
  silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall
endif

call plug#begin()

Plug 'scrooloose/nerdtree', { 'on':  'NERDTreeToggle' }
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'rking/ag.vim'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-commentary'
Plug 'prettier/vim-prettier', { 'do': 'yarn install' }
Plug 'rakr/vim-one'
Plug 'itchyny/lightline.vim'
Plug 'w0rp/ale'

call plug#end()

let g:jsx_ext_required = 0
let g:javascript_plugin_flow = 1
let g:ag_working_path_mode="r"
let g:prettier#config#bracket_spacing = 'true'
let g:prettier#config#jsx_bracket_same_line = 'false'
let g:prettier#config#arrow_parens = 'avoid'
let g:prettier#config#trailing_comma = 'none'
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 0

if &listchars ==# 'eol:$'
  set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
endif

set number

"Credit joshdick
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
if (empty($TMUX))
  if (has("nvim"))
  "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
  let $NVIM_TUI_ENABLE_TRUE_COLOR=1
  endif
  "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
  "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
  " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
  if (has("termguicolors"))
    set termguicolors
  endif
endif
set background=dark " for the dark version
" set background=light " for the light version
set laststatus=2
colorscheme one
let g:lightline = {
      \ 'colorscheme': 'one',
      \ 'active': {
      \   'left': [ [ 'mode', 'paste' ],
      \             [ 'gitbranch', 'readonly', 'filename', 'modified' ] ],
      \ },
      \ 'component_function': {
      \   'gitbranch': 'fugitive#head'
      \ },
      \ }

" Asynchronous Lint Engine (ALE)
" Limit linters used for JavaScript.
let g:ale_linters = {
\  'javascript': ['flow']
\}
highlight clear ALEErrorSign " otherwise uses error bg color (typically red)
highlight clear ALEWarningSign " otherwise uses error bg color (typically red)
let g:ale_sign_error = 'X' " could use emoji
let g:ale_sign_warning = '?' " could use emoji
let g:ale_statusline_format = ['X %d', '? %d', '']
" %linter% is the name of the linter that provided the message
" %s is the error or warning message
let g:ale_echo_msg_format = '%linter% says %s'
" Map keys to navigate between lines with errors and warnings.
nnoremap <leader>an :ALENextWrap<cr>
nnoremap <leader>ap :ALEPreviousWrap<cr>

person Tom Coughlin    schedule 11.04.2018    source источник
comment
У меня нет решения для этого, но, похоже, это обычная проблема с пользовательским интерфейсом lint/flow в нескольких редакторах. Ошибки lint часто связаны с определенной строкой/столбцом, и именно так был задуман пользовательский интерфейс. Ошибки потока в основном многострочные, чтобы помочь проиллюстрировать контекст ошибки, особенно если контекст может распространяться на две или более строк. Я обычно просто открываю окно терминала в другом месте, чтобы я мог запустить поток из командной строки, чтобы увидеть многострочную ошибку и правильно увидеть контекст, когда мне это нужно.   -  person Dave Meehan    schedule 12.04.2018


Ответы (1)


Ale поддерживает открытие окна списка с ошибками линтинга, см. :help g:ale_open_list.

Обратите внимание, что вам может понадобиться что-то вроде

autocmd FileType qf setlocal wrap

чтобы длинные строки переносились в окно быстрого исправления.

person Rich Churcher    schedule 19.04.2018