...
even if we jump aross two files, we had to press "ALT + up arrow".
This is really annoying. I suggest the browseTracker could automatically record the caret position, so it can easily go backward and forward. (Note, if you have used Visual Assist plug of Visual C++, you're familiar with this behavior)
...
There is no way to control what Visual Assist X considers a location worth remembering. Generally speaking, Visual Assist X remembers files and lines visited. Small movements are ignored.
void ContextCpp::OnGotoFunctionStart(wxCommandEvent& event)
{
int line_number = GetCtrl().LineFromPosition(GetCtrl().GetCurrentPos());
TagEntryPtr tag = TagsManagerST::Get()->FunctionFromFileLine(GetCtrl().GetFileName(), line_number);
if (tag) {
// move the caret to the function start
BrowseRecord jumpfrom = GetCtrl().CreateBrowseRecord();
GetCtrl().SetCaretAt(GetCtrl().PositionFromLine(tag->GetLine()-1));
// add an entry to the navigation manager
NavMgr::Get()->AddJump(jumpfrom, GetCtrl().CreateBrowseRecord());
}
}
void cbEditor::OnEditorUpdateUI(wxScintillaEvent& event)
{
if (Manager::Get()->GetEditorManager()->GetActiveEditor() == this)
{
NotifyPlugins(cbEVT_EDITOR_UPDATE_UI);
HighlightBraces(); // brace highlighting
m_pData->HighlightOccurrences();
}
OnScintillaEvent(event);
}
@ollydbg
I found that the highlightbrace was done in these codes in cbeditor.cpp.
so I think we can do something here.Codevoid cbEditor::OnEditorUpdateUI(wxScintillaEvent& event)
{
if (Manager::Get()->GetEditorManager()->GetActiveEditor() == this)
{
NotifyPlugins(cbEVT_EDITOR_UPDATE_UI);
HighlightBraces(); // brace highlighting
m_pData->HighlightOccurrences();
}
OnScintillaEvent(event);
}
I am not sure.but we can have a try,afterall ,highbrace is handled by this message.I don't agree with you.
SCN_UPDATEUI
Either the text or styling of the document has changed or the selection range has changed. Now would be a good time to update any container UI elements that depend on document or view state. This was previously called SCN_CHECKBRACE because a common use is to check whether the caret is next to a brace and set highlights on this brace and its corresponding matching brace. This also replaces SCN_POSCHANGED, which is now deprecated.
@ollydbg
a idea come out.
maybe can hook the left mouse click message.
if user move the caret position several times in a second.Thanks for the hint.
I'm carefully reading the scintilla document. For Editor_update message, here is the description:QuoteSCN_UPDATEUI
Either the text or styling of the document has changed or the selection range has changed. Now would be a good time to update any container UI elements that depend on document or view state. This was previously called SCN_CHECKBRACE because a common use is to check whether the caret is next to a brace and set highlights on this brace and its corresponding matching brace. This also replaces SCN_POSCHANGED, which is now deprecated.
Not quite understand its meaning.
Pavel Baranov:
> A common windows practice it to show the caret line and sometimes column
> positions in the gui status bar window.
SciTE does this. When you want to find out how to implement a feature
SciTE is a very good source. SciTE uses SCN_UPDATEUI.
The contributor of SCN_POSCHANGED was performing a large amount of
background processing that depended on the editor context. The intent of
SCN_POSCHANGED was to notify the container when that context changed so that
the background tasks could be aborted. This context was never well specified
and the notification never really meant that the caret position changed.
I have removed SCN_POSCHANGED from the main documentation and added it to
the deprecated section.
Neil
void MainFrame::OnEditorUpdateUI(CodeBlocksEvent& event)
{
if(Manager::isappShuttingDown())
{
event.Skip();
return;
}
if (Manager::Get()->GetEditorManager() && event.GetEditor() == Manager::Get()->GetEditorManager()->GetActiveEditor())
{
DoUpdateStatusBar();
}
event.Skip();
}
i think it would be esay to modify browsetracker plugin.If you review the source in browsetracker, you will find it is really complecated.
according to guild line,2 has been done by this plugin. and
3 is also done too.
so we just need to hook the plugin ,and do some work here ,i
think it would be easy, and according to address you post ,i
can not found that source codes.can you pass me one?
Hi, all.
Did you notice this issue:
When I just right click on an variable, then select "Find deceleration of XXX", then after see its type, I would just "jump back" to the original position.
Currently, what we can do is using the browsTracker plugin, I can hold the left mouse button before the jump, then if I want a jump back, I can press ALT+ left arrow button, even if we jump aross two files, we had to press "ALT + up arrow".
This is really annoying. I suggest the browseTracker could automatically record the caret position, so it can easily go backward and forward. (Note, if you have used Visual Assist plug of Visual C++, you're familiar with this behavior)
I just want any comment and objection of this feature request.
Thanks.
I want to share some ideas that came to my mind. I agree that a navigation like forward and backward is very useful, but I think a typical scenario is not covered with it.
You start a workflow like open declaration of function foo, then here you open another declaration of functions bar etc. Now after different steps you want to go to foo, since it is perhaps a very important function.
So what I am think about is some kind of labeled Bookmarks which can be managed and sorted in a favorite list. Imagine you are in the editor at function foo and open a context menu add Bookmark Label. Now this label appears a favourite list, e.g. a dockable windows in the message console. With this mechanism frequently used functions or relevant source code line could be accessed very easily.
Perhaps also a sort criterion like (sort by access frequency from favourite list) could be nice. What are you thinking about?
In the Filemanager Plugin there is already a favourite manager for directories and I find it very convenient.
Hi ollydbg,Ok, I will try and do a test!
you can download the filemanager from http://developer.berlios.de/projects/cbilplugin/.
The documentation can be found here: http://www.codeblocks.org/docs/main_codeblocks_en.html