aboutsummaryrefslogtreecommitdiffhomepage
path: root/qbuffers.cpp
AgeCommit message (Collapse)AuthorFilesLines
2012-12-04refactoring: split qbuffers.cpp|h into a q-registers (qregisters.cpp) and ↵Robin Haberkorn1-1057/+0
Buffer ring part (ring.cpp)
2012-12-03fixed rubout of last-buffer-in-ring close: avoid premature closing of the ↵Robin Haberkorn1-2/+0
untitled buffer
2012-12-03organize buffer ring as a tail-q (double-linked list with tail pointer)Robin Haberkorn1-23/+32
* new buffers are added at the list tail * when closing a buffer, the next one is selected or the previous one if it is the tail * the ring may be traversed in reverse order * undoing a buffer close (Ring::UndoTokenEdit) could be cleaned up to only use standard macros (is slightly less efficient though)
2012-12-02support Q* (return current buffer's Id) and edit-by-id using <n>EB$Robin Haberkorn1-2/+73
2012-11-24support auto-completion of symbols in the scintilla command (ES)Robin Haberkorn1-3/+3
* does not yet handle case-insensitive completions * does not handle omitting of the SCI_ prefix
2012-11-22make sure the NULL filename is handled properly on WindowsRobin Haberkorn1-2/+2
2012-11-22Windows (MinGW32) compatibility changesRobin Haberkorn1-7/+30
* mainly we need a custom get_absolute_path() function using Win32 API * also the windows.h conflicts with some other headers (esp. BSD headers) * also there was a typo in the code setting file attributes
2012-11-21fixed QRegister::set_string() for macro-local Q-RegistersRobin Haberkorn1-1/+3
it is assumed that the undo() function saves the current document's DOT
2012-11-21Gq command to insert Q-Register at current DOTRobin Haberkorn1-0/+23
2012-11-20support :X commandRobin Haberkorn1-2/+22
2012-11-20fixed rubout of macro invocations: goto tables and q-registers are allocated ↵Robin Haberkorn1-11/+24
on the C++ call stack and configured to not emit undo tokens this introduces additional logic but has the huge advantage that the tables can be freed after the macro invocation. if undo tokens were emitted, the tables had to be kept in the undo stack so they can be restored during rubout. this however would be both complicated and unnecessarily inefficient since the tables would reach their initial state during rubout and be deallocated anyways. * similar (but not strictly necessary optimizations) can be performed for macro invocations * also wrapper Q-Register setting/getting -> will allow a custom "*" register getter (e.g. calculates buffer position on the fly)
2012-11-20cleanup macro execution functions: common namespace, Execute::file() uses ↵Robin Haberkorn1-47/+12
Execute::macro()
2012-11-20local Q-Register tables; :M commandRobin Haberkorn1-39/+53
* munged files use the same local Q-Registers as commandline * :M calls macro without new set of local registers (local register names refer to the parent macro level) * only .x names accepted at the moment. for string building characters, this will like stay that way (cannot refer to extended/long names)
2012-11-20errors when label cannot be found at end of macro invocationRobin Haberkorn1-0/+5
* on the command line the line terminating <ESC> is not accepted when a label was not found
2012-11-20goto table cleanupRobin Haberkorn1-4/+4
2012-11-20make goto tables local to macro invocation: they are declared on the C++ ↵Robin Haberkorn1-0/+7
callstack since macro invocations result in nested macro_execute() calls otherwise a macro could set labels with program counters which are invalid in other macros/the command line
2012-11-20fixed EB rubout when there is an ADD hook: must not remove buffer before ↵Robin Haberkorn1-8/+3
undoing hook
2012-11-20QRegister push-down stack: [x and ]x commandsRobin Haberkorn1-7/+114
* rubout is quite tricky but ensures minimal memory copying
2012-11-20ED flags making 0-Register hook execution configurableRobin Haberkorn1-7/+15
* teco.ini updated as well
2012-11-20cleanup strings[0] before invoking done(): can only be a preliminary solutionRobin Haberkorn1-1/+3
2012-11-20first working draft of syntax highlighting support and related necessary ↵Robin Haberkorn1-24/+39
features
2012-11-18fixed "*" register: instead of trying to update it everywhere the buffer ↵Robin Haberkorn1-17/+40
filename changes, it is implemented as a specialized Q-Register * setting it (^U), is currently ignored * getting it, returns the current file's filename directly * editing it clears its document and resets it with the current file's filename * later dynamic querying of the numeric part of Q-Registers may be implemented as well
2012-11-18avoid using Scintilla's SAVEPOINT mechanism altogether: fixes some ↵Robin Haberkorn1-13/+15
destructive commands * the only thing gained from (partially) using that mechanism is that no explicit calls to set the dirty-status of a buffer are necessary * however it had many disadvantages: * setting the buffer clean had to be done manually anyway (see previous commits) * when changing Q-Registers without affecting the current document, a flag had to be used to prevent setting the current document dirty * last but not least, it introduced a dependency on the order of the destructive operation and its UNDO token. * the UNDO token could trigger a SAVEPOINTLEFT notification resulting in additional rubout tokens to be pushed on the stack which screws the rubout stack. this can be avoided by clever ordering of the operations * using an explicit ring.dirtify() is therefore much better
2012-11-17Q-Register "*" holding the current filenameRobin Haberkorn1-1/+18
2012-11-17use special flag to temporarily disable buffer dirty checks when a ↵Robin Haberkorn1-3/+18
Q-Register is (temporarily) edited without changing the current document
2012-11-17fixed rubout for loading Q-Registers (with files)Robin Haberkorn1-7/+7
this is very similar to setting a string
2012-11-16avoid some unnecessary jumps to buffer startRobin Haberkorn1-1/+0
2012-11-16support different kinds of runtime errors (using C++ exceptions)Robin Haberkorn1-17/+29
* also added some additional range checks (e.g. X command)
2012-11-16support EF and EX arguments. FALSE (>= 0) means to refuse closing/exiting if ↵Robin Haberkorn1-0/+12
the current file / any file is dirty (modified) -EF and -EX may be used to enforce a close/quit without saving
2012-11-16keep a buffer dirty flag and display infos about the current buffer in the ↵Robin Haberkorn1-3/+12
interfaces (including the dirty flag) * was a bit tricky because the Scintilla SAVEPOINTS cannot be (fully) used * when a file is loaded or saved, a Scintilla SAVEPOINT is set * SAVEPOINTLEFT notifications are used to set a buffer dirty * SAVEPOINTREACHED notifications are useless since Scintilla does not consider the saves themselves to be undoable * GTK interface displays infos in window title bar * NCURSES interface has also been updated and cleaned up a bit. Infos are displayed in a new info line. * NCURSES: fixed popup display after terminal resizing
2012-11-15changed save point file pattern to .teco-xxx-dddRobin Haberkorn1-1/+1
2012-11-15added Interface class to ease porting SciTECO to other platforms (toolkits)Robin Haberkorn1-46/+44
* will support Scintilla with Scinterm/NCurses * changes are in such a way that the generated machine code should have almost no overhead compared to the previous implementation (at least when compiled with optimizations)
2012-11-14support rubout for EW command: if in undo mode, a save point is created so ↵Robin Haberkorn1-14/+112
the file can be replaced or removed when rubbing out EW
2012-11-13EF command to close a bufferRobin Haberkorn1-3/+25
can be rubbed out!!! this works because when a buffer is closed, it is not deallocated but transferred to the undo token object which then (if run) reinserts it into the ring list. if the undo token is destroyed before it is run (eg. <ESC><ESC> pressed), the buffer will finally be deallocated.
2012-11-13try to canonicalize paths to non-existent filesRobin Haberkorn1-8/+23
allows you to edit non-existing files with a predefined name. it is completely canonicalized when it is saved
2012-11-13added EW...$ commandRobin Haberkorn1-8/+83
* EW$ saves file with its current filename * EW<filename>$ saves file with under the specified filename (Save As) * files are stored with absolute paths in the ring
2012-11-13fixed undoing of setting Q-Register stringRobin Haberkorn1-5/+18
2012-11-13<x[,y]>S...$ command (only regexp searching at the moment)Robin Haberkorn1-0/+3
2012-11-11<x,y>Xq command, automatic profile munging, explicit munging, commandline ↵Robin Haberkorn1-0/+39
option processing, unhandled commandline options in default buffer
2012-11-11fixed positioning after changing the current bufferRobin Haberkorn1-17/+28
2012-11-11support for Qx, Ux, %x and Mx commandsRobin Haberkorn1-6/+87
* Mx does not yet use local Q-registers
2012-11-11^Ux...$ command: rubout does not yet work properlyRobin Haberkorn1-10/+57
2012-11-11support EQx<filename>$ command: load filename into Q register without ↵Robin Haberkorn1-8/+47
changing the current buffer
2012-11-11Q-Register table and EQx commandRobin Haberkorn1-2/+47
2012-11-10use namespace "States" instead of "states" structureRobin Haberkorn1-2/+6
has several advantages * better to read * namespace can be "extended" from everywhere allowing the declaration of states in the files that implement them * include file mess could be cleaned up a bit
2012-11-10support 0EB...$ commandRobin Haberkorn1-1/+20
* same as EB...$, but displays the buffer ring in the filename popup with the current file highlighted immediately after the EB
2012-11-10filename autocompletion using <CTRL/T> and <TAB>Robin Haberkorn1-9/+0
* <TAB> autocompletion only in specified states * GtkInfoPopup widget to display possible completions, written using Gob2
2012-11-08support globbing in EB...$ to support opening multiple files at onceRobin Haberkorn1-6/+53
2012-11-08added buffer ring and preliminary EB...$ implementationRobin Haberkorn1-0/+144
* undoing supported * does not yet support globbing