summaryrefslogtreecommitdiff
path: root/src/ranges.hh
AgeCommit message (Collapse)Author
2025-06-30Remove unused capture modeMaxime Coste
2025-06-27Move helper logic inside static_gatherMaxime Coste
2025-06-27Small code style tweak in ranges utilitiesMaxime Coste
2024-08-15Remove unused ConstexprVector and rename constexpr_utils.hh to array.hhMaxime Coste
2024-08-14Remove tuple use from ranges.hhMaxime Coste
2023-10-25Default comparison operators that can beMaxime Coste
2023-10-25Remove redundant comparison operatorsMaxime Coste
Since C++20 (a != b) get automatically rewritten as !(a == b) if the != operator does not exist.
2022-10-02Fix compilation failure with clang 12 and debug=yesHampus Fröjdholm
The pointer type alias was missing from FlattenedView::Iterator causing std::iterator_traits to be an empty class.
2022-05-21Stop using deprecated std::iteratorJohannes Altmanninger
As reported in #4615 and others, GCC 12.1 emits deprecation warnings because we use std::iterator. Replace it with the modern equivalent. Closes #4615
2022-04-25Introduce a flatten range adapter and use it in execute_keys_cmdMaxime Coste
This avoids allocating a KeyList vector in which to flatten all the different arguments and simplifies the client logic.
2021-11-21More C++20 refactoringsMaxime Coste
Use CTAD instead of make functions, requires instead of enable_if
2021-11-21Use std::remove_cvref instead of std::decayMaxime Coste
2021-10-24src: Make `gf` open all selected pathsFrank LENORMAND
The buffer whose path is under the main selection will be focused after all others have been opened. Closes #2164
2021-10-21src: Implement the `enumerate()` range filterFrank LENORMAND
2020-05-29Add a range based remove_if overloadMaxime Coste
2020-02-18Small code style tweak in ranges.hhMaxime Coste
2020-02-02Use ReverseView to perform fewer allocationsgeppettodivacin
The first attempt at a bug fix for @ symbols in selection buffer names worked, but it was very inefficient. In particular, it allocated three different vectors, and we really only needed the correct elements. Manipulating iterators to give us the right slices of the existing vector is far more efficient. By reversing the original content and taking the last two, we're able to get the number of selections and main selection without too much hassle. The buffer name is everything from the start of the content to the selection count. This gets us through with only one vector allocation. Credit to @mawww for the optimization idea and for fixing my types.
2020-01-26Add support for `@` symbols in selection buffergeppettodivacin
The selection descriptions use the format `<buffer>@<timestamp>@<main_index>`. This fails when file paths have `@` symbols in them: the parser splits on `@` symbols and finds more values than it expects. We here modify the behavior to require *at least* two @ symbols, using the last two for `<timestamp>` and `<main_index>` and leaving the remaining text for the <buffer>. This should work for any number of `@` symbols, since `<timestamp>` and `<main_index>` are numbers and should never contain `@` symbols.
2019-11-10Aggregatify ConcatViewMaxime Coste
2019-11-09Add static or const where usefulJason Felice
2019-06-10Add a gather overload that infer element typeMaxime Coste
2019-01-24Replace std::mem_fn with custom lambda in rangesMaxime Coste
2019-01-23Change pipe diffing to work linewiseMaxime Coste
This should greatly improve performances as we only need to diff lines instead of individual characters. Closes #2678 Fixes #2037
2018-07-26Make TransformView iterator's category match its underlying'sMaxime Coste
In particular, this make gathering a transformed range to a vector faster because we can use the random access nature of underlying iterator to get the size to allocate in the vector upfront.
2018-07-05Add 'skip(size_t)' range utility to skip a number of elementsMaxime Coste
2018-04-19Extract a for_n_best algorithm from completion functionMaxime Coste
Provide the heap based n-best algorithm through a nice interface.
2018-03-25Remove contains_that and use any_of to be closer to the c++ stdlibMaxime Coste
2018-03-25Unify code that validates identifiers in KakouneMaxime Coste
Session/Client/User modes names are now requiered to be "identifiers" they must be in [a-zA-Z0-9_-]. Option names are the same except they do not allow '-' as they need to be made available through the env vars and '-' is not supported there. Fixes #1946
2018-03-13ranges: Add transform overload taking directly a pointer to memberMaxime Coste
This overload will forward to the general transform implementation using std::mem_fn to generate a callable.
2018-02-28Ranges: Fix copiability of some range view iteratorsMaxime Coste
Some iterators were refering to to their view with a const ref, this was making them non-copiable. Change those const ref into const pointers in order to fix that.
2018-02-20ranges: Support temporary parameters passed to concatenatedMaxime Coste
2018-01-12Save/restore main selection from/to stringsMaxime Coste
Always consider that the first selection in the list is the main one, save selections that way. This approach was suggested by PR #1786 but the implementation here is different, and is used more generally whenever we save selections to strings. This is also the prefered way to work only on the main selection: save selections with Z, reduce to main with <space>, restore with z. Closes #1786 Fixes #1750
2017-12-07Ranges: add unit test and fix corner case in split viewMaxime Coste
2017-12-06Remove Vector returning split functions, use range adaptorMaxime Coste
Do not allocate temporary vectors to store splitted data, use the 'split' range adaptor along with transform(unescape) to provide the same feature with less allocations.
2017-12-04Replace uses of getpwuid which is incompatible with static linkingMaxime Coste
Introduce a get_user_name function which parses '/etc/passwd' to find the username associated with a user id.
2017-11-02Append '/' to highlighter group completion candidatesMaxime Coste
2017-08-29Rename containers.hh to ranges.hh (and Container to Range)Maxime Coste