diff options
Diffstat (limited to 'src/Buffer.zig')
| -rw-r--r-- | src/Buffer.zig | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/Buffer.zig b/src/Buffer.zig index 0c95e6e..7f6e7d7 100644 --- a/src/Buffer.zig +++ b/src/Buffer.zig | |||
| @@ -1,16 +1,15 @@ | |||
| 1 | const conf = @import("es-config"); | 1 | const es = @import("root"); |
| 2 | const std = @import("std"); | 2 | const std = @import("std"); |
| 3 | 3 | ||
| 4 | const Allocator = std.mem.Allocator; | 4 | const Allocator = std.mem.Allocator; |
| 5 | const ArrayList = std.ArrayList; | 5 | const ArrayList = std.ArrayList; |
| 6 | const Buffer = @This(); | 6 | const Buffer = @This(); |
| 7 | const Config = @import("Config.zig"); | 7 | const Config = es.Config; |
| 8 | const File = std.fs.File; | 8 | const File = std.fs.File; |
| 9 | const files = @import("files.zig"); | 9 | const Editor = es.Editor; |
| 10 | const Editor = @import("Editor.zig"); | 10 | const Highlight = es.Highlight; |
| 11 | const Highlight = @import("highlight.zig").Highlight; | 11 | const Row = es.Row; |
| 12 | const Row = @import("Row.zig"); | 12 | const Syntax = es.Syntax; |
| 13 | const Syntax = @import("Syntax.zig"); | ||
| 14 | 13 | ||
| 15 | allocator: Allocator, | 14 | allocator: Allocator, |
| 16 | 15 | ||
| @@ -200,7 +199,7 @@ pub fn drawRows(self: Buffer, writer: anytype, screenrows: usize, screencols: us | |||
| 200 | const welcome_data = try std.fmt.allocPrint( | 199 | const welcome_data = try std.fmt.allocPrint( |
| 201 | self.allocator, | 200 | self.allocator, |
| 202 | "ES -- version {}", | 201 | "ES -- version {}", |
| 203 | .{conf.es_version}, | 202 | .{es.conf.es_version}, |
| 204 | ); | 203 | ); |
| 205 | defer self.allocator.free(welcome_data); | 204 | defer self.allocator.free(welcome_data); |
| 206 | var welcome = welcome_data; | 205 | var welcome = welcome_data; |
| @@ -435,7 +434,7 @@ pub fn save(self: *Buffer, editor: *Editor) !void { | |||
| 435 | const fname = (try editor.prompt("Save as")) orelse { return; }; | 434 | const fname = (try editor.prompt("Save as")) orelse { return; }; |
| 436 | defer self.allocator.free(fname); | 435 | defer self.allocator.free(fname); |
| 437 | 436 | ||
| 438 | const file_path = try files.resolvePath(self.allocator, fname); | 437 | const file_path = try es.files.resolvePath(self.allocator, fname); |
| 439 | errdefer self.allocator.free(file_path); | 438 | errdefer self.allocator.free(file_path); |
| 440 | 439 | ||
| 441 | const file_name = std.fs.path.basename(file_path); | 440 | const file_name = std.fs.path.basename(file_path); |