aboutsummaryrefslogtreecommitdiff
path: root/sam.c
AgeCommit message (Collapse)AuthorFilesLines
2020-02-23sam: warn when attempting to write to an existing fileMarc André Tanner1-0/+4
Add ! to override.
2020-02-23sam: fix modification time comparision when writing fileMarc André Tanner1-6/+13
The modification time should only be compared when dealing with the same file i.e. the following should work without a warning: $ touch foo; sleep 1; touch bar $ vis foo :w bar Also switch from path to inode based file equality testing.
2020-02-22sam: re-take range after pre-save hooks are runalex1-2/+14
A vis.events.FILE_SAVE_PRE callback may mutate the file text, making the original range passed to cmd_write incorrect. It is unclear how to realign the range after the callback is done for the cases where an active selection in visual mode is present or an explicit range like :1,2w! was specified. However, this commit resolves the issue for the case where the whole file is expected to be written.
2020-02-12sam: support optional count for text commandsMarc André Tanner1-12/+21
The text given for the a, i and c commands can be prefixed with an optional count indicating how often the text should be inserted, defaults to 1.
2020-02-12sam: move parse_number code, no functional changeMarc André Tanner1-9/+9
2020-01-28vis: support an optional exit status in :q and :qall commandsMarc André Tanner1-2/+2
This can for example be used to abort git commit messages with :q! 1.
2020-01-27vis: pass absolute path to pre/post save eventsMarc André Tanner1-13/+24
2020-01-24sam: fix ^ anchor behavior in looping commandsMarc André Tanner1-3/+7
Previsouly a command like: x/^.*\n/ would only select every second line. Fixes #774
2020-01-23remove redundant layout option abbreviationKarl Schultheisz1-1/+1
No need to explicitly specify "lay" as an abbreviation, since "layout" already makes it available via prefix logic.
2019-05-23Add layout optionKarl Schultheisz1-0/+6
This introduces a new `set` option for setting the layout to vertical or horizontal, which previously could not be done without creating a new window (via `split` or `vsplit`). Now, `set layout|lay h|v` will control this without creating a new window.
2018-05-30vis: add loadmethod optionMarc André Tanner1-0/+6
Valid values are `read`, `mmap` or `auto`.
2018-05-30sam: always apply | command to existing selectionsMarc André Tanner1-1/+1
2018-05-30sam: normalize selections after command executionMarc André Tanner1-0/+3
As a trivial example if multiple selections exist running a command like :, should merge them.
2018-05-30sam: change nomencalture, use selection where appropriateMarc André Tanner1-16/+16
2018-05-16sam: keep selections after :> commandMarc André Tanner1-3/+0
Fix #700
2018-04-15Update year numbers in copyright informationMarc André Tanner1-1/+1
2018-02-19sam: fix g/^$/Marc André Tanner1-2/+7
With POSIX ERE the pattern ^$ matches strings ending with a new line because an empty match is reported after the trailing newline at the very end of the input. This is undesirable for use cases like x g/^$/ d which is supposed to delete all empty lines of a file. As a fix we disregard empty matches at the end of the given range.
2017-07-14vis-lua: make selection first class primitives in Lua APIMarc André Tanner1-3/+3
2017-07-10vis: implement jump list in terms of marksMarc André Tanner1-0/+1
2017-07-07vis: use marks instead of registers to store selectionsMarc André Tanner1-5/+10
The key binding remain the same, but the selections are now stored on a per-buffer basis.
2017-06-27Merge branch 'show-eof' of https://github.com/p-e-w/visMarc André Tanner1-0/+6
Conflicts: view.c view.h
2017-06-15sam: simplify print command implementationMarc André Tanner1-16/+11
2017-06-15vis: rename uses of Cursor to SelectionMarc André Tanner1-110/+110
2017-06-15view: rename view_cursorsMarc André Tanner1-6/+6
2017-06-15view: rename view_selection_anchoredMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_countMarc André Tanner1-2/+2
2017-06-15view: rename view_cursors_nextMarc André Tanner1-4/+4
2017-06-15view: rename view_cursors_selection_startMarc André Tanner1-3/+3
2017-06-15view: rename view_cursors_selection_clearMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_selection_getMarc André Tanner1-6/+6
2017-06-15view: rename view_cursors_primary_{get,set}Marc André Tanner1-4/+4
2017-06-15view: rename view_cursor_disposedMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_disposeMarc André Tanner1-4/+4
2017-06-15view: rename view_cursors_newMarc André Tanner1-2/+2
2017-06-15view: remove view_cursors_multipleMarc André Tanner1-1/+1
2017-06-15vis: promote selections to first class primitivesMarc André Tanner1-17/+14
This unifies cursors and selections. The cursor are now represendted as singleton selections.
2017-06-05sam: fix + addressMarc André Tanner1-1/+1
Previoulsy + would not advance to the next line when the cursor was on the first character of a line. This should fix the +- idiom, i.e. :+-x/foo/c/bar/ performs a substitution on the current line.
2017-06-04Add option to hide EOF markerPhilipp Emanuel Weidmann1-0/+6
2017-05-15sam: use default address for file looping commandsMarc André Tanner1-2/+4
This sould fix a clang analyzer warning and make the code more robust. The problem could actually not occur in practice because the X and Y commands always have the internal cmd_select as intermediate node in the execution tree. In general the multiple file support will need more design work. Fix #551
2017-04-14vis: make certain operations interruptible with <C-c>Marc André Tanner1-4/+4
As currently implemented this will only work for operations which are individually fast, but repeated many times (e.g. `1000000itext<Escape>`).
2017-04-12sam: fix negative count specifiers from visual modeMarc André Tanner1-2/+5
2017-04-12sam: support %n count specifier matching every n-th selectionMarc André Tanner1-0/+15
2017-04-12sam: add support for negative count specifierMarc André Tanner1-10/+42
2017-04-12sam: add support for count specifier to `g` and `y` commandsMarc André Tanner1-12/+55
2017-04-12sam: distinguish between empty // and no regexMarc André Tanner1-1/+4
2017-04-12sam: reject command names containing digits or ending with a hyphenMarc André Tanner1-1/+6
The current implementation will also reject consecutive hyphens.
2017-04-06sam: properly free transcript in error caseMarc André Tanner1-4/+19
2017-04-02Fix Debian package lintian warningsMarc André Tanner1-1/+1
https://mentors.debian.net/package/vis
2017-03-19Move :set horizon option implementaiton to luaMarc André Tanner1-6/+0
2017-03-19Move :set theme option implementation to luaMarc André Tanner1-6/+0