Buffer::filename() returns shared_ptr to string

This commit is contained in:
josh committed 2017-01-27 20:50:15 -05:00
1 parent 37d27d6063
commit 2ae1d72d6a
3 files changed
+6 -10

No files matched your search

+1 -1
View File
@@ -86,7 +86,7 @@ bool Buffer::load_from_file(const char * filename)
}
load_text_in_buffer(buffer, buffer_size, file_size);
m_filename = filename;
m_filename = std::make_shared<std::string>(filename);
return true;
}
+2 -2
View File
@@ -131,7 +131,7 @@ public:
bool insert_mode() const { return m_insert_mode; }
void insert_code_point(const Buffer::Iterator & position, uint32_t code_point);
void erase_code_point(const Buffer::Iterator & position);
std::string filename() const { return m_filename; }
std::shared_ptr<std::string> filename() const { return m_filename; }
Iterator begin() const { return Iterator(this); }
Iterator end() const { return *m_eof_iterator; }
void push_operation() { m_operation_level++; }
@@ -152,7 +152,7 @@ protected:
std::list<std::shared_ptr<Iterator>> m_iterators;
std::list<std::shared_ptr<Iterator>> m_cursors;
std::shared_ptr<Iterator> m_eof_iterator;
std::string m_filename;
std::shared_ptr<std::string> m_filename;
std::shared_ptr<ChangeOperation> m_current_change_operation;
int m_operation_level;
size_t m_current_change_operation_index;