Menu

#14 LibView CodeEditor: Undo/Redo

open
nobody
IDE (11)
7
2001-10-18
2001-10-18
helenra
No

Undo-Information shouldn't get lost by switching
between tabs. There should be a seperate undo stack
for each tab, like one would expect for a traditional
multi-file editor.

Discussion

  • helenra

    helenra - 2001-10-18
    • priority: 5 --> 7
     
  • Andrew McKinlay

    Andrew McKinlay - 2001-10-18

    Logged In: YES
    user_id=329449

    That makes sense but I'm not sure what's the best way to
    implement it. Currently the Scintilla control implements
    undo/redo and LibView uses a single Scintilla control.
    When you switch tabs the contents of the Scintilla control
    is replaced. The "state" that is saved for each tab does
    not include the undo/redo information. I'm not sure if
    it's possible to get/set this information. An alternative
    would be to have a separate Scintilla control for each tab.
    This would obviously use more resources and might mean
    limiting the number of open tabs.

    Originally, no state was saved with the tabs, so I viewed
    them more as a "history" of what records you've viewed.
    But now they are more like "open files".

     
  • helenra

    helenra - 2001-10-23

    Logged In: YES
    user_id=328851

    From the Scintilla documentation:

    Multiple Views
    SCI_GETDOCPOINTER
    SCI_SETDOCPOINTER(<unused>,document *pdoc)
    SCI_CREATEDOCUMENT
    SCI_ADDREFDOCUMENT(<unused>,document *pdoc)
    SCI_RELEASEDOCUMENT(<unused>,document *pdoc)

    This is to allow simple split views of documents and so
    applications may maintain multiple buffer which may be
    individually selected into the editor. Each Scintilla has a
    pointer to a used document. Initially the used document is
    a default one created when the Scintilla was created. The
    SCI_GETDOCPOINTER call returns a pointer to the used
    document. SCI_SETDOCPOINTER sets the used document.
    SCI_SETDOCPOINTER(0) switches to a new empty document.
    Before closing down Scintilla make sure all document
    pointers retrieved are released to avoid memory leaks.

    A new document may be created by SCI_CREATEDOCUMENT which
    returns a pointer to the document. This document is not
    selected into the editor and starts with a reference count
    of 1. A document may be released with SCI_RELEASEDOCUMENT
    and have its reference count incremented with
    SCI_ADDREFDOCUMENT.

    ---

    If I understand well these functions provide the mechanism
    to switch between the "files".

     

Log in to post a comment.