It would be nice if there was a setting for configuring the number of leading and trailing context lines. As a start, we could already provide variables for them...

Comments

zilverdistel’s picture

Status: Active » Needs review
StatusFileSize
new887 bytes

Here's a patch that does nothing more or less than providing two variables:

  • diff_leading_context_lines
  • diff_trailing_context_lines

These can now be set from code with variable_set(), or with drush vset. Since there's no settings form yet for the diff module, I need some input from the maintainer to further enhance this patch.

A possibility would be to use the variables module (optionally) and implement hook_variables().

alan d.’s picture

Status: Needs review » Reviewed & tested by the community

This is a nice feature. I do not think an UI is required.

Once #1280892: Diff should track the variables that it defines is pushed through, this can be finished off with:

    $node_types = array_keys(node_type_get_types());
    foreach ($node_types as $node_type) {
      variable_del('enable_revisions_page_' . $node_type);
      variable_del('show_diff_inline_' . $node_type);
      variable_del('show_preview_changes_' . $node_type);
    }
+   variable_del('diff_leading_context_lines');
+   variable_del('diff_trailing_context_lines');
alan d.’s picture

Version: 7.x-2.0-beta2 » 7.x-3.0-alpha1

This should be resolved with the new branch, 7.x-3.0-alpha1 or 7.x-3.0-dev.

This is still alpha, so test carefully before use on a production site and report any issues back to the queues.

Leaving open to backport

mitchell’s picture

Version: 7.x-3.0-alpha1 » 7.x-3.x-dev
Status: Reviewed & tested by the community » Fixed

Backport requests should be made in separate issues, when necessary.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.