better Range:highlight(..) handling
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
local Buffer = require 'tt.buffer'
|
||||
local withbuf = require '__tt_test_tools'
|
||||
local withbuf = loadfile './spec/withbuf.lua'()
|
||||
|
||||
describe('Buffer', function()
|
||||
it('should replace all lines', function()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
local Pos = require 'tt.pos'
|
||||
local withbuf = require '__tt_test_tools'
|
||||
local withbuf = loadfile './spec/withbuf.lua'()
|
||||
|
||||
describe('Pos', function()
|
||||
it('get a char from a given position', function()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
local Range = require 'tt.range'
|
||||
local Pos = require 'tt.pos'
|
||||
local withbuf = require '__tt_test_tools'
|
||||
local withbuf = loadfile './spec/withbuf.lua'()
|
||||
|
||||
describe('Range', function()
|
||||
it('get text in buffer', function()
|
||||
|
||||
10
spec/withbuf.lua
Normal file
10
spec/withbuf.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
local function withbuf(lines, f)
|
||||
vim.opt_global.swapfile = false
|
||||
|
||||
vim.cmd.new()
|
||||
vim.api.nvim_buf_set_lines(0, 0, -1, false, lines)
|
||||
local ok, result = pcall(f)
|
||||
vim.cmd.bdelete { bang = true }
|
||||
if not ok then error(result) end
|
||||
end
|
||||
return withbuf
|
||||
Reference in New Issue
Block a user