mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-11 23:22:41 +09:00
Create empty file if input doesn't exist
This commit is contained in:
@@ -50,18 +50,23 @@ class Buffer {
|
||||
|
||||
void remove(ulong start, ulong end) {
|
||||
text.remove(start, end);
|
||||
update();
|
||||
}
|
||||
void insert(ulong position, string value) {
|
||||
text.insert(position, value);
|
||||
update();
|
||||
}
|
||||
string substring(ulong start, ulong end = -1) {
|
||||
if (end == -1) {
|
||||
update();
|
||||
return text.substring(start, text.length);
|
||||
} else {
|
||||
update();
|
||||
return text.substring(start, end);
|
||||
}
|
||||
}
|
||||
char charAt(ulong pos) {
|
||||
update();
|
||||
return text.charAt(pos);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user