File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/vs/workbench/contrib/terminalContrib/links/test/browser Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ export async function assertLinkHelper(
18
18
19
19
// Write the text and wait for the parser to finish
20
20
await new Promise < void > ( r => detector . xterm . write ( text , r ) ) ;
21
+ const textSplit = text . split ( '\r\n' ) ;
22
+ const lastLineIndex = textSplit . filter ( ( e , i ) => i !== textSplit . length - 1 ) . reduce ( ( p , c ) => {
23
+ return p + Math . max ( Math . ceil ( c . length / 80 ) , 1 ) ;
24
+ } , 0 ) ;
21
25
22
26
// Ensure all links are provided
23
27
const lines : IBufferLine [ ] = [ ] ;
@@ -26,7 +30,7 @@ export async function assertLinkHelper(
26
30
}
27
31
28
32
// Detect links always on the last line with content
29
- const actualLinks = ( await detector . detect ( lines , detector . xterm . buffer . active . cursorY , detector . xterm . buffer . active . cursorY ) ) . map ( e => {
33
+ const actualLinks = ( await detector . detect ( lines , lastLineIndex , detector . xterm . buffer . active . cursorY ) ) . map ( e => {
30
34
return {
31
35
link : e . uri ?. toString ( ) ?? e . text ,
32
36
type : expectedType ,
You can’t perform that action at this time.
0 commit comments