Fossil

Check-in [eae55eea]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make the default font size is smaller for side-by-side diff. Fix the context-diff so that it understands the dc=N query parameter.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | retro-sbsdiff
Files: files | file ages | folders
SHA1: eae55eeafc0d1152ac46e0df354c392e409afedd
User & Date: drh 2012-02-04 20:36:00.242
Context
2012-02-04
21:09
Merge the retro-sbsdiff changes into trunk. ... (check-in: 72c0183a user: drh tags: trunk)
20:36
Make the default font size is smaller for side-by-side diff. Fix the context-diff so that it understands the dc=N query parameter. ... (Closed-Leaf check-in: eae55eea user: drh tags: retro-sbsdiff)
20:16
Suppress the top divider on a context-diff with line numbers. ... (check-in: 43cbe9dd user: drh tags: retro-sbsdiff)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/info.c.
354
355
356
357
358
359
360
361
362

363
364
365
366
367
368



369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
** Construct an appropriate diffFlag for text_diff() based on query
** parameters and the to boolean arguments.
*/
static int construct_diff_flags(int showDiff, int sideBySide){
  int diffFlags;
  if( showDiff==0 ){
    diffFlags = 0;  /* Zero means do not show any diff */
  }else if( sideBySide ){
    int x;

    diffFlags = DIFF_SIDEBYSIDE | DIFF_IGNORE_EOLWS;

    /* "dw" query parameter determines width of each column */
    x = atoi(PD("dw","80"))*(DIFF_CONTEXT_MASK+1);
    if( x<0 || x>DIFF_WIDTH_MASK ) x = DIFF_WIDTH_MASK;
    diffFlags += x;




    /* "dc" query parameter determines lines of context */
    x = atoi(PD("dc","7"));
    if( x<0 || x>DIFF_CONTEXT_MASK ) x = DIFF_CONTEXT_MASK;
    diffFlags += x;
  }else{
    /* In-line (non-side-by-side) diff */
    diffFlags = DIFF_INLINE | DIFF_IGNORE_EOLWS;
  }
  return diffFlags;
}


/*
** WEBPAGE: vinfo







|

>
|

|
|
|
|
>
>
>





<
<
<







354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377



378
379
380
381
382
383
384
** Construct an appropriate diffFlag for text_diff() based on query
** parameters and the to boolean arguments.
*/
static int construct_diff_flags(int showDiff, int sideBySide){
  int diffFlags;
  if( showDiff==0 ){
    diffFlags = 0;  /* Zero means do not show any diff */
  }else{
    int x;
    if( sideBySide ){
      diffFlags = DIFF_SIDEBYSIDE | DIFF_IGNORE_EOLWS;

      /* "dw" query parameter determines width of each column */
      x = atoi(PD("dw","80"))*(DIFF_CONTEXT_MASK+1);
      if( x<0 || x>DIFF_WIDTH_MASK ) x = DIFF_WIDTH_MASK;
      diffFlags += x;
    }else{
      diffFlags = DIFF_INLINE | DIFF_IGNORE_EOLWS;
    }

    /* "dc" query parameter determines lines of context */
    x = atoi(PD("dc","7"));
    if( x<0 || x>DIFF_CONTEXT_MASK ) x = DIFF_CONTEXT_MASK;
    diffFlags += x;



  }
  return diffFlags;
}


/*
** WEBPAGE: vinfo
Changes to src/style.c.
752
753
754
755
756
757
758

759
760
761
762
763
764
765
    "List of files in a timeline",
    @   margin-top: 3px;
    @   line-height: 100%;
  },
  { "div.sbsdiff",
    "side-by-side diff display",
    @   font-family: monospace;

    @   white-space: pre;
  },
  { "div.udiff",
    "context diff display",
    @   font-family: monospace;
    @   white-space: pre;
  },







>







752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
    "List of files in a timeline",
    @   margin-top: 3px;
    @   line-height: 100%;
  },
  { "div.sbsdiff",
    "side-by-side diff display",
    @   font-family: monospace;
    @   font-size: smaller;
    @   white-space: pre;
  },
  { "div.udiff",
    "context diff display",
    @   font-family: monospace;
    @   white-space: pre;
  },