summaryrefslogtreecommitdiff
path: root/vis-motions.c
AgeCommit message (Collapse)Author
2025-01-12array: delete onelinersRandy Palamar
same as buffer commit Array is completely visible
2024-05-21make View unopaqueRandy Palamar
2024-05-21cleanup some single line get/set functionsRandy Palamar
2020-12-28vis: implement multiline to/till motionsMarc André Tanner
These are currently not mapped by default but can be enabled by mappings using their virtual key names.
2020-12-28vis: rename to/till motion internalsMarc André Tanner
This renames the functions and constants implementing the to/till motions. The new names should indicate that matches are only returned within the current line (not globally). Apart from the changed virtual key/command name this contains no functional changes.
2020-01-26vis: don't search off screen when highlighting matchesGeorgi Kirilov
2018-05-17vis: make % motion match quotes and backticks as wellJavier Olaechea
Close #703 Fix #670
2018-05-16vis: remove v and V in operator pending modeMarc André Tanner
2018-04-08Fix "parenthese" in identifiersTwoFinger
2017-12-21vis: improve `cw` behaviorMarc André Tanner
Correctly handle single letter words surrounded by special symbols, e.g. [c]. Fix #643
2017-07-10vis: remove change listMarc André Tanner
This was completely broken since 71eab6d5d72145f17ab3d4c87945ac12176ae8e9 and even before never really worked as one would expect. If anything it should be implemented like the jump list using marks.
2017-07-10vis: implement jump list in terms of marksMarc André Tanner
2017-07-08vis: cleanup marks implementationMarc André Tanner
We now use ' to refer to marks. Mark a is set using 'am and restored using 'aM while this is slightly harder to type than ma and 'a it is consistent with register usage for yank/put and allows a default mark to be used which is handy for quick selection manipulation primitives.
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-05-06vis: add doxygen commentsMarc André Tanner
Rename some structures, add typedefs for function pointers, remove unused arguments from vis_run.
2017-05-03text: remove text_history_get functionMarc André Tanner
As currently implemented this does not properly integrate with multiple cursor support. The functionality should be provided in a layer higher up. The jumplist and changelist need to be redesigned, for now they are broken.
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-04vis: add motions to move by codepointsMarc André Tanner
Some people might prefer this for <Backspace> behavior. Except for that and debugging purposes using `ga` and `g8` it is not yet that useful.
2017-03-31vis: add non-default actions for vi compatible n/N motionsMarc André Tanner
The following key mappings should result in the vi behavior: :map! normal n <vis-motion-search-repeat> :map! normal N <vis-motion-search-repeat-reverse> The default remains unchanged, that is `n` (`N`) always searches towards the end (start) of the file. Fix #470
2017-03-31vis: rename search related constantsMarc André Tanner
2017-03-21vis: make `cw` and `cW` more vim compatibleMarc André Tanner
If the starting position is: * on a space or tab use the `w` motion * on the last letter of a word use `l` or `e` depending on whether a count was given. This also applies for single letter words. * otherwise use the `e` motion As in vim `cw` and `dw` behave differently, whether that is desirable remains to be seen. Might fix #521
2017-02-25vis: mark 0, ^, g_ and $ as idempotentMarc André Tanner
2017-02-22vis: add exact count motion flagMarc André Tanner
Some motions should fail (i.e. keep the initial position) when the specified count can not be satisfied exactly. Examples include t, f, T, and F. Fix #497
2017-02-15vis: remove motion and text objects related to C functionsMarc André Tanner
These do not really belong into the editor core. If desired they could be implemented in Lua instead.
2017-02-15text-motions: remove unused text_line_lastcharMarc André Tanner
2017-01-16vis: cleanup regex header inclusionMarc André Tanner
2016-12-22text: change datatype of Mark to uintptr_tMarc André Tanner
This should avoid undefined pointer comparisons.
2016-12-21vis: implement `gh` and `gl` to move by relative byte offsetsMarc André Tanner
2016-12-21vis: implement `go` to move to absolute byte positionMarc André Tanner
2016-11-19vis: make gg and G move to first non-blank character of lineMarc André Tanner
2016-11-19vis: reformat motion definition block to avoid overly long linesMarc André Tanner
No functional changes.
2016-09-29vis: fix % for angle bracketsMarc André Tanner
2016-08-24vis: improve dot (repeat) command implmentationMarc André Tanner
Do not override implicit operator macro in command mode. Fix #334
2016-05-04vis: make j and k a linewise inclusive motionMarc André Tanner
They behave like an inclusive motion, but only if they are also linewise (which they are by default). This should make `yjp` and `ykp` yank both the current and the next/previous line when the cursor is at the start of a line. See also 532f52e9e52b98dc5749396f7353295418e0227a and #237
2016-04-12Add "[(" and "])" motions for jumping to a parenthese pair's start/endRob Pilling
2016-04-12Add "[{" and "]}" motions to jump to a block's start/endRob Pilling
2016-04-09vis: make j an inclusive motionMarc André Tanner
Given the following text with no trailing new line at the end of line2, where # denotes the cursor position: #ine1 of text line2 of text the command yjp should produce line1 of text #ine1 of text line2 of text line2 of text where previously it would wrongly result in line1 of text #ine1 of text line2 of text
2016-04-06text-motion: restore old text_{line_,}find_prev behaviorMarc André Tanner
This partially reversts the "Fix to/till movements" commit 0d4093c3371079c5f75055338f0341f684542465 The pos += len hunk was interfering with other code which does not want this behavior. The original issue should be fixed directly within the to/till movements.
2016-03-30array: allow arbitrarily sized array elementsMarc André Tanner
There exist two typical ways to use an array: 1) to hold pointers to externally allocated memory regions Use array_init(...) for initialization, an element has the size of a pointer. Use the functions suffixed with `_ptr' to manage your pointers. The cleanup function array_release_full must only be used with this type of array. 2) to hold arbitrary sized objects Use array_init_sized(...) to specify the size of a single element. Use the regular (i.e. without the `_ptr' suffix) functions to manage your objects. array_get will return a pointer to the object stored within the array.
2016-03-12vis: overhaul search related code, support "/ registerMarc André Tanner
2016-03-10vis: let /^pattern match at the start of the lineMarc André Tanner
2016-02-18Add infrastructure to add custom motion functionsMarc André Tanner
A motion function can be registered with vis_motion_register(...) the returned id (if non negative) can then be used as an argument to vis_motion(...)
2016-02-12Mark some tables as constMarc André Tanner
This allows them to be placed into the read only ELF section.
2016-02-11vis: try to make * and # motions work on more systemsMarc André Tanner
The used regular expression \<%s\> where %s refers to the search term/word under cursor is not POSIX compliant but happens to work on both musl and glibc. First try the alternate syntax [[:<:]]%s[[:>:]] which works on Mac OS X. The reason it is done in this order is that musl/glibc will reject it as invalid pattern when compiling while the Mac OS X libc will accept \<%s\> but not match anything. Based on a patch by Erlend Fagerheim.
2016-01-28vis: implement nn%Marc André Tanner
Moves to the given percentage of the file in bytes (not lines). This is useful when dealing with huge files because it is a constant time operation. Performance could still be improved by adapting the display code not to rely on line numbers at all.
2016-01-28vis: clean up count handlingMarc André Tanner
There are cases where zero can also be a legitimate count.
2016-01-27text-motion: change text_bracket_match APIMarc André Tanner
2016-01-27vis: let % move to next special char if not already thereMarc André Tanner
2016-01-20Fix to/till movementsMarkus Teich
Some corner cases allowed to move between lines with the to/till movements. The change in find_prev serves two purposes. When searching for a string which the cursor is already above the match, this match is returned (pos += len). Secondly there was a failure when searching for strings with len == 1 which lead to `matched == 0` which was always true, even if the string was not found, therefore leading to a wrong return value.
2016-01-19vis: fix # and * motions to only match wordsMarc André Tanner
Word matching is currently implemented by using the \< and \> anchors of the regex(3) library part of libc. Another option would have been to use the text_object_word_find_{next,prev} functions from text-objects.c. The used search term is currently not added to the search history. Based on a patch by Markus Teich.