#653 Treat temporary filenames as being for the current buffer
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
After:
|
||||
unlet! b:temp_name
|
||||
unlet! b:other_bufnr
|
||||
|
||||
Given foo (Some file with lines to count):
|
||||
@@ -291,3 +292,40 @@ Execute(FixLocList should accept filenames):
|
||||
\ {'text': 'a', 'lnum': 5, 'filename': '/foo/bar/baz'},
|
||||
\ ],
|
||||
\ )
|
||||
|
||||
Execute(FixLocList should interpret temporary filenames as being the current buffer):
|
||||
let b:temp_name = tempname()
|
||||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'text': 'a',
|
||||
\ 'lnum': 2,
|
||||
\ 'col': 0,
|
||||
\ 'bufnr': bufnr(''),
|
||||
\ 'filename': b:temp_name,
|
||||
\ 'vcol': 0,
|
||||
\ 'type': 'E',
|
||||
\ 'nr': -1,
|
||||
\ 'linter_name': 'foobar',
|
||||
\ },
|
||||
\ {
|
||||
\ 'text': 'a',
|
||||
\ 'lnum': 3,
|
||||
\ 'col': 0,
|
||||
\ 'bufnr': bufnr(''),
|
||||
\ 'filename': b:temp_name,
|
||||
\ 'vcol': 0,
|
||||
\ 'type': 'E',
|
||||
\ 'nr': -1,
|
||||
\ 'linter_name': 'foobar',
|
||||
\ },
|
||||
\],
|
||||
\ ale#engine#FixLocList(
|
||||
\ bufnr(''),
|
||||
\ 'foobar',
|
||||
\ [
|
||||
\ {'text': 'a', 'lnum': 2, 'filename': b:temp_name},
|
||||
\ {'text': 'a', 'lnum': 3, 'filename': b:temp_name},
|
||||
\ ],
|
||||
\ )
|
||||
|
||||
Reference in New Issue
Block a user