The line number (position) of a line of text or code inside a file, often for debugging.
Questions tagged [line-numbers]
369 questions
10
votes
5 answers
java decompiler with save line numbers in actual physical position
Many IDE's debugger match the physical line number.
I'm looking for java decompiler with saving actual line number in decompiling code.
http://java.decompiler.free.fr/ is not one.

qwazer
- 7,174
- 7
- 44
- 69
10
votes
2 answers
Get line number of method caller?
Is there any way to get the line number of the caller of a method in Java? I don't want to have to throw an exception. Do I have to work with stack traces? Is there any way to do this in a cheap way?
EDIT: To clarify, I don't want the line number of…

nulldev
- 555
- 6
- 16
10
votes
1 answer
Why do I get no line numbers from a stack trace created from Exceptions?
Okay; assuming this code running in debug mode -
static StackFrame GetTopFrameWithLineNumber(Exception e)
{
StackTrace trace = new StackTrace(e);
foreach (StackFrame frame in trace.GetFrames())
{
if (frame.GetFileLineNumber() !=…

EightyOne Unite
- 11,665
- 14
- 79
- 105
10
votes
5 answers
Show LineNumbers from the RichTextBox in WPF
I found an example, how to show the LineNumbers from a RichTextBox in Windows Forms.
http://www.codeproject.com/Articles/38858/Line-Numbers-for-RichText-Control-in-C
Have somebody an example for it in WPF?
Edit:
Does someone have work with…

Karl_Schuhmann
- 1,272
- 5
- 17
- 37
9
votes
2 answers
When processing a file, how do I obtain the current line number?
When I am looping over a file using the construct below, I also want the current line number.
with codecs.open(filename, 'rb', 'utf8' ) as f:
retval = []
for line in f:
process(line)
Does something akin to this exist…

Frankie Ribery
- 11,933
- 14
- 50
- 64
9
votes
5 answers
How to access line numbers when wrapping Firebug (or similar) Console api
I have wrapped the console API to provide granular logging levels as well as few other sugar features.
This works fine, the only problem is that firebug (or whatever other console) will always report the line number the log came from as the line the…

Ollie Edwards
- 14,042
- 7
- 28
- 36
9
votes
2 answers
C++ Eclipse Galileo getting it to display line numbers - how?
EDIT: jldupont's suggestion (see below) did the trick
Window -> Preferences -> General -> Editors -> Text Editors -> Show line numbers
I just installed Eclipse Galileo (first time) and am programing in C++ and couldn't get the editor to display…

Wallter
- 4,275
- 6
- 29
- 33
8
votes
2 answers
Vim, how to map two tasks under one shortcut key?
i like to have line numbers ON in Vim but sometimes line numbers are annoying. I have shortcuts set in .vimrc:
map :set nonumber
map :set number
for turning them off/on.
Is it possible to connect both tasks (turning…

jotbek
- 1,479
- 3
- 14
- 22
8
votes
3 answers
How to get surrounding method in Java source file for a given line number
I have a line number of a Java source file and want to get the sourounding method for that line number programatically.
I looked into ANTLR which didn't help me much.
Janino (http://www.janino.net) seems promising, I would scan and parse (and if…

roesslerj
- 2,611
- 5
- 30
- 44
8
votes
3 answers
How to activate revision info in line number view
I know of an Eclipse feature to show revision information (gradual coloring, more info like revisionnumber, date and author on mouseover) for the last changes in a line in the linenumbers-view.
Does anyone know how to activate this feature for a…

Joshua
- 83
- 1
- 3
7
votes
4 answers
Remove line numbers from SyntaxHighlighter
Is there any way to remove the line numbers of SyntaxHighlighter?
Thanks!

Paulo
- 7,123
- 10
- 37
- 34
7
votes
1 answer
Dynamically change line-numbering settings in Visual Studio Code
I know I can change the line-numbering in Visual Studio Code to relative by adding the line "editor.lineNumbers": "relative", to the settings.json file, but I am looking for a way to bind it to a keybinding such that I can toggle between absolute…

Testare
- 338
- 3
- 12
7
votes
2 answers
PHP get line number from logging event
Ok I have another question HERE for my Logging Class but I wanted to be able to add the line number of the calling script to the log file entry.
I have seen __Line__ but this gives me the line number of the line where this is at.
Example:
a.php
$log…

Phill Pafford
- 83,471
- 91
- 263
- 383
7
votes
3 answers
Show breakpoint at line number in RichTextFx CodeArea
I'm working with RichTextFx's CodeArea to highlight custom mini language code.
Now while executing this code I want to show a small arrow in front of current executed line. I know the specific line number but can't get anything to happen with the…

Oli
- 240
- 1
- 10
7
votes
3 answers
Output line number in Rails log file
From the Rails Guide on debugging, I found that I can customize output to my log files using this simple method:
logger.debug "Person attributes hash: #{@person.attributes.inspect}"
I decided use this to track how a variable changes and goes…

user94154
- 16,176
- 20
- 77
- 116