Closed Bug 207656 Opened 21 years ago Closed 18 years ago

Line and column numbers in view source statusbar

Categories

(Toolkit :: View Source, enhancement)

1.8 Branch
enhancement
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.8.1alpha2

People

(Reporter: bugzilla+bz, Assigned: philor)

References

Details

(Keywords: fixed1.8.1)

Attachments

(2 files, 8 obsolete files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030530 Mozilla Firebird/0.6
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030530 Mozilla Firebird/0.6

description from bug 104383

The View Source window needs the capability to go to a specific line number in
the source.

Here is how such a feature might work:

1. The user selects Edit | Go to Line #...
2. The user types a line number in a field and clicks the Go button or presses
the Enter key
3. The line is displayed and highlighted, with the window scrolled all the way
to the left side so the beginning of the line can be seen, and perhaps the
dialog is dismissed

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Confirming
Status: UNCONFIRMED → NEW
Ever confirmed: true
add line numbering statusbar
revised patch may have bits i.e. the properties file missing

additional line for attachment 124581 [details] [diff] [review] portion that deals with this :

+statusBarLineCol  = Line %1$S, Col %2$S
includes properties file this time
Attachment #127888 - Attachment is obsolete: true
Summary: MozillaFirebird : Ability to go to specific line number in View Source window
a description, why djst nulled it I don't know

n.b. if there are tabs in the source window this code treats an 8 char wide tab
as a single char, i.e. 1 column width

I didn't write it, I just ported it
Summary: Firebird implementation of Seamonkey view-source additions
<bugspam>Sorry, don't know what happened there. I was using an unofficial build
that was optimized for PIII, etc. and had problems with input fields. Maybe
that's why.</bugspam>
Comment on attachment 127890 [details] [diff] [review]
hopefully adj version of attachment 127888 [details] [diff] [review]

This is not the patch that was checked in for bug 15364. You just have to copy
viewsource.js from xpfe/ to toolkit/, to get the latest (& greatest). Not
necessary to mess where there is no need to.
not quite, since there are XUL changes as well, and toolkit/'s version is called
viewSource.js : P
xpfe/viewsource.js and toolkit/viewSource.js are the same (i.e., actually 'were'
the same at the fork, but toolkit/viewSource.js has now missed the
iterations/improvements that went into xpfe/viewsource.js).

Might be safer to copy viewsource.js to viewSource.js, as the basis, and just
add the .xul changes. Here are the changes that were checked in:
http://bonsai.mozilla.org/cvsquery.cgi?module=allrepositories&branch=&dir=&file=&who=rbs%25maths.uq.edu.au&sortby=Date&hours=2&date=month
Mozilla Firebird != Mozilla Seamonkey

Don't port all Mozilla new features to Firebird.
You can use your favorite and powerful text editor for view-source by extension.
http://texturizer.net/firebird/extensions.html#MozEX

I'll mark as WONTFIX.
I'm one of the few people who doesn't want view-source opening outside my browser
We should fix this because:
1. I don't want to use a bloated html editor which takes ages to start if I only
want to have a look at the source.
2. Most text editors haven't got syntax highlighting and find-as-you-type, which
I like a lot.
3. HTML/CSS validators and the JavaScript Console refer to line numbers. Life
would be easier if these were displayed.
4. Even the simple Windows Notepad has got line and column numbers and a goto
line function (ctrl-g)!
5. From bug 15364 comment 56:
"I don't think that an external editor is an appropriate substitute for a line
numbered viewsource.  

Most of the time, I already have the source open in an editor.  I don't need
another instance of the editor opening with yet another copy of the source nor
do I want my current instance of the editor to prompt me with "This document is
already open.  Do you wish to revert to the saved original?"  Nine times out of
ten, all I want is to see a particular error in context.  A line numbered
viewsource would help immensely.  Better yet, I love to see links in every error
console that opened viewsource with the line in question highlighted.

Being able to view source in an external editor is one of IE's better features
but having no choice but to view source in an external editor is one of IE's
worst. That said, I rather suffer the latter to enjoy the former."
QA Contact: asa
there's different views on where this is going, keep in mind that JS console
will be an optional component soon, if this type of functionality in view source
is desired, maybe it should be as part of the web devel component?
Summary: Firebird implementation of Seamonkey view-source additions → Firebird implementation of Seamonkey view source additions
Reassigning to Pierre, who currently works on view source.
He just implemented "Go to line...", but we're still missing the line numbering
statusbar.
Assignee: blake → p_ch
Attachment #124581 - Attachment is obsolete: true
Summary: Firebird implementation of Seamonkey view source additions → Firefox implementation of Seamonkey view source additions
This simple patch adds a status bar to the View Source window.

The code for calculating line numbers is already there (copied from Seamonkey).
The line that actually prints the calculated line number in the status bar was
commented out - I have put that code back in.
Attachment #127889 - Attachment is obsolete: true
Attachment #127890 - Attachment is obsolete: true
Attachment #142633 - Flags: review?
You've got to ask somebody for review, see
http://www.mozilla.org/projects/firefox/review.html
Attachment #142633 - Flags: review? → review?(p_ch)
-> View Source.
Component: General → View Source
QA Contact: firefox.view-source
Flags: blocking-aviary1.0?
The time for feature work is past.  This is something that'd be useful, but its
not something we should take at this point.
Flags: blocking-aviary1.0? → blocking-aviary1.0-
Hmm this has a patch, the patch is tiny and looks uncritical - is it ready for
review? This is something that is essential for anyone who does web development
and wants to take the move from Mozilla to FF. 
johann.petrak@chello.at, those people will have to wait until 1.5 then. We're
well beyond the point for taking major feature changes or additions. W're going
to be shipping this thing in about a month and that means saying no to way more
actual bugs than we'd like. Features rank well behind bugs in priority and often
bring new bugs of their own. This just shouldn't happen for 1.0. Too late.
We should either fix this bug or remove the flashing cursor in view source for 1.0.
Flags: blocking-aviary1.0-
that's pretty minor/trivial Dean, we're getting closer to final every day, and I
don't recall seeing _a_ bug/complaint about that.  If there's an excessively
low-risk fix, great, but I couldn't see justifying anything extensive.
Yeah, you're right.  I was just getting a little frustrated with View Source
last night (thus bug 262668).  Back to minus.
Flags: blocking-aviary1.0-
*** Bug 278436 has been marked as a duplicate of this bug. ***
Flags: blocking-aviary1.1?
Flags: blocking-aviary1.1? → blocking-aviary1.1-
(In reply to comment #22)
> Created an attachment (id=156188) [edit]
> Patch for trunk that enables display of current column/line number in status
> bar

(Chris Neal) if patch attachment 156188 [details] [diff] [review] and 151687 were tested, don't they needs
to be set for review http://www.mozilla.org/projects/firefox/review.html 
something so trivial should prob make it for 1.8b4

and should 142633 be marked obsolete?

What's about this bug, why didn't you check the code in ? Are there problems
with FF1.5 ? 
Now we are close to 1.5 maybe you can check it into the trunk so that this
feature is in FF2.0
Attached patch Patch for latest trunk (obsolete) — Splinter Review
Attachment #156188 - Attachment is obsolete: true
Attachment #197895 - Flags: review?(p_ch)
Comment on attachment 156187 [details] [diff] [review]
Patch for AVIARY branch that enables display of current column/line number in status bar

Way too late for 1.0.x
Attachment #156187 - Attachment is obsolete: true
So the code's long since written and burned in, and all that's needed is someone who will nag for review (from someone still active)? This sounds like a job tailor-made for me ;)
Summary: Firefox implementation of Seamonkey view source additions → Line and column numbers in view source statusbar
Target Milestone: --- → Firefox 2 alpha2
Version: unspecified → Trunk
Assignee: p_ch → philringnalda
Attachment #142633 - Attachment is obsolete: true
Attachment #197895 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #220281 - Flags: review?(mconnor)
Attachment #142633 - Flags: review?(p_ch)
Attachment #197895 - Flags: review?(p_ch)
Version: Trunk → 2.0 Branch
Attachment #220281 - Flags: approval-branch-1.8.1?(mconnor)
Comment on attachment 220281 [details] [diff] [review]
Let there be numbers


>   gLastLineFound = line;
> 
>-  //pch: don't update the status bar for now
>-  //document.getElementById("statusbar-line-col").label = getViewSourceBundle()
>-  //    .getFormattedString("statusBarLineCol", [line, 1]);
>+  document.getElementById("statusbar-line-col").label = getViewSourceBundle()
>+      .getFormattedString("statusBarLineCol", [line, 1]);

This formatting makes babies cry.

  document.getElementById("statusbar-line-col").label = 
    getViewSourceBundle().getFormattedString("statusBarLineCol", [line, 1]);

At a minimum, for readability, but oy, this is all over the place!  The prevailing style seems to be to suck.
Attachment #220281 - Flags: review?(mconnor)
Attachment #220281 - Flags: review+
Attachment #220281 - Flags: approval-branch-1.8.1?(mconnor)
Attachment #220281 - Flags: approval-branch-1.8.1+
Fewer tears is a good thing.
Whiteboard: [checkin needed]
Checked in, branch and trunk.
mozilla/toolkit/components/viewsource/content/viewSourceUtils.js	1.4
mozilla/toolkit/components/viewsource/content/viewSource.xul	1.30
mozilla/toolkit/components/viewsource/content/viewSource.js	1.16
mozilla/toolkit/components/viewsource/content/viewSourceUtils.js	1.3.10.3
mozilla/toolkit/components/viewsource/content/viewSource.xul	1.24.2.4
mozilla/toolkit/components/viewsource/content/viewSource.js	1.13.4.2
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Whiteboard: [checkin needed]
The checkin accidently referenced bug 307656 instead of this bug.
I also forgot to credit Phil and Chris for the patch :(
Product: Firefox → Toolkit
Verified Fixed.

Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.3a1pre) Gecko/20100114 Minefield/3.7a1pre (.NET CLR 3.5.30729) ID:20100114042800
Status: RESOLVED → VERIFIED
verified, fixed but when is it going to be in firefox? there are still no line numbers in view source :(
Norman, this bug is about putting numbers in the status bar of the view source window, and they're present in Firefox.  You're looking for a different bug about having them as numbers on each line, I expect.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: