@@ -255,38 +255,38 @@ private string[] GenerateTableRow(string[] values, ReadOnlySpan<int> alignment,
255
255
return null ;
256
256
}
257
257
258
- List < string > [ ] scArray = new List < string > [ validColumnCount ] ;
258
+ List < string > [ ] stringListArray = new List < string > [ validColumnCount ] ;
259
259
bool addPadding = true ;
260
- for ( int k = 0 ; k < scArray . Length ; k ++ )
260
+ for ( int k = 0 ; k < stringListArray . Length ; k ++ )
261
261
{
262
262
// for the last column, don't pad it with trailing spaces
263
- if ( k == scArray . Length - 1 )
263
+ if ( k == stringListArray . Length - 1 )
264
264
{
265
265
addPadding = false ;
266
266
}
267
267
268
268
// obtain a set of tokens for each field
269
- scArray [ k ] = GenerateMultiLineRowField ( values [ validColumnArray [ k ] ] , validColumnArray [ k ] ,
269
+ stringListArray [ k ] = GenerateM
9E88
ultiLineRowField ( values [ validColumnArray [ k ] ] , validColumnArray [ k ] ,
270
270
alignment [ validColumnArray [ k ] ] , ds , addPadding ) ;
271
271
272
272
// NOTE: the following padding operations assume that we
273
273
// pad with a blank (or any character that ALWAYS maps to a single screen cell
274
274
if ( k > 0 )
275
275
{
276
276
// skipping the first ones, add a separator for concatenation
277
- for ( int j = 0 ; j < scArray [ k ] . Count ; j ++ )
277
+ for ( int j = 0 ; j < stringListArray [ k ] . Count ; j ++ )
278
278
{
279
- scArray [ k ] [ j ] = StringUtil . Padding ( ScreenInfo . separatorCharacterCount ) + scArray [ k ] [ j ] ;
279
+ stringListArray [ k ] [ j ] = StringUtil . Padding ( ScreenInfo . separatorCharacterCount ) + stringListArray [ k ] [ j ] ;
280
280
}
281
281
}
282
282
else
283
283
{
284
284
// add indentation padding if needed
285
285
if ( _startColumn > 0 )
286
286
{
287
- for ( int j = 0 ; j < scArray [ k ] . Count ; j ++ )
287
+ for ( int j = 0 ; j < stringListArray [ k ] . Count ; j ++ )
288
288
{
289
- scArray [ k ] [ j ] = StringUtil . Padding ( _startColumn ) + scArray [ k ] [ j ] ;
289
+ stringListArray [ k ] [ j ] = StringUtil . Padding ( _startColumn ) + stringListArray [ k ] [ j ] ;
290
290
}
291
291
}
292
292
}
@@ -295,10 +295,10 @@ private string[] GenerateTableRow(string[] values, ReadOnlySpan<int> alignment,
295
295
// now we processed all the rows columns and we need to find the cell that occupies the most
296
296
// rows
297
297
int screenRows = 0 ;
298
- for ( int k = 0 ; k < scArray . Length ; k ++ )
298
+ for ( int k = 0 ; k < stringListArray . Length ; k ++ )
299
299
{
300
- if ( scArray [ k ] . Count > screenRows )
301
- screenRows = scArray [ k ] . Count ;
300
+ if ( stringListArray [ k ] . Count > screenRows )
301
+ screenRows = stringListArray [ k ] . Count ;
302
302
}
303
303
304
304
// column headers can span multiple rows if the width of the column is shorter than the header text like:
@@ -314,22 +314,22 @@ private string[] GenerateTableRow(string[] values, ReadOnlySpan<int> alignment,
314
314
System . Span < int > lastColWithContent = screenRows <= OutCommandInner . StackAllocThreshold ? stackalloc int [ screenRows ] : new int [ screenRows ] ;
315
315
for ( int row = 0 ; row < screenRows ; row ++ )
316
316
{
317
- for ( int col = 0 ; col < scArray . Length ; col ++ )
317
+ for ( int col = 0 ; col < stringListArray . Length ; col ++ )
318
318
{
319
- if ( scArray [ col ] . Count > row )
319
+ if ( stringListArray [ col ] . Count > row )
320
320
{
321
321
lastColWithContent [ row ] = col ;
322
322
}
323
323
}
324
324
}
325
325
326
326
// add padding for the columns that are shorter
327
- for ( int col = 0 ; col < scArray . Length ; col ++ )
327
+ for ( int col = 0 ; col < stringListArray . Length ; col ++ )
328
328
{
329
329
int paddingBlanks = 0 ;
330
330
331
331
// don't pad if last column
332
- if ( col < scArray . Length - 1 )
332
+ if ( col < stringListArray . Length - 1 )
333
333
{
334
334
paddingBlanks = _si . columnInfo [ validColumnArray [ col ] ] . width ;
335
335
if ( col > 0 )
@@ -342,19 +342,19 @@ private string[] GenerateTableRow(string[] values, ReadOnlySpan<int> alignment,
342
342
}
343
343
}
344
344
345
- int paddingEntries = screenRows - scArray [ col ] . Count ;
345
+ int paddingEntries = screenRows - stringListArray [ col ] . Count ;
346
346
if ( paddingEntries > 0 )
347
347
{
348
348
for ( int row = screenRows - paddingEntries ; row < screenRows ; row ++ )
349
349
{
350
350
// if the column is beyond the last column with content, just use empty string
351
351
if ( col > lastColWithContent [ row ] )
352
352
{
353
- scArray [ col ] . Add ( string . Empty ) ;
353
+ stringListArray [ col ] . Add ( string . Empty ) ;
354
354
}
355
355
else
356
356
{
357
- scArray [ col ] . Add ( StringUtil . Padding ( paddingBlanks ) ) ;
357
+ stringListArray [ col ] . Add ( StringUtil . Padding ( paddingBlanks ) ) ;
358
358
}
359
359
}
360
360
}
@@ -366,16 +366,16 @@ private string[] GenerateTableRow(string[] values, ReadOnlySpan<int> alignment,
366
366
{
367
367
StringBuilder sb = new StringBuilder ( ) ;
368
368
// for a given row, walk the columns
369
- for ( int col = 0 ; col < scArray . Length ; col ++ )
369
+ for ( int col = 0 ; col < stringListArray . Length ; col ++ )
370
370
{
371
371
// if the column is the last column with content, we need to trim trailing whitespace, unless there is only one row
372
372
if ( col == lastColWithContent [ row ] && screenRows > 1 )
373
373
{
374
- sb . Append ( scArray [ col ] [ row ] . TrimEnd ( ) ) ;
374
+ sb . Append ( stringListArray [ col ] [ row ] . TrimEnd ( ) ) ;
375
375
}
376
376
else
377
377
{
378
- sb . Append ( scArray [ col ] [ row ] ) ;
378
+ sb . Append ( stringListArray [ col ] [ row ] ) ;
379
379
}
380
380
}
381
381
@@ -387,19 +387,19 @@ private string[] GenerateTableRow(string[] values, ReadOnlySpan<int> alignment,
387
387
388
388
private List < string > GenerateMultiLineRowField ( string val , int k , int alignment , DisplayCells dc , bool addPadding )
389
389
{
390
- List < string > sc = StringManipulationHelper . GenerateLines ( dc , val ,
390
+ List < string > lines = StringManipulationHelper . GenerateLines ( dc , val ,
391
391
_si . columnInfo [ k ] . width , _si . columnInfo [ k ] . width ) ;
392
392
if ( addPadding || alignment == TextAlignment . Right || alignment == TextAlignment . Center )
393
393
{
394
394
// if length is shorter, do some padding
395
- for ( int col = 0 ; col < sc . Count ; col ++ )
395
+ for ( int col = 0 ; col < lines . Count ; col ++ )
396
396
{
397
- if ( dc . Length ( sc [ col ] ) < _si . columnInfo [ k ] . width )
398
- sc [ col ] = GenerateRowField ( sc [ col ] , _si . columnInfo [ k ] . width , alignment , dc , addPadding ) ;
397
+ if ( dc . Length ( lines [ col ] ) < _si . columnInfo [ k ] . width )
398
+ lines [ col ] = GenerateRowField ( lines [ col ] , _si . columnInfo [ k ] . width , alignment , dc , addPadding ) ;
399
399
}
400
400
}
401
401
402
- return sc ;
402
+ return lines ;
403
403
}
404
404
405
405
private string GenerateRow ( string [ ] values , ReadOnlySpan < int > alignment , DisplayCells dc )
0 commit comments