summaryrefslogtreecommitdiff
path: root/src/buffer_utils.hh
AgeCommit message (Collapse)Author
2025-07-05Introduce `history_since_<id>` value expansionPhilipp Jungkamp
The `history_since_<id>` value expansion allows incremental parsing of a buffer's history. declare-option int my_last_history_id define-command my-process-history ... # process the initial buffer history my-process-history %val{bufname} 0 %val{history} set-option buffer my_last_history_id 0 # only process new history changes on idle hook buffer NormalIdle %{ evaluate-commands %exp{ my-process-history \ %%val{bufname} \ %%opt{my_last_history_id} \ %%val{history_since_%opt{my_last_history_id}} } set-option buffer my_last_history_id %val{history_id} }
2025-02-19Cleanup file.cc/hh dependenciesMaxime Coste
file.cc/hh should not know about Context, Buffer, etc... It should be a pretty low level set of helper functions. Move buffer related functions to buffer_utils and extract busy indicators to callers.
2024-11-28Add back option to scroll in stdin buffersJohannes Altmanninger
Commit 582c3c56b (Do not add trailing newline to non-scrolling fifo buffers, 2024-01-28) completely forgot about stdin buffers, breaking the ability to make them scrolling via "ge". For example while sleep 1; do seq $LINES date done | kak Let's fix that by adding the trailing newline back for stdin buffers. Unlike "edit -scroll", don't scroll until the user explicitly moves the cursor.
2021-09-30rework selection insert/replace using a for_each methodMaxime Coste
expose that method so that various commands can take advantage of it for performance or simplicity purposes.
2021-05-28Support opening files bigger than 2 GiBMaxime Coste
The real technical limit is with lines bigger than 2 GiB and buffers with more than 2 Gi lines, refactor buffer loading to make it possible to load those files. Fix an overflow with the hash_data function at the same time
2020-06-27Refactor how InsetCompletionHide hook parameter is computedMaxime Coste
Keep track of inserted ranges instead of trying to re-derive them. Fixes #3556
2020-05-10Support piping data to client stdinMaxime Coste
Pass the client stdin fd to the server and open a fifo buffer from it. Fixes #3394
2020-03-02Expand env vars as list of stringsMaxime Coste
This makes it possible to do :select `%val{selections_decs}` and to correctly combine $kak_quoted with those.
2020-01-09Fix compilation on 32bit platformsMaxime Coste
Fixes #3284
2020-01-02Few style changes on history exposition codeMaxime Coste
2020-01-01Add 'history' and 'uncommitted_modifications' expansionsJason Felice
2019-12-18Cleanup replaced range selection logicMaxime Coste
Do not access Buffer::m_changes to find the inserted range, return it directly from Buffer::insert and Buffer::replace. This fixes a wrong behaviour where replacing at eof would lose the selected end of line (as the implementation does not actually replace that end of line)
2019-11-12Fix display column computationsJason Felice
Closes #3201
2018-10-08Buffer begin and end are not end-of-wordsMaxime Coste
Buffer begin never has a word character before, and end is always preceeded by an end-of-line. Fixes #2420
2017-03-08Add a -debug flag to :edit to set the buffer as debug dataMaxime Coste
As for the *debug* buffer, buffers with the debug flag wont get used for cycling through buffer, or word completion.
2016-11-14Propagate the hooks disabled state through prompt, menu, and command executionMaxime Coste
Maintain it as well during buffer creation even if the hooks are not executed in client context. Fixes #818
2016-10-01Support codepoints of variable widthMaxime Coste
Add a ColumnCount type and use it in place of CharCount whenever more appropriate, take column size of codepoints into account for vertical movements and docstring wrapping. Fixes #811
2016-07-28Add a char_length(Buffer&, const ByteCoord&, const ByteCoord&) utilMaxime Coste
2016-03-16Use ByteCoords directly for buffer insert/erase/replaceMaxime Coste
2016-03-16Avoid the spurious newline insertion when replacing at end of bufferMaxime Coste
Add a Buffer::replace method to handle the replacements properly Fixes #633
2016-02-17Refactor use selection as search pattern implementationMaxime Coste
2015-12-23Pass flags to the regex engine to correct anchorsMaxime Coste
Current behaviour was matching ^ $ for the current search start/end (and \b was always matching begin/end as well). Fixes #536
2015-10-17More cleanups in the buffer open/reload codeMaxime Coste
2015-10-17Move line parsing and to Buffer.cc directlyMaxime Coste
2015-10-17Refactor buffer creation and reloading to be more explicitMaxime Coste
Reloading used to be implicit in the buffer creation function, which is not always nice, as code that explicitely wanted to reload a buffer could not say so.
2015-09-27Store timespec for buffer fs timestamps, not just time_tMaxime Coste
time_t has a resolution of one second, which cause troubles when a file changes multiple time during that same second.
2015-06-06Move write_debug to buffer utils as write_to_debug_bufferMaxime Coste
2015-02-25Respect columns when copying selection, not just bytesMaxime Coste
2014-12-23Remove trailing blank linesMaxime Coste
2014-09-22tweak helper functions in buffer_utils.hhMaxime Coste
2014-08-15Add support for reading from stdin/writing to stdout in filter modeMaxime Coste
Note that kakoune still needs to read the whole buffer first, only once stdin is closed can it execute the keys.
2014-07-05utf8: use end of sequence iterators for more securityMaxime Coste
2014-05-14Iterate in reversed order on selections when modifing bufferMaxime Coste
This way, update only needs to be called once everything is done as we always modify after the next selection to be used.
2014-05-07Refactor LineAndColumn coordinatesMaxime Coste
BufferCoord -> ByteCoord DisplayCoord -> CharCoord Moved their definition along with LineAndColumn into coord.hh
2014-05-02Add support for non-scrolling fifo buffersMaxime Coste
2014-04-29Add support for running Kakoune with redirected stdinMaxime Coste
Will read to a *stdin* fifo buffer
2014-04-28Move some buffer related utility functions to buffer_utils.{cc,hh}Maxime Coste