aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-01-13sam: remove s (substitute) command use x (extract) and c (change) insteadMarc André Tanner2-14/+3
They are roughly equivalent, instead of s/pattern/replacement/ to replace the first occurrence of pattern you can specify an address to the change command: /pattern/ c/replacement/ the only difference being that the first command is restricted to the current line. -+x/pattern/ c/replacement/ also restrictes matches to the current line, but performs the substitution on the whole line not only the first match. Currently it is not possible to only replace the n-th match as `s2/pattern/replacement/` would do in sam(1). A possible alternative syntax generalizing this concepts and applying it to the `x` and `g` commands will be investigated in the future. Global substitution as in %s/pattern/replacement/g can be performed using x/pattern/ c/replacement/
2017-01-13sam: allow empty text specifiersMarc André Tanner1-2/+5
Before the i, a, c commands would fail when given an empty text //.
2017-01-13sam: allow input text to refer to search registersMarc André Tanner2-6/+65
& refers to the most recent complete match and \1 - \9 refer to the last sub-expression matches.
2017-01-13vis: introduce registers 0-9 and & to capture search matchesMarc André Tanner4-2/+44
These are currently only updated for `x` and `y` sam commands, whether they should be updated for other search related activities (`/`, `?`, `n`, `N`, `*`, `#` etc.) needs to be investigated.
2017-01-13text-regex: add text_regex_nsub to get number of sub expressionsMarc André Tanner2-0/+7
2017-01-13text-regex: slightly clean up headerMarc André Tanner1-2/+2
We generally omit parameter names in function prototypes when their meaning is clear.
2017-01-13sam: create new selections for changed rangesMarc André Tanner2-44/+71
This is akin to sam where dot is set to the result of a command.
2017-01-13view: add infrastructure for delayed cursor destructionMarc André Tanner2-2/+30
At least one cursor (referred to as primary or main cursor) has always to exist. In the sam command language implementation we might want to dispose a cursor even if it is the primary one before later commands will create different ones (e.g. `:x/pattern/ { i/>>>/ a/<<</ }`). This commit introduces view_cursors_dispose_force. If called on the last remaining cursor, its selection is cleared and it is marked for destruction as soon as a new cursor is created. view_cursor_disposed returns the cursor marked for deletion (if any) and clears the descruction flag.
2017-01-12sam: implement parallel grouping behaviorMarc André Tanner4-132/+162
2017-01-11ui: improve editor suspensionMarc André Tanner1-1/+1
Send SIGSTOP to process group. This should fix job control when launched from a script.
2017-01-11single: allow to build self-extracting executableChristian Hesse3-0/+20
This allows to create a self extracting executable. The standalone binary and lua files are extracted to /tmp/.vis-XXXXXX, vis is started with the given command line arguments, finally temporary files are removed. Signed-off-by: Christian Hesse <mail@eworm.de>
2017-01-10vis-lua: expose register names as vis:register_names()Marc André Tanner1-1/+38
2017-01-10vis: add register description to :help outputMarc André Tanner4-25/+43
2017-01-10vis-lua: expose valid marks as vis:mark_names()Marc André Tanner1-0/+38
2017-01-10vis: add valid marks to :help outputMarc André Tanner4-6/+22
2017-01-10vis: add process id to :help outputMarc André Tanner1-1/+1
2017-01-07test: updateMarc André Tanner1-8/+5
2017-01-07buffer: make sure mem{cpy,move} are called with valid argumentsMarc André Tanner1-1/+5
2017-01-07buffer: fix buffer_move bugMarc André Tanner1-2/+1
Capacity also needs to be reset.
2017-01-07buffer: remove redundant functionMarc André Tanner3-7/+1
For some reason we ended up with two identical functions: buffer_{clear,terminate}.
2017-01-07ui: improve color palette resetMarc André Tanner1-46/+9
Do not restore color palette for :! commands (i.e. in ui_terminal_save). By far the most common use of this is to invoke vis-menu(1) (e.g. indirectly through `:open .` or for word completion). Restoring the palette in this case also affects the file content still being visible above the menu thus causing weird display artifacts. Use the OSC 104 escape sequence to reset color palette. This should respect custom color profiles.
2017-01-06vis: simplify mode lookup for :map and :unmapMarc André Tanner3-20/+14
2017-01-05test: updateMarc André Tanner1-5/+8
2017-01-05Merge branch 'musl' of https://github.com/eworm-de/visMarc André Tanner1-2/+2
2017-01-05lua: adjust C lexer to recognize POSIX typesS. Gilles1-3/+6
2017-01-05ui: remove now unused codeMarc André Tanner1-37/+4
2017-01-05theme: pretend that specifying color numbers doesn't workS. Gilles1-16/+16
2017-01-05ui: replace lookup tables with algorithmS. Gilles1-269/+44
The algorithm for computing the [16,256) range of the `standard' 256 colors comes from 256colors.pl from XFree86's xterm tree, which appears to have given rise to the standard colors.
2017-01-05ui: Turn palette on/off when saving/restoring terminalS. Gilles1-12/+46
2017-01-04standalone: update to musl version 1.1.16Christian Hesse1-2/+2
This release fixes a serious under-allocation bug in regexec due to integer overflow (CVE-2016-8859) and related issues. http://www.openwall.com/lists/musl/2017/01/03/1
2017-01-01ui: use accurate colors when availableS. Gilles1-1/+44
When ncurses reports can_change_color(), have color_find_rgb() define use the exact color requested by modifying ncurses' current palette. Make an honest effort at restoring this palette on shutdown, though we can't be positive it's correct.
2017-01-01ui: move color_from_256 to file scopeS. Gilles1-122/+123
2016-12-31vis: allow user registered :-commands to specify a help textMarc André Tanner5-10/+26
2016-12-31vis: typedef function type not pointer to functionMarc André Tanner2-4/+4
2016-12-31sam: use buffer_move where appropriateMarc André Tanner1-4/+4
2016-12-31buffer: implement buffer_moveMarc André Tanner2-0/+10
2016-12-30test: updateMarc André Tanner1-5/+5
2016-12-30sam: execute X and Y commands only once not for every selectionMarc André Tanner1-2/+2
2016-12-30sam: change write command implementation to not change argv[]Marc André Tanner1-6/+6
The same Command struct might be used for multiple command executions. An example is `:X wq` which is roughly equivalent to `:wqa` in vim.
2016-12-30sam: explicitly pass invalid range for X and Y commandsMarc André Tanner1-1/+1
These are never used because there is always an implicit select command prepended.
2016-12-30sam: use more expressive name for select commandMarc André Tanner1-2/+2
This is not really used, but commands can expect to have argv[0] set to something. Also "s" is ambigious with the substitute command.
2016-12-29Add rc lexerMichael Forney1-0/+65
2016-12-29vis-lua: allow vis:map to set up key aliases and actionsMarc André Tanner1-15/+51
2016-12-29vis-lua: introduce vis:action_registerMarc André Tanner1-0/+32
2016-12-29vis: cleanup key action lifetime managementMarc André Tanner5-26/+59
2016-12-29vis-lua: simplify lua function reference handlingMarc André Tanner1-31/+17
2016-12-29vis-lua: luaL_checkstring already checks for NULL return valueMarc André Tanner1-7/+6
2016-12-29test: updateMarc André Tanner1-8/+5
2016-12-29vis: unmap all conflicting bindings of a forced map commandMarc André Tanner1-17/+2
2016-12-29map: implement map_prefix_deleteMarc André Tanner2-0/+15