daa84 / neovim-gtk

gtk ui for neovim
GNU General Public License v3.0
717 stars 56 forks source link

Panic on comment longer than 160 chars in CoffeeScript file #20

Closed wezm closed 6 years ago

wezm commented 6 years ago

Typing a comment longer than 160 chars on a new line between lines 5 and 6 in this sample file triggers a panic every time:

  1 describe 'TradingStrategy::DispatchDemandForecast', ->                                                                                                     
  2                                                                                                                                                            
  3   describe '#desiredState', ->                                                                                                                             
  4                                                                                                                                                            
  5       it 'raises a not implemented error', ->                                                                                                                
  6         expect(=> @strategy.desiredState()).toThrowError('not implemented')                                                                                  

https://github.com/daa84/neovim-gtk/blob/05d6507dc55cba0e9585a51392e12967c8936841/src/ui_model/line.rs#L172

Nov 13 10:35:33 wes-thinkpad org.daa.NeovimGtk.desktop[15725]: thread 'main' panicked at 'index out of bounds: the len is 160 but the index is 160', src/ui_model/line.rs:172:9

It's possible that the Yggdroot/indentLine plugin is contributing to the problem. I have these settings:

let g:indentLine_enabled = 0
let g:indentLine_char = '│'
let g:indentLine_color_term = 239
let g:indentLine_color_gui = '#616161'
if has("autocmd")
  " Set foldmethod to indentation for CoffeeScript files
  autocmd BufNewFile,BufReadPost *.coffee setlocal foldmethod=indent

  au FileType slim IndentLinesEnable
  au FileType coffee IndentLinesEnable
endif
daa84 commented 6 years ago

Yes, it's funny, this plugin really make nvim-gtk crash 😄

wezm commented 6 years ago

Thanks so much for the quick fix. Really appreciate it. 😀