mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	API: nvim_buf_set_lines: handle 'nomodifiable' #10910
This commit is contained in:
		| @@ -14,6 +14,7 @@ local meth_pcall = helpers.meth_pcall | ||||
| local command = helpers.command | ||||
| local bufmeths = helpers.bufmeths | ||||
| local feed = helpers.feed | ||||
| local expect_err = helpers.expect_err | ||||
|  | ||||
| describe('api/buf', function() | ||||
|   before_each(clear) | ||||
| @@ -197,6 +198,12 @@ describe('api/buf', function() | ||||
|       eq(': ' .. exp_emsg, emsg:sub(-#exp_emsg - 2)) | ||||
|     end) | ||||
|  | ||||
|     it("fails if 'nomodifiable'", function() | ||||
|       command('set nomodifiable') | ||||
|       expect_err([[Buffer is not 'modifiable']], | ||||
|         bufmeths.set_lines, 1, 1, 2, false, {'a','b'}) | ||||
|     end) | ||||
|  | ||||
|     it('has correct line_count when inserting and deleting', function() | ||||
|       eq(1, line_count()) | ||||
|       set_lines(-1, -1, true, {'line'}) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Justin M. Keyes
					Justin M. Keyes