Fix a few bugs.
- Moving lines after themselves didnt work. - moving empty lines deleted them. - "w" didnt set state to unmodified in generic buffers. - in "hl" aligned the numbers (by digits)
This commit is contained in:
@@ -34,6 +34,7 @@ struct Buffer {
|
||||
virtual uint64_t bytes() = 0;
|
||||
virtual void set_filename(std::filesystem::path path) = 0;
|
||||
virtual std::filesystem::path filename() = 0;
|
||||
virtual void saved_hook() = 0;
|
||||
virtual void load(BEd &ctx, vase::Shard *text) = 0;
|
||||
virtual vase::Shard *copy(uint64_t start_line, uint64_t end_line) = 0;
|
||||
virtual void substitute(
|
||||
|
||||
@@ -10,6 +10,7 @@ struct ClipBuffer : Buffer {
|
||||
|
||||
void clip_write(vase::Shard *text);
|
||||
bool waste() override;
|
||||
void saved_hook() override;
|
||||
uint64_t lines() override;
|
||||
uint64_t bytes() override;
|
||||
void load(BEd &ctx, vase::Shard *text) override;
|
||||
|
||||
@@ -31,6 +31,7 @@ struct GenericBuffer : ShardBuffer {
|
||||
bool undo(BEd &ctx);
|
||||
bool redo(BEd &ctx);
|
||||
uint64_t prune(int);
|
||||
void saved_hook() override;
|
||||
bool waste() override;
|
||||
void load(BEd &ctx, vase::Shard *text) override;
|
||||
void set_filename(std::filesystem::path path) override;
|
||||
|
||||
@@ -12,6 +12,7 @@ struct ReadonlyBuffer : ShardBuffer {
|
||||
const syntax::ParserSnapshot &snapshot
|
||||
) : ShardBuffer(std::move(name), root, snapshot, Kind::History) {}
|
||||
|
||||
void saved_hook() override {}
|
||||
bool waste() override {
|
||||
return useless;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user