Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to navigate to character location in WebStorm?

I'm wondering how can I can navigate to a character location? I have a script that will tell me the character location number, no line number.

INFO: log-process/3093 on local-machine: Some Log Message

The 3093 is the character location number.

like image 286
jemiloii Avatar asked Mar 17 '15 15:03

jemiloii


4 Answers

I do this by selecting code from the start of the file. Then, total number of selected characters is displayed in the bottom right corner, so I can find the character that I only knew the number of.

like image 119
David Hudec Avatar answered Oct 11 '22 20:10

David Hudec


In WebStorm, if you mouse click on the file line and char count in the bottom bar:

enter image description here

it will open up a dialog where you can type in the line and char position:

enter image description here

like image 23
Justin Schwartzenberger Avatar answered Oct 11 '22 19:10

Justin Schwartzenberger


I had the same situation today. I have a minifed and uglified javascript file, and I was simply searching manually for error (14, 4974). In the bottom right corner of Webstorm, you can see the line number and character position.

enter image description here

Searching for lets say line 14 and position 18438 is not an easy task, but clicking inside the script file may help you to pin point the location.

like image 28
John Avatar answered Oct 11 '22 18:10

John


No such navigation action exists. You'll need to either 1) Search for a plug-in that will do this; 2) write your own plug-in to do it; or 3) Open a feature request to add such functionality.

UPDATE

The "Go to Line" dialog was enhanced to be "Go to Line:Column". You can open it by:

  • Ctrl+G / +L
  • Menu: Navigate > Line:Column
  • Click on the cursor position in the bottom right of the window. For example: cursor position indication

This will open the Go to Line:Column dialog:

Go to Line:Column Dialog

In the dialog, you can enter a value such as 10:15 to go to the 15th character on line 10. You can also enter just a line, 10 which will take you to the start of that line (line 10 in this example). Or you can enter just a character position, for example :15, which will take you to that character position on the current line.

However, I am still unaware of a way say "Navigate to the Nth character position in the file". And the original poster's feature for such a feature is still open.

like image 27
Javaru Avatar answered Oct 11 '22 19:10

Javaru