summaryrefslogtreecommitdiff
path: root/sam.c
AgeCommit message (Collapse)Author
2020-04-27Avoid use of VLAsMichael Forney
2020-03-15sam: fix X and Y commands which were interchangedMarc André Tanner
Fix #820
2020-02-29sam: fix spurious "file exists" warningsMarc André Tanner
When initially opened with a non-existing file we would not correctly track the file's meta data resulting in spurious warnings upon subsequent writes. It is fixed by also saving the meta data for previously non-existing files with matching paths.
2020-02-23sam: warn when attempting to write to an existing fileMarc André Tanner
Add ! to override.
2020-02-23sam: fix modification time comparision when writing fileMarc André Tanner
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 runalex
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é Tanner
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é Tanner
2020-01-28vis: support an optional exit status in :q and :qall commandsMarc André Tanner
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é Tanner
2020-01-24sam: fix ^ anchor behavior in looping commandsMarc André Tanner
Previsouly a command like: x/^.*\n/ would only select every second line. Fixes #774
2020-01-23remove redundant layout option abbreviationKarl Schultheisz
No need to explicitly specify "lay" as an abbreviation, since "layout" already makes it available via prefix logic.
2019-05-23Add layout optionKarl Schultheisz
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é Tanner
Valid values are `read`, `mmap` or `auto`.
2018-05-30sam: always apply | command to existing selectionsMarc André Tanner
2018-05-30sam: normalize selections after command executionMarc André Tanner
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é Tanner
2018-05-16sam: keep selections after :> commandMarc André Tanner
Fix #700
2018-04-15Update year numbers in copyright informationMarc André Tanner
2018-02-19sam: fix g/^$/Marc André Tanner
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é Tanner
2017-07-10vis: implement jump list in terms of marksMarc André Tanner
2017-07-07vis: use marks instead of registers to store selectionsMarc André Tanner
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é Tanner
Conflicts: view.c view.h
2017-06-15sam: simplify print command implementationMarc André Tanner
2017-06-15vis: rename uses of Cursor to SelectionMarc André Tanner
2017-06-15view: rename view_cursorsMarc André Tanner
2017-06-15view: rename view_selection_anchoredMarc André Tanner
2017-06-15view: rename view_cursors_countMarc André Tanner
2017-06-15view: rename view_cursors_nextMarc André Tanner
2017-06-15view: rename view_cursors_selection_startMarc André Tanner
2017-06-15view: rename view_cursors_selection_clearMarc André Tanner
2017-06-15view: rename view_cursors_selection_getMarc André Tanner
2017-06-15view: rename view_cursors_primary_{get,set}Marc André Tanner
2017-06-15view: rename view_cursor_disposedMarc André Tanner
2017-06-15view: rename view_cursors_disposeMarc André Tanner
2017-06-15view: rename view_cursors_newMarc André Tanner
2017-06-15view: remove view_cursors_multipleMarc André Tanner
2017-06-15vis: promote selections to first class primitivesMarc André Tanner
This unifies cursors and selections. The cursor are now represendted as singleton selections.
2017-06-05sam: fix + addressMarc André Tanner
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 Weidmann
2017-05-15sam: use default address for file looping commandsMarc André Tanner
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é Tanner
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é Tanner
2017-04-12sam: support %n count specifier matching every n-th selectionMarc André Tanner
2017-04-12sam: add support for negative count specifierMarc André Tanner
2017-04-12sam: add support for count specifier to `g` and `y` commandsMarc André Tanner
2017-04-12sam: distinguish between empty // and no regexMarc André Tanner
2017-04-12sam: reject command names containing digits or ending with a hyphenMarc André Tanner
The current implementation will also reject consecutive hyphens.
2017-04-06sam: properly free transcript in error caseMarc André Tanner