summaryrefslogtreecommitdiff
path: root/src/buffer.cc
AgeCommit message (Collapse)Author
2020-03-20Remove posB from information given by the diff algorithmMaxime Coste
posB is always the sum of previous add len and previous keep len, so very easy to keep track of.
2020-01-01Add 'history' and 'uncommitted_modifications' expansionsJason Felice
2019-12-19Update fs status post buffer writeMaxime Coste
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-12-07Update New flag and last save timestamp on buffer renameMaxime Coste
Fxies #3244
2019-12-04Merge remote-tracking branch 'lenormf/reload-buffer-hash'Maxime Coste
2019-12-03src: Reload buffers when their contents' hash changesFrank LENORMAND
Instead of triggering a reload event when the timestamp of a buffer's underlying file changes, do so when its contents are actually modified.
2019-11-30Refactor diff to make allocating a diff vector optionalMaxime Coste
The diff interface now goes through a for_each_diff function that uses a callback for each found diff.
2019-11-25src: Use `begin()` to get iteratorsFrank LENORMAND
When compiling the code with `-Wp,-D_GLIBCXX_ASSERTIONS`, the process gets aborted, likely because iterators to standard containers are not obtained in a safe way. Fixes #3226.
2019-11-09Add static or const where usefulJason Felice
2019-06-19Refactor option_to_string quoting support, introduce Quoting::RawMaxime Coste
2019-04-27Let parse_lines ensure that there's at least 1 line with \nDelapouite
2019-03-27Add missing flags to debug buffers outputDelapouite
2019-01-23Always select inserted text after pipingMaxime Coste
Relying on general selection update code is error prone due to diffing. Fixes #2394
2018-10-23Refactor Hook management to have a well defined list of hooksMaxime Coste
Hooks are now an enum class instead of passing strings around.
2018-08-29Use shell specific quoting for env varsMaxime Coste
Add a test case to validate roundtrips between Kakoune and the shell.
2018-05-21Gather options in a vector when running Buffer::on_option_changedMaxime Coste
on_option_changed might trigger hooks that will mutate the option managers, invalidating the iterators we use.
2018-05-14Rename Context::Flags::Transient to Context::Flags::DraftMaxime Coste
Draft is well establish and all draft context are transient.
2018-05-02Refactor buffer undo treeMaxime Coste
Store the undo tree as an array of undo nodes, instead of as a pointer based tree.
2018-04-06Make error messages more consistentDelapouite
2018-03-13Do not jump to buffer start on `g.` with no previous modificationsMaxime Coste
2018-03-09Detect no-op replaces and do not act on themMaxime Coste
This avoids recording no-op undo groups.
2018-02-24Allow l/h to cross line boundariesMaxime Coste
l and h are now respectively "next character" and "previous character"
2018-02-18Buffer: avoid expensive option flattening in on_registred with NoHooksMaxime Coste
2018-02-11Refuse modification of ReadOnly buffers and make Debug buffer readonlyMaxime Coste
The debug buffer is a bit special as lots of events might mutate it, permitting it to be modified leads to some buggy behaviour: For example, `pipe` uses a ForwardChangeTracker to track buffer changes, but when applied on a debug buffer with the profile flag on, each shell execution will trigger an additional modification of the buffer while applying the changes, leading to an assertion failing as changes might not be happening in a forward way anymore. Trying to modify a debug buffer will now raise an error immediatly.
2018-01-18Use the _str and _sv string literals more oftenMaxime Coste
2017-11-07Buffer: change clamp logic to preserve orderingMaxime Coste
clamp could change ordering between a coordinate past the end. Say in a buffer with 1 line of 2 char: {0, 1} was clamped to {0, 1} {1, 0} was clamped to {0, 0} That was reversing their ordering, and might be the root cause of the bug lurking in undo range computation.
2017-09-01Make Buffer::Modification an aggregateMaxime Coste
2017-08-29Rename containers.hh to ranges.hh (and Container to Range)Maxime Coste
2017-08-04Purge history on buffer reload when NoUndo flag is onMaxime Coste
We were preserving the history in that case, so on fifo buffers (that set the NoUndo flag until the fifo is closed), we still had the history from the "previous life" of the buffer, leading crashes when trying to apply it. Fixes #1518
2017-08-01Slight formatting tweakMaxime Coste
2017-06-28Consider non-files buffers as never modifiedMaxime Coste
2017-06-26Fix replacing last eol with a single eolMaxime Coste
2017-06-15Move tolerance for one past end of line coordinates to highlighter codeMaxime Coste
The rest of Kakoune's code now requires coord passed to Buffer::iterator_at to be valid.
2017-06-15Go back to window lines ending at one past the end of the buffer lineMaxime Coste
Change Buffer::iterator_at so that this case is tolerated, and fixes the coord to next line start instead of clamping to last line char.
2017-06-12Simplify a bit buffer iteration functionsMaxime Coste
Dont try to ensure the returned value is valid, incrementing past the end/decrementing before begin is the caller's error.
2017-06-11Fix the Buffer::end() madnessMaxime Coste
Until now, buffer had multiple recognized end coordinates, either { line_count, 0 } or { line_count - 1, line[line_count - 1].length }. Now the only correct end coord is { line_count, 0 }, removing the need for various special cases.
2017-06-07Run BufCreate hook *before* Buf{Open,New}FileMaxime Coste
2017-06-07Small style tweakMaxime Coste
2017-05-26Remove unneeded explicit conversionMaxime Coste
2017-05-22Do not avoid eol in insert mode vertical movementMaxime Coste
2017-05-21Fix vertical movement with tabstopsMaxime Coste
Fixes #1388
2017-05-07Respect tabstop in Buffer::offset_coordMaxime Coste
2017-04-20Fix generation of empty erase changesMaxime Coste
Fixes #1308
2017-03-22Try to fix clang 3.5 compilationMaxime Coste
2017-03-16Fixes some clang-tidy warning and add a few missing meta.hh includeMaxime Coste
2017-03-15Small code tweaks regarding flags handlingMaxime Coste
2017-02-19Rename BufNew and BufOpen hooks to BufNewFile and BufOpenFileMaxime Coste
Fixes #1225
2017-02-07Fix Buffer::offset_coord that was dropping the target coordinateMaxime Coste
2017-01-31Formatting fixMaxime Coste