Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
* it must be initialized after the UI (Interface::main), so I added
a View::initialize() function
* the old initialize() method was renamed to setup()
* use a global instance of QRegister::view so it is guaranteed to
be destroyed only after any QRegisters that could still need it
* Document API adapted to work with ViewCurrent references
|
|
The user interface provides a Scintilla view abstraction and
every buffer is based on a view. All Q-Register strings use
a single dedicated view to save memory and initialization time
when using many string registers.
* this means we can finally implement a working lexer configuration
and it only has to be done once when the buffer is first added
to the ring. It is unnecessary to magically restore the lexer
styles upon rubout of EB (very hard to implement anyway). It
is also not necessary to rerun the lexer configuration macro
upon rubout which would be hard to reconcile with SciTECO's
basic design since every side-effect should be attached to a
character.
* this means that opening buffers is slightly slower now
because of the view initialization
* on the other hand, macros with many string q-reg operations
are faster now, since the document must no longer be changed
on the buffer's view and restored later on.
* also now we can make a difference between editing a document
in a view and changing the current view, which reduces UI calls
* the Document class has been retained as an abstraction about
Scintilla documents, used by QRegister Strings.
It had to be made virtual, so the view on which the document
is created can be specified by a virtual function.
There is no additional space overhead for Documents.
|
|
normally, since SciTECO is not a library, this is not strictly
necessary since every library should use proper name prefixes
or namespaces for all global declarations to avoid name clashes.
However
* you cannot always rely on that
* Scintilla does violate the practice of using prefixes or namespaces.
The public APIs are OK, but it does define global functions/methods,
e.g. for "Document" that clashed with SciTECO's "TECODocument" class at
link-time.
Scintilla can put its definitions in a namespace, but this feature
cannot be easily enabled without patching Scintilla.
* a "SciTECO" namespace will be necessary if "SciTECO" is ever to be
turned into a library. Even if this library will have only a C-linkage
API, it must ensure it doesn't clutter the global namespace.
So the old "TECODocument" class was renamed back to "Document"
(SciTECO::Document).
|
|
|
|
documents
* fixes search-replace commands when function keys are used since they rely on selections
not being disturbed
* will also be useful later when there may be other selections
|
|
* also encapsulates data properly (previously there were many public
attributes to avoid permission issues)
* new class also cares about saving/and restoring scroll state.
now, buffer/q-reg edits and temporary accesses do not reset
the scroll state anymore.
|