require_relative '../../helper' VER.spec keymap: 'nano', hidden: false do describe 'Nano keymap' do behaves_like :with_buffer should 'go to end of line with ' do type '' insert.index.should == '1.0 lineend' end should 'go line down with ' do type '' insert.index.should == '2.0' end should 'go line up with ' do insert.index = '2.0' type '' insert.index.should == '1.0' end should 'go to next character with ' do type '' insert.index.should == '1.1' end should 'go to previous character with ' do insert.index = '1.1' type '' insert.index.should == '1.0' end end describe 'Nano keymap destructive binds' do behaves_like :destructive_mode should 'use to delete previous char' do insert.index = '1.2' type '' insert.get('linestart', 'linestart wordend').should == 'Iventore' end should 'use to delete next char' do insert.index = '1.2' type '' insert.get('linestart', 'linestart wordend').should == 'Inentore' end should 'use to delete to end of buffer' do insert.index = 'insert linestart wordend' type '' buffer.value.should == "Inventore\n" end should 'use to unindent a line' do buffer.value = " some line" type '' buffer.value.should == "some line\n" end should 'insert verbatim character with prefix' do buffer.value = '' type '' buffer.value.should == "\n\n" end should 'insert corresponding ascii character for \d\d\d' do buffer.value = '' buffer.minor_mode?(:ascii_digit).should.be.nil type '' buffer.minor_mode?(:ascii_digit).should.not.be.nil type '0' buffer.minor_mode?(:ascii_digit).should.not.be.nil buffer.value.should == "\n" type '4' buffer.minor_mode?(:ascii_digit).should.not.be.nil buffer.value.should == "\n" type '2' buffer.minor_mode?(:ascii_digit).should.be.nil buffer.value.should == "*\n" end end end