Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] lineChangedEvent


Hi guys,

I am making a view add-on, and I want to update it's contents based on the current line of the active editor.
Is there a way to listen for line-changed events of the active editor? 

I tried ((ITextViewer)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getAdapter(ITextOperationTarget.class)).getSelectionProvider().addSelectionChangedListener(  ...  );
hoping to track the curret possition but it only triggers when the selected text changes.

Following that I tried

((ITextViewer)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getAdapter(ITextOperationTarget.class)).getTextWidget().addCaretListener( ... )
but it triggers whenever the curret moves, and I don't know how to get the current line information out of that.


thank you in advance,

Lefteris

Back to the top