File tree 2 files changed +11
-6
lines changed
regression/goto-instrument/document-properties-basic
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 3
3
--document-properties-html
4
4
^EXIT=0$
5
5
^SIGNAL=0$
6
- ^<em> assert\(1 == 1\);<\/em>$
6
+ ^\s*\d+ <em> assert\(1 == 1\);<\/em>$
7
7
--
8
8
^warning: ignoring
9
9
--
Original file line number Diff line number Diff line change @@ -225,6 +225,11 @@ document_propertiest::get_code(const source_locationt &source_location)
225
225
226
226
// build dest
227
227
228
+ std::size_t max_line_number_width = 0 ;
229
+ if (!lines.empty ())
230
+ {
231
+ max_line_number_width = std::to_string (lines.back ().line_number ).size ();
232
+ }
228
233
for (std::list<linet>::iterator it=lines.begin ();
229
234
it!=lines.end (); it++)
230
235
{
@@ -235,10 +240,10 @@ document_propertiest::get_code(const source_locationt &source_location)
235
240
switch (format)
236
241
{
237
242
case LATEX:
238
- while (line_no.size ()< 4 )
243
+ while (line_no.size () < max_line_number_width )
239
244
line_no=" " +line_no;
240
245
241
- line_no+ " " ;
246
+ line_no += " " ;
242
247
243
248
tmp+=escape_latex (it->text , true );
244
249
@@ -248,10 +253,10 @@ document_propertiest::get_code(const source_locationt &source_location)
248
253
break ;
249
254
250
255
case HTML:
251
- while (line_no.size ()< 4 )
256
+ while (line_no.size () < max_line_number_width )
252
257
line_no=" " +line_no;
253
258
254
- line_no+ " " ;
259
+ line_no += " " ;
255
260
256
261
tmp+=escape_html (it->text );
257
262
@@ -261,7 +266,7 @@ document_propertiest::get_code(const source_locationt &source_location)
261
266
break ;
262
267
}
263
268
264
- dest+= tmp+ " \n " ;
269
+ dest += line_no + tmp + " \n " ;
265
270
}
266
271
267
272
return dest;
You can’t perform that action at this time.
0 commit comments