The line number (position) of a line of text or code inside a file, often for debugging.
Questions tagged [line-numbers]
369 questions
7
votes
1 answer
How do debuggers know the line numbers in the source code?
Debuggers like the ones in Eclipse, NetBeans, Visual Studio etc
I am wondering because, debuggers work on the machine code while it is being executed...
How they keep track of the line numbers in the source code?
Isn't it very difficult to keep…

Sam
- 1,842
- 3
- 19
- 33
6
votes
0 answers
line numbers for content editable div
I am trying to show line numbers to a div that is contenteditable. So the content is not static and can be edited like a normal editor.
So far I could add line numbers but when I add new lines or delete a line it is not behaving properly.
Here is…

Nagaraju
- 1,853
- 2
- 27
- 46
6
votes
2 answers
How to PERMANENTLY link to a line number in GitHub?
Linking to a line number in GitHub is easy: clicking on the line edits the URL to point to that line so we can share it.
However, if the file changes with a new commit, the line numbers may offset and this renders the existing links as inaccurate…

Guillaume Chevalier
- 9,613
- 8
- 51
- 79
6
votes
1 answer
Converting BCI (bytecode indices) to source code line numbers
I am writing JVMTI code to profile Java programs, which mostly entails obtaining stack traces from random threads at fixed time intervals using the function AsyncGetCallTrace. Thus, I am able to obtain CallTrace structures, each of which contains an…

user400348
- 236
- 2
- 7
6
votes
3 answers
Is there a way to copy code from eclipse including ine numbers
I am writing a little bit of documentation and code explanation. I would like to copy code from eclipse including line numbers, so that it becomes easier to reference the code in the text.
Is there any way to do this in eclipse or some other IDE,…

mrt181
- 5,080
- 8
- 66
- 86
6
votes
4 answers
Emacs line numbering performance
I've tried linum and nlinum. Both have dreadful performance on files with 100k+ lines.
$ for x in {1.100000}; do echo $x; done > 100k.txt
$ emacs -q 100k.txt
M-x load-library linum
M-x linum-mode
M-> ;; it's not too bad to go to end of file
M-< ;;…

Barry Kelly
- 41,404
- 5
- 117
- 189
6
votes
2 answers
Text editor with syntax highlighting and line numbers?
This is a bit challenging even probably for a team project, let alone for a one-man implementation, but I was trying to put together a simple yet elegant text editor with syntax highlighting, using a JEditorPane. I stumbled upon this which was…

Angelos Chalaris
- 6,611
- 8
- 49
- 75
6
votes
1 answer
Is it possible to make Hunspell print the line numbers of the misspelled words?
I am trying to use Hunspell to correct an essay I have written. Unfortunately, it is useless to me, as long as it doesn’t print the line numbers of the misspelled words.
So right now I am using the -a option, in order to be able to pipe it into the…

devsnd
- 7,382
- 3
- 42
- 50
5
votes
1 answer
Line numbers in jtextpane in Netbeans
I am using Netbeans 7.1. are there any option for displaying line numbers in jtextpane?

user1162286
- 81
- 1
- 7
5
votes
0 answers
Why is line number wrong in error stack trace in sveltekit app?
If I generate a sveltekit app skeleton with
npm create svelte@latest lineno
cd lineno
npm install
And then create a hooks handler script with a trivial handler generates an error myself, I get the wrong line number (4 instead of 2):
export const…

erikor
- 254
- 8
5
votes
4 answers
Is there a way to make vim recognize line numbers at end of filenames?
I work almost exclusively in the terminal, and very often I need to view files that appear in error stacktraces. A very common format is /some/file:99, where 99 is the line number. I'd like to be able to copy that line, and open goto that line…

Suan
- 34,563
- 13
- 47
- 61
5
votes
2 answers
How to get the line number from the call site using __LINE__ or some other method?
Consider this short program that I wrote:
#include
template
constexpr int add(const int& a, const int& b) {
if (Debug)
std::cout << __FUNCTION__ << " called on line " << __LINE__…

Francis Cugler
- 7,788
- 2
- 28
- 59
5
votes
1 answer
set relativenumbers colors in VIM
I use set relativenumber in VIM, and cannot imagine my life without it.
What bothers me is that the numbers above and below 0 look the same. If I see the number 9, I don't know if I have to 9j or 9k to jump there at first glance (and often go in the…

user1637056
- 382
- 3
- 18
5
votes
1 answer
Visual Studio Code line number difficult to read
For most dark themes the line number of visual studio code are too dark and difficult to read. How to make it brighter?
That is, how to format the line numbers in terms of font weight, brightness...

Arthur Cheung
- 71
- 1
- 2
5
votes
0 answers
Is getting line number in log an inherent issue in nodejs that no logging library can resolve?
I was about to use winston in my app, then I realised it can't show function name/line number in the log, which I think is pretty important for debugging a server side application.
After some digging, I found an explanation on winston's github…

swang
- 5,157
- 5
- 33
- 55