summaryrefslogtreecommitdiff
path: root/sam.c
AgeCommit message (Collapse)Author
2016-09-19vis: add rudimentary builtin help for :-commandsMarc André Tanner
2016-09-19vis: do not invoke file save event for internal filesMarc André Tanner
2016-08-07sam: do not change cursor position after :! commandMarc André Tanner
Fixes #364
2016-08-07sam: improve quoted argument parsingMarc André Tanner
Handling of unbalanced quotes could probably still be improved. Closes #344
2016-05-29sam: use more suitable error message if no command is givenMarc André Tanner
2016-05-26vis: use normalized absolute file names as internal representationMarc André Tanner
Try to display a shorthand version in the status bar, this currently only works for files below the current working directory of the editor process.
2016-05-18vis: add an interactive mode to vis_pipe{,_collect}(...)Marc André Tanner
Previously the interactive mode was implicitly enabled by passing an invalid range. However for some use cases (e.g. completion) we need to be able to pipe a given text range to an external process without also redirecting stderr (which is used to draw the slmenu interface on top of vis).
2016-05-14vis: allow :commands with a hyphen in the nameMarc André Tanner
This fixes the argument parsing for the :{un,}map-window commands.
2016-05-05sam: avoid taking snapshots within the filter command implementationMarc André Tanner
This has the effect that multiple filter commands can be undone together.
2016-04-29vis: do not crash when processing :-commands and no window is activeMarc André Tanner
This is needed to make the vis.event.start Lua callback useful, setting global options should be possible even if no windows exist yet. The :set command options should probably be cleaned up further, some of them apply only to the currently active window while others have a global effect.
2016-04-21vis: add infrastructure to register custom :-commandsMarc André Tanner
2016-04-21vis: do not lazy allocate :-commandsMarc André Tanner
The built in commands should always be available.
2016-04-20vis: handle termination from within win_open event gracefullyMarc André Tanner
2016-04-17sam: except for visual mode, apply :w to whole fileMarc André Tanner
Also in visual mode, warn if :w is not forced by ! because the file will be reduced to the active selection.
2016-04-13sam: improve ^ matching start of lineMarc André Tanner
There are some nasty differences between the meaning of ^ in Plan 9's regexp library and POSIX when using REG_NEWLINE. The former only matches at the beginning of a line wheras the latter matches the zero-length string immediately after a newline character \n. As a result this also matches after the very last newline at the end of the file. This is undesired behavior for a command like :x/^/c/#/ Hence we try to filter out this last match. Close #264
2016-04-13Use view_cursors_new_force where appropriateMarc André Tanner
Close #263
2016-04-11sam.c: fix some typos in commentSteven Noonan
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2016-04-08sam: change default address of < and | commandsMarc André Tanner
If no address is provided these commands no longer apply to the whole line, but instead will insert the output of the external program at the current cursor location.
2016-04-06sam: include limits.h for PATH_MAXMarc André Tanner
Close #220
2016-04-05vis: remove left over from :sam commandMarc André Tanner
2016-04-05vis: fix coverity scan warningsMarc André Tanner
2016-04-05sam: cosmetic changesMarc André Tanner
2016-04-05sam: improve group handling, do not loop infinitelyMarc André Tanner
2016-04-05sam: stop executing once a command failsMarc André Tanner
2016-04-05sam: some commands should only be executed once not for every selectionMarc André Tanner
This should fix a segfault when using :q while multiple selections are active.
2016-04-04sam: fix x command with default patternMarc André Tanner
The end range should still be respected, previously it would continue looping for all lines until the end of file.
2016-04-04sam: y and Y commands require a regexp patternMarc André Tanner
2016-04-04sam: use better default addresses for <, >, | and r commandsMarc André Tanner
2016-04-04sam: fix special handling of single line numbersMarc André Tanner
If only line numbers are given (either in absolute or relative form) we treat it as motion instead of a range specifier. That is :nn moves to line nn, but does not select it. This should however not affect other range specifiers such as :n,m
2016-04-04sam: fixup bf52c0cb95b76b4ae17f138c9d98552c38185f46Marc André Tanner
For commands like :q the view might already have been freed
2016-04-04sam: add missing include for strncasecmp(3)David B. Lamkins
2016-04-03sam: focus first cursor after a x, y, g, v commandMarc André Tanner
2016-04-03sam: implement cd (change directory) commandMarc André Tanner
2016-04-03sam: support % as address denoting the whole fileMarc André Tanner
2016-04-03sam: implement ! commandMarc André Tanner
2016-04-03vis: change vis_pipe API and cleanup related codeMarc André Tanner
2016-04-03sam: unify vi(m) and sam command lineMarc André Tanner
The following vi commands have been dropped: - saveas - xit - ! The following commands are only recognized in their short form: - e (edit) - q (quit) - s (substitute) - w (write) - r (read)
2016-04-03sam: restructure code to avoid useless gotoMarc André Tanner
2016-04-03sam: implement s (subtitute) command in terms of sed(1)Marc André Tanner
Eventually this should be rewritten as an internal command.
2016-04-03sam: cleanup command argv passing/handlingMarc André Tanner
2016-04-03sam: simplify and fix groupingMarc André Tanner
The following should now work: :sam x/^static/ .,+/^\}/ { i/<</ a/>>/ }
2016-04-03sam: attempt to make x/y commands more robustMarc André Tanner
These commands can be followed by an address which changes the range to which the sub command applies. The looping construct should then continue at the position of the last change within the original range. A previously problemeatic example: :sam x/^static/ .,+/^\}/ c/replaced
2016-04-03sam: implement > commandMarc André Tanner
2016-04-03sam: implement r (read) command in terms of < catMarc André Tanner
It replaces current range with the file content. However in the common case the range is actually defaults to the whole file which is probably not what is expected.
2016-04-03sam: implement < command in terms of | with an empty rangeMarc André Tanner
2016-04-03sam: implement | (filter) commandMarc André Tanner
2016-04-03sam: implement w (write) commandMarc André Tanner
2016-04-03sam: add infrastructure to support multi letter commandsMarc André Tanner
2016-04-03sam: fix escape handling in regex parsingMarc André Tanner
2016-04-03sam: more flexible parsingMarc André Tanner
Add infrastructure to handle commands which take file names, shell commands or general white space delimited parameters as arguments.