Index: trunk/phase3/includes/diff/DifferenceEngine.php |
— | — | @@ -30,6 +30,10 @@ |
31 | 31 | var $mCacheHit = false; // Was the diff fetched from cache? |
32 | 32 | var $htmldiff; |
33 | 33 | |
| 34 | + // If true, line X is not displayed when X is 1, for example to increase |
| 35 | + // readability and conserve space with many small diffs. |
| 36 | + protected $mReducedLineNumbers = false; |
| 37 | + |
34 | 38 | protected $unhide = false; |
35 | 39 | /**#@-*/ |
36 | 40 | |
— | — | @@ -80,6 +84,10 @@ |
81 | 85 | $this->unhide = $unhide; |
82 | 86 | } |
83 | 87 | |
| 88 | + function setReducedLineNumbers( $value = true ) { |
| 89 | + $this->mReducedLineNumbers = $value; |
| 90 | + } |
| 91 | + |
84 | 92 | function getTitle() { |
85 | 93 | return $this->mTitle; |
86 | 94 | } |
— | — | @@ -842,6 +850,7 @@ |
843 | 851 | |
844 | 852 | function localiseLineNumbersCb( $matches ) { |
845 | 853 | global $wgLang; |
| 854 | + if ( $matches[1] === '1' && $this->mReducedLineNumbers ) return ''; |
846 | 855 | return wfMsgExt( 'lineno', 'escape', $wgLang->formatNum( $matches[1] ) ); |
847 | 856 | } |
848 | 857 | |