mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	Make existing tests work with new feature
This commit is contained in:
		@@ -112,7 +112,7 @@ describe('terminal mouse', function()
 | 
			
		||||
          line28                   |line28                  |
 | 
			
		||||
          line29                   |line29                  |
 | 
			
		||||
          line30                   |line30                  |
 | 
			
		||||
          rows: 5, cols: 24        |rows: 5, cols: 24       |
 | 
			
		||||
          rows: 5, cols: 25        |rows: 5, cols: 25       |
 | 
			
		||||
          {2:^ }                        |{2: }                       |
 | 
			
		||||
          ==========                ==========              |
 | 
			
		||||
                                                            |
 | 
			
		||||
@@ -122,7 +122,7 @@ describe('terminal mouse', function()
 | 
			
		||||
            1 ^                     |line28                  |
 | 
			
		||||
          ~                        |line29                  |
 | 
			
		||||
          ~                        |line30                  |
 | 
			
		||||
          ~                        |rows: 5, cols: 24       |
 | 
			
		||||
          ~                        |rows: 5, cols: 25       |
 | 
			
		||||
          ~                        |{2: }                       |
 | 
			
		||||
          ==========                ==========              |
 | 
			
		||||
          :enew | set number                                |
 | 
			
		||||
@@ -132,16 +132,16 @@ describe('terminal mouse', function()
 | 
			
		||||
           27 line                 |line28                  |
 | 
			
		||||
           28 line                 |line29                  |
 | 
			
		||||
           29 line                 |line30                  |
 | 
			
		||||
           30 line                 |rows: 5, cols: 24       |
 | 
			
		||||
           30 line                 |rows: 5, cols: 25       |
 | 
			
		||||
           31 ^                     |{2: }                       |
 | 
			
		||||
          ==========                ==========              |
 | 
			
		||||
                                                            |
 | 
			
		||||
        ]])
 | 
			
		||||
        feed('<c-w>li')
 | 
			
		||||
        screen:expect([[
 | 
			
		||||
           27 line                 |line28                  |
 | 
			
		||||
           28 line                 |line29                  |
 | 
			
		||||
           29 line                 |line30                  |
 | 
			
		||||
           27 line                 |line29                  |
 | 
			
		||||
           28 line                 |line30                  |
 | 
			
		||||
           29 line                 |rows: 5, cols: 25       |
 | 
			
		||||
           30 line                 |rows: 5, cols: 24       |
 | 
			
		||||
           31                      |{1: }                       |
 | 
			
		||||
          ==========                ==========              |
 | 
			
		||||
@@ -151,8 +151,8 @@ describe('terminal mouse', function()
 | 
			
		||||
        thelpers.enable_mouse()
 | 
			
		||||
        thelpers.feed_data('mouse enabled\n')
 | 
			
		||||
        screen:expect([[
 | 
			
		||||
           27 line                 |line29                  |
 | 
			
		||||
           28 line                 |line30                  |
 | 
			
		||||
           27 line                 |line30                  |
 | 
			
		||||
           28 line                 |rows: 5, cols: 25       |
 | 
			
		||||
           29 line                 |rows: 5, cols: 24       |
 | 
			
		||||
           30 line                 |mouse enabled           |
 | 
			
		||||
           31                      |{1: }                       |
 | 
			
		||||
@@ -164,8 +164,8 @@ describe('terminal mouse', function()
 | 
			
		||||
      it('wont lose focus if another window is scrolled', function()
 | 
			
		||||
        feed('<MouseDown><0,0><MouseDown><0,0>')
 | 
			
		||||
        screen:expect([[
 | 
			
		||||
           21 line                 |line29                  |
 | 
			
		||||
           22 line                 |line30                  |
 | 
			
		||||
           21 line                 |line30                  |
 | 
			
		||||
           22 line                 |rows: 5, cols: 25       |
 | 
			
		||||
           23 line                 |rows: 5, cols: 24       |
 | 
			
		||||
           24 line                 |mouse enabled           |
 | 
			
		||||
           25 line                 |{1: }                       |
 | 
			
		||||
@@ -174,8 +174,8 @@ describe('terminal mouse', function()
 | 
			
		||||
        ]])
 | 
			
		||||
        feed('<S-MouseUp><0,0>')
 | 
			
		||||
        screen:expect([[
 | 
			
		||||
           26 line                 |line29                  |
 | 
			
		||||
           27 line                 |line30                  |
 | 
			
		||||
           26 line                 |line30                  |
 | 
			
		||||
           27 line                 |rows: 5, cols: 25       |
 | 
			
		||||
           28 line                 |rows: 5, cols: 24       |
 | 
			
		||||
           29 line                 |mouse enabled           |
 | 
			
		||||
           30 line                 |{1: }                       |
 | 
			
		||||
@@ -187,8 +187,8 @@ describe('terminal mouse', function()
 | 
			
		||||
      it('will lose focus if another window is clicked', function()
 | 
			
		||||
        feed('<LeftMouse><5,1>')
 | 
			
		||||
        screen:expect([[
 | 
			
		||||
           27 line                 |line29                  |
 | 
			
		||||
           28 l^ine                 |line30                  |
 | 
			
		||||
           27 line                 |line30                  |
 | 
			
		||||
           28 l^ine                 |rows: 5, cols: 25       |
 | 
			
		||||
           29 line                 |rows: 5, cols: 24       |
 | 
			
		||||
           30 line                 |mouse enabled           |
 | 
			
		||||
           31                      |{2: }                       |
 | 
			
		||||
 
 | 
			
		||||
@@ -51,87 +51,4 @@ describe('terminal', function()
 | 
			
		||||
      ]])
 | 
			
		||||
    end)
 | 
			
		||||
  end)
 | 
			
		||||
 | 
			
		||||
  describe('split horizontally', function()
 | 
			
		||||
    before_each(function()
 | 
			
		||||
      nvim('command', 'sp')
 | 
			
		||||
    end)
 | 
			
		||||
 | 
			
		||||
    local function reduce_height()
 | 
			
		||||
      screen:expect([[
 | 
			
		||||
        tty ready                                         |
 | 
			
		||||
        rows: 3, cols: 50                                 |
 | 
			
		||||
        {1: }                                                 |
 | 
			
		||||
        ~                                                 |
 | 
			
		||||
        ==========                                        |
 | 
			
		||||
        tty ready                                         |
 | 
			
		||||
        rows: 3, cols: 50                                 |
 | 
			
		||||
        {2: }                                                 |
 | 
			
		||||
        ==========                                        |
 | 
			
		||||
        -- TERMINAL --                                    |
 | 
			
		||||
      ]])
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it('uses the minimum height of all window displaying it', reduce_height)
 | 
			
		||||
 | 
			
		||||
    describe('and then vertically', function()
 | 
			
		||||
      before_each(function()
 | 
			
		||||
        reduce_height()
 | 
			
		||||
        nvim('command', 'vsp')
 | 
			
		||||
      end)
 | 
			
		||||
 | 
			
		||||
      local function reduce_width()
 | 
			
		||||
        screen:expect([[
 | 
			
		||||
          rows: 3, cols: 50        |rows: 3, cols: 50       |
 | 
			
		||||
          rows: 3, cols: 24        |rows: 3, cols: 24       |
 | 
			
		||||
          {1: }                        |{2: }                       |
 | 
			
		||||
          ~                        |~                       |
 | 
			
		||||
          ==========                ==========              |
 | 
			
		||||
          rows: 3, cols: 50                                 |
 | 
			
		||||
          rows: 3, cols: 24                                 |
 | 
			
		||||
          {2: }                                                 |
 | 
			
		||||
          ==========                                        |
 | 
			
		||||
          -- TERMINAL --                                    |
 | 
			
		||||
        ]])
 | 
			
		||||
        feed('<c-\\><c-n>gg')
 | 
			
		||||
        screen:expect([[
 | 
			
		||||
          ^tty ready                |rows: 3, cols: 50       |
 | 
			
		||||
          rows: 3, cols: 50        |rows: 3, cols: 24       |
 | 
			
		||||
          rows: 3, cols: 24        |{2: }                       |
 | 
			
		||||
          {2: }                        |~                       |
 | 
			
		||||
          ==========                ==========              |
 | 
			
		||||
          rows: 3, cols: 50                                 |
 | 
			
		||||
          rows: 3, cols: 24                                 |
 | 
			
		||||
          {2: }                                                 |
 | 
			
		||||
          ==========                                        |
 | 
			
		||||
                                                            |
 | 
			
		||||
        ]])
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      it('uses the minimum width of all window displaying it', reduce_width)
 | 
			
		||||
 | 
			
		||||
      describe('and then closes one of the vertical splits with q:', function()
 | 
			
		||||
        before_each(function()
 | 
			
		||||
          reduce_width()
 | 
			
		||||
          nvim('command', 'q')
 | 
			
		||||
          feed('<c-w>ja')
 | 
			
		||||
        end)
 | 
			
		||||
 | 
			
		||||
        it('will restore the width', function()
 | 
			
		||||
          screen:expect([[
 | 
			
		||||
            rows: 3, cols: 24                                 |
 | 
			
		||||
            rows: 3, cols: 50                                 |
 | 
			
		||||
            {2: }                                                 |
 | 
			
		||||
            ~                                                 |
 | 
			
		||||
            ==========                                        |
 | 
			
		||||
            rows: 3, cols: 24                                 |
 | 
			
		||||
            rows: 3, cols: 50                                 |
 | 
			
		||||
            {1: }                                                 |
 | 
			
		||||
            ==========                                        |
 | 
			
		||||
            -- TERMINAL --                                    |
 | 
			
		||||
          ]])
 | 
			
		||||
        end)
 | 
			
		||||
      end)
 | 
			
		||||
    end)
 | 
			
		||||
  end)
 | 
			
		||||
end)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user