Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #1059 -- Fixed line numbers off-by-one error in debug output

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2420 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 47f040d2eb6e2cc91b4e482225b4109b92e949bf 1 parent 92c04cb
Adrian Holovaty authored February 27, 2006

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  django/views/debug.py
6  django/views/debug.py
@@ -349,11 +349,11 @@ def _get_lines_from_file(filename, lineno, context_lines):
349 349
         {% if frame.context_line %}
350 350
           <div class="context" id="c{{ frame.id }}">
351 351
             {% if frame.pre_context %}
352  
-              <ol start="{{ frame.pre_context_lineno }}" class="pre-context" id="pre{{ frame.id }}">{% for line in frame.pre_context %}<li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')">{{ line|escape }}</li>{% endfor %}</ol>
  352
+              <ol start="{{ frame.pre_context_lineno|add:"1" }}" class="pre-context" id="pre{{ frame.id }}">{% for line in frame.pre_context %}<li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')">{{ line|escape }}</li>{% endfor %}</ol>
353 353
             {% endif %}
354  
-            <ol start="{{ frame.lineno }}" class="context-line"><li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')">{{ frame.context_line|escape }} <span>...</span></li></ol>
  354
+            <ol start="{{ frame.lineno|add:"1" }}" class="context-line"><li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')">{{ frame.context_line|escape }} <span>...</span></li></ol>
355 355
             {% if frame.post_context %}
356  
-              <ol start='{{ frame.lineno|add:"1" }}' class="post-context" id="post{{ frame.id }}">{% for line in frame.post_context %}<li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')">{{ line|escape }}</li>{% endfor %}</ol>
  356
+              <ol start='{{ frame.lineno|add:"2" }}' class="post-context" id="post{{ frame.id }}">{% for line in frame.post_context %}<li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')">{{ line|escape }}</li>{% endfor %}</ol>
357 357
             {% endif %}
358 358
           </div>
359 359
         {% endif %}

0 notes on commit 47f040d

Please sign in to comment.
Something went wrong with that request. Please try again.