[Bug 82662] New: new feature: (global) cursor position history

andreas braendle abraendle at gmx.de
Fri Jun 4 00:54:32 UTC 2004

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
           Summary: new feature: (global) cursor position history
           Product: kdevelop
           Version: unspecified
          Platform: SuSE RPMs
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: wishlist
          Priority: NOR
         Component: general
        AssignedTo: kdevelop-devel kdevelop org
        ReportedBy: abraendle gmx de

Version:            (using KDE KDE 3.2.1)
Installed from:    SuSE RPMs
OS:                Linux

i've written a class (some months ago)
someone must intergrate it into kdevelop

it's a pretty sophisticated feature already.

description&howto is included


// Documentation:

// implements a global CursorPositionHistory for qeditor (?) etc.
// usful when working with large projects/files, and having to do changes in
several files
// makes finding interesting positions again a lot easier (for example while
browsing the code);
// also useful during finding out how the code of a certain program is
// also useful when working only with a large single file, as i found out :)
// can be more practical than & is not intended as a substitute for bookmarks

Special features:
- if navigating within a "block" of +/- 7 lines no additional history entry
is inserted
- if navigating back and then changing the cursor position, the "future"
- NavigateLeave deletes the current entry out of the history list (=leave
this position),
(it also pushes it onto a small stack -> NavigatePop to get it back)

I would have proposed to use the 4 keys Ctrl-Alt-Left/Right/Up/Down, but they seem to be already
used for other purposes.

...Ctrl-Alt-Shift-Left/Right are also already used

other proposals:

Ctrl-Alt-4/5/6/8 (Numpad)

("light" version with 2 or 3 keys possible)

QEditorWidget* NavigateBack(int &line, int &column);     // Ctrl-Alt-Left
for example
 QEditorWidget* NavigateLeave(int &line, int &column);    // Ctrl-Alt-Up
for example
 QEditorWidget* NavigateForward(int &line, int &column);  // Ctrl-Alt-Right
for example
QEditorWidget* NavigatePop(int &line, int &column);      // Ctrl-Alt-Down
for example (3key-version: optional)

stack:   i
Pos2     |
Pos1     v
  *---------------------*  UP
                        |  DOWN
history <<<<<-------- current ------------>>>> future

 LEFT                                     RIGHT

int l,c;
QEditorWidget* p;

if (p=NavigateBack(l,c)) {setviewactive?(p); setcursor(p,l,c); }


// INTEGRATION: [see source files]
// perhaps the Application/mainwindow should catch these events and then
change to the correct
// editor-window+line+column

// SideEffects/NECESSARY CHANGES to rest of the Editor-code:
// uses QEditorWiget* pointers to identify which of the currently open files
is meant
// Editor Codes has to inform this Class and use it, and also inform it when
a file is closed
// Application has to create one object of this class

More information about the KDevelop-devel mailing list