summaryrefslogtreecommitdiff
path: root/src/selectors.cc
AgeCommit message (Collapse)Author
2025-03-26Remove unused variableMaxime Coste
2024-07-24De-templatize regex selection codeMaxime Coste
This led to lots of duplicated code gen, longer compile time, and most likely unnoticeable performance difference
2023-05-21Add <c-g> to cancel current operationMaxime Coste
The current implementation only does this during regex operations, but should be extensible to other operations that might take a long time by regularly calling EventManager::handle_urgent_events().
2023-03-09Merge remote-tracking branch 'potatoalienof13/master'Maxime Coste
2023-01-20fix 'split' operation when the pattern occurs at the beginningOlivier Perret
Previously it would result in a stray single-character selection at the beginning of the input text. For example: [abcabc] -> split on 'a' -> [a][bc]a[bc] or [foobarfoobar] -> split on 'foo' -> [f]oo[bar]foo[bar] Note that this behavior was not occuring if the input text was at the beginning of the buffer
2022-12-26Remove a check for inclusivity in select_to_reverse.potatoalienof13
It turns out that neither <a-f> or <a-t> make sense when run at the beginning of the buffer. When I first created the check, I thought that <a-f> made sense if the character under the cursor was the character being searched for. I was wrong, <a-f> should always go at least one character backwards.
2022-12-25<a-t> should not succeed when run on the first character of a file.potatoalienof13
2022-11-20Change BufferIterator comparison to assert same bufferMaxime Coste
Comparing iterators between buffers should never happen, and the only place we did was with default constructed BufferIterator which we replace by casting the iterator to bool. This should improve performance on iterator heavy code.
2022-07-05Distinguish between non-eol max column target and plain max columnMaxime Coste
2022-07-05Make `x` just select the full linesMaxime Coste
`x` is often criticized as hard to predict due to its slightly complex behaviour of selecting next line if the current one is fully selected. Change `x` to use the previous `<a-x>` behaviour, and change `<a-x>` to trim to fully selected lines as `<a-X>` did. Adapt existing indentation script to the new behaviour
2020-09-22Ensure that the capture group actually matched in select_matchesMaxime Coste
We were creating selections from default constructed iterators, which happened to have 0,0 coords and led to out-of-order selection lists. Fixes #3757
2020-08-02Support count argument for [s and ]sJohannes Altmanninger
Part of #795
2020-08-02Support count argument for [p and ]pJohannes Altmanninger
Part of #795
2020-05-17Fix crash when selecting previous paragraph at buffer beginJohannes Altmanninger
Fixes #3489 When there are multiple empty lines between a paragraph and the cursor (C in the example below), <a-[>p skips over one of them. Prevent the check for the extra newline from going out of bounds. ``` a paragraph C after <a-[>p, the first two lines will be selected ```
2020-05-17Refactor: use is_eol() as elsewhere in this functionJohannes Altmanninger
2020-05-10Fix select_sentence going past the end of the bufferMaxime Coste
Fixes #3472
2020-04-21Fix issue with select object and empty matchesMaxime Coste
2019-06-14src: Make sure the iterator is inbound before decrementing itFrank LENORMAND
Fixes #2966
2019-02-04Remove references to SelectionList from selectorsMaxime Coste
2019-02-04Remove target_eol and small code cleanupsMaxime Coste
2019-01-20Split compile time regex flags from runtime onesMaxime Coste
2019-01-20Support re-using the same ThreadedRegexVM for multiple iterationsMaxime Coste
This should reduce the number of allocations as the memory allocated for the thread stack and the saves can be re-used between runs instead of being cleared every time.
2019-01-20Refactor RegexIterator to use a SentinelMaxime Coste
2018-11-27Make '_' the default extra_word_chars, and remove built-in supportMaxime Coste
Fixes #2599
2018-10-27Simplify surround selectionJason Felice
This has the same effect with fewer conditions, and I think it also specifies the intent more closely this way.
2018-09-30src: Implement <a-m> and <a-M>Frank LENORMAND
Closes #2425
2018-09-09Don't skip opening brace twice when finding closingJason Felice
Fixes #2367 Fixes #2129
2018-07-02Mark unused variables with the [[gnu::unused]] attributedahlbaek
2018-05-26Do not expose C++ typeid().name to user facing errors on wrong option typeMaxime Coste
Fixes #2079
2018-05-07Fix wrong behaviour in select surroundingMaxime Coste
Fixes #2030
2018-04-06Make error messages more consistentDelapouite
2018-04-05Fix some trailing spaces and a tab that sneaked into the code baseMaxime Coste
2018-03-25indent selector: When line is empty, find indent from surrounding linesMaxime Coste
Look for the first non empty line preceeding the current line, or if not found, the first non empty line following it. Fixes #1904
2018-03-05Regex: take the full subject range as a parameterMaxime Coste
To allow more general look arounds out of the actual search range, pass a second range (the actual subject). This allows us to remove various flags such as PrevAvailable or NotBeginOfSubject, which are now easy to check from the subject range. Fixes #1902
2018-03-01Change x behaviour to select full line first even if on EOLMaxime Coste
x will always first select current line fully, and only then select next line.
2018-02-24Fix crash in select_sentence when not selection to endMaxime Coste
select_sentence could create a buffer iterator preceeding the buffer begin, leading to a crash trying to read line -1.
2018-01-31Change `m` to search until the end of the buffer instead of end of lineMaxime Coste
Fixes #1774 # Please enter the commit message for your changes. Lines starting
2018-01-18Use the _str and _sv string literals more oftenMaxime Coste
2017-12-29Correctly set the NotBeginOfSubject/NotEndOfSubject flags for regex matchingMaxime Coste
Fixes #1778
2017-12-03Text-Objects: Use regex to select surroundingsMaxime Coste
Fixes #925
2017-12-03Regex: Introduce backward_regex_search helper functionMaxime Coste
2017-11-04Introduce matching_pairs option that controls the pairs used by `m`Maxime Coste
2017-11-01Regex: Fix reverse searching behaviour, againMaxime Coste
2017-11-01Regex: Fix handling of ^ and $ in backward matching modeMaxime Coste
2017-11-01Make use of custom regex backward searching support for reverse searchMaxime Coste
2017-11-01Regex: switch to custom impl, use boost for checkingMaxime Coste
2017-10-28Slight cleanup of select_surrounding implementationMaxime Coste
2017-07-19Cleanup some code with C++14 featuresMaxime Coste
2017-06-26Use the extra_word_chars option in word based normal commandsMaxime Coste
the completion_extra_word_chars is now gone, superseeded by extra_word_chars that gets used both for completion and for normal mode. Fixes #1304
2017-06-26Pass a context instead of just the buffer to selector functionsMaxime Coste