views:

486

answers:

3

This is not an Eclipse-programming question, but rather a question about the Eclipse user-interface in general.

I am writing a verilog source-code in an Eclipse text-editor using the simplifIDE plug-in. I want to align my code so that variable names always start at offset 33 (32 spaces from the left margin)

Does Eclipse have an option for displaying the current cursor position in a status bar? I'd even be happy with a keyboard shortcut that would pop the current cursor-position up in an dialog.

In the absence of a solution, I'll set my tabs to 4-spaces, and put the following text at random places in my file:

//..5...9...13..17..21..25..29..33..37..41..45..49..53..57..61..65..69..73..77..81..

+1  A: 

Some editors (such as the built in Java editor) display the current insertion point location in the status bar. However, if you use a third-party editor sch as SimplifIDE, you may have to check its own configuration for that option.

If you write your own editor, you could ask the editor to give you the selection provider, as the selection provider can also provide the current insertion point location.

Uri
I've opted for the veditor plugin instead. It has the feature built-in and is a "less ambitious(?)" editor that provides what I need.
SmileAndNod
A: 

There is a new API in 3.5 which allows you to listen to cursor movements (see this bug). Then, you can ask for the index of the first character in the current line and subtract that from the absolute cursor position. This gives you the offset in characters.

This is not accurate though; if your editor supports real tabs, then you must query the editor for the current line and count characters yourself (where the tab counts as 2..8 character positions).

Aaron Digulla
Thanks for the help, but I'm not ready to venture into Eclipse programming yet. As a complete newbie to eclipse, it still seems to me that if eclipse is smart enough to figure out that a plug-in is a text editor, it should have some basic concept of cursor-position within a line. It certainly has a concept of line-numbers and allows these to be displayed in any editor window... why not a horizontal ruler?
SmileAndNod
Because "any editor window" extends the correct base class and uses the correct API to reuse this feature. The feature you're asking for wasn't there when your editor was written and Eclipse can't add new function to existing code because Java doesn't allow that.
Aaron Digulla
A: 

Using Eclipse 3.5 with the SimplifIDE plugin, I am seeing the correct information for the line and column on a status bar on the bottom of the screen with a {line : column} format using either tabs or spaces.

thedeserthorizon, Are you using 3.5 and the version 1.0.26 of Simplifide.

Andy Wagner
I am using 3.51 of Eclipse (Galileo) and 1.1.26 of SimplifIDE (as displayed in the installation history). I have the editor set to use spaces.I just reinstalled, and created a new Hardware project based on the example verilog suite. When I go to the project explorer and pick a file from the rtl sub-folder (say fifoRTL.v), I lose the line/column position data. so a bug may have crept in there somewhere.I the meantime, IMHO Eclipse needs a menu item related to this... but that's beating a dead horse. We should probably move this discussion elsewhere? Is there a simplifIDE bug tracker?
SmileAndNod
There isn't a bug tracker setup. You can mail me directly at [email protected]
Andy Wagner
One other thing I should mention.. I've installed this on a new PC with Windows 7. The JRE is version 6, update 16.
SmileAndNod
Version 1.1.27 and above have a fix for this.
SmileAndNod