record buffer filename
This commit is contained in:
parent
8542de4ee1
commit
64ed3174ac
@ -70,6 +70,7 @@ bool Buffer::load_from_file(const char * filename)
|
||||
}
|
||||
|
||||
load_text_in_buffer(buffer, buffer_size, file_size);
|
||||
m_filename = filename;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "LineEndings.h"
|
||||
#include "Encoding.h"
|
||||
#include "GapBuffer.h"
|
||||
#include <string>
|
||||
|
||||
class Buffer
|
||||
{
|
||||
@ -107,6 +108,7 @@ public:
|
||||
bool insert_mode() const { return m_insert_mode; }
|
||||
void insert_code_point(uint32_t code_point, bool adjust_iterators = true);
|
||||
void erase_code_point(const Buffer::Iterator & position);
|
||||
std::string filename() const { return m_filename; }
|
||||
|
||||
protected:
|
||||
bool m_eol_at_eof;
|
||||
@ -117,6 +119,7 @@ protected:
|
||||
bool m_insert_mode;
|
||||
size_t m_insert_position;
|
||||
std::list<std::shared_ptr<Iterator>> m_iterators;
|
||||
std::string m_filename;
|
||||
|
||||
void common_initialization();
|
||||
bool load_from_file(const char * filename);
|
||||
|
Loading…
x
Reference in New Issue
Block a user