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(
1818
1919 // Write the text and wait for the parser to finish
2020 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 ) ;
2125
2226 // Ensure all links are provided
2327 const lines : IBufferLine [ ] = [ ] ;
@@ -26,7 +30,7 @@ export async function assertLinkHelper(
2630 }
2731
2832 // 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 => {
3034 return {
3135 link : e . uri ?. toString ( ) ?? e . text ,
3236 type : expectedType ,
You can’t perform that action at this time.
0 commit comments