summaryrefslogtreecommitdiff
path: root/src/buffer.cc
AgeCommit message (Collapse)Author
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
2017-01-30Make SharedString::create take a list of StringViewsMaxime Coste
2017-01-28Remove hash from StringDataMaxime Coste
Maintaining the hash value of strings is not worth it as we only use it for buffer reload, but pay for it on any buffer modifications.
2017-01-01When inserting at the end, store the next line as end pos in the changeMaxime Coste
2016-11-24Forward client name to contexts created for write-allMaxime Coste
Fixes #937
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-09-21Tweak Buffer::offset_coord implementationMaxime Coste
2016-08-14Fix comment missing a closing parenthesisMaxime Coste
2016-07-26Use explicit initialization of the `timespec` object to fix compilation on ↵Frank LENORMAND
older compilers
2016-07-24Support for going backward/forward in buffer history with <a-u>/<a-U>Maxime Coste
2016-07-24Support counts for undo/redoMaxime Coste
2016-07-24Support moving between arbitrary history nodesMaxime Coste
2016-07-24Store creation timepoint in HistoryNodeMaxime Coste
2016-07-24Store buffer undo/redo information in a tree instead of a vectorMaxime Coste
2016-07-24Merge remote-tracking branch 'lenormf/readonly-mode'Maxime Coste
2016-07-23Implement a `readonly` modeFrank LENORMAND
This commit introduces the `readonly` variable as well as the `-ro` command line option which prevent buffers from being overwritten on disk when the `write` command is used without arguments. Some buffers can selectively be put in readonly mode by setting the `readonly` variable on the `buffer` scope, the `global` mode will affect all buffers (even those who will be open subsequently), using the `window` scope will have no effect. Closes #685