summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Uko Kokņevičs2021-12-31 20:46:22 +0200
committerGravatar Uko Kokņevičs2021-12-31 20:46:22 +0200
commit7c9d7a5d6df40542574ba392c08bac8462c07927 (patch)
tree8833e42e4deba3cfa5b39f1fcbc887efb53233c2 /src
parentAdd `C-x b` as a buffer switching shortcut (diff)
downloades-7c9d7a5d6df40542574ba392c08bac8462c07927.tar.gz
es-7c9d7a5d6df40542574ba392c08bac8462c07927.tar.xz
es-7c9d7a5d6df40542574ba392c08bac8462c07927.zip
Some changes
Diffstat (limited to 'src')
-rw-r--r--src/key_state.zig11
-rw-r--r--src/main.zig10
-rw-r--r--src/search.zig1
3 files changed, 13 insertions, 9 deletions
diff --git a/src/key_state.zig b/src/key_state.zig
index a1dbdbe..0ea30cb 100644
--- a/src/key_state.zig
+++ b/src/key_state.zig
@@ -26,7 +26,10 @@ pub fn mgState(editor: *Editor, buf: *Buffer, key: Key) Error!void {
26 // ========== <*> ========== 26 // ========== <*> ==========
27 Key.char('g') => try buf.goToLine(editor), 27 Key.char('g') => try buf.goToLine(editor),
28 28
29 else => try editor.setStatusMessage("Unknown chord: M-g {}", .{key}), 29 else => {
30 std.log.debug("Unknown chord: M-g {}", .{key});
31 try editor.setStatusMessage("Unknown chord: M-g {}", .{key});
32 },
30 } 33 }
31} 34}
32 35
@@ -45,7 +48,10 @@ pub fn cxState(editor: *Editor, buf: *Buffer, key: Key) Error!void {
45 // ========== <*> ========== 48 // ========== <*> ==========
46 Key.char('k') => _ = try editor.killCurrentBuffer(), 49 Key.char('k') => _ = try editor.killCurrentBuffer(),
47 50
48 else => try editor.setStatusMessage("Unknown chord: C-x {}", .{key}), 51 else => {
52 std.log.debug("Unknown chord: C-x {}", .{key});
53 try editor.setStatusMessage("Unknown chord: C-x {}", .{key});
54 },
49 } 55 }
50} 56}
51 57
@@ -105,6 +111,7 @@ pub fn defaultState(editor: *Editor, buf: *Buffer, key: Key) Error!void {
105 } 111 }
106 } 112 }
107 113
114 std.log.debug("Unknown key: {}", .{key});
108 try editor.setStatusMessage("Unknown key: {}", .{key}); 115 try editor.setStatusMessage("Unknown key: {}", .{key});
109 }, 116 },
110 } 117 }
diff --git a/src/main.zig b/src/main.zig
index 89c72f0..7a4aaa4 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -18,12 +18,10 @@ pub fn log(
18 18
19 const writer = file.writer(); 19 const writer = file.writer();
20 20
21 const prefix = switch (scope) { 21 nosuspend writer.print(
22 .default => "[" ++ level.asText() ++ "] ", 22 "[" ++ @tagName(scope) ++ ":" ++ level.asText() ++ "] " ++ format ++ "\n",
23 else => "[" ++ @tagName(scope) ++ ":" ++ level.asText() ++ "] ", 23 args,
24 }; 24 ) catch return;
25
26 nosuspend writer.print(prefix ++ format ++ "\n", args) catch return;
27} 25}
28 26
29pub fn main() !void { 27pub fn main() !void {
diff --git a/src/search.zig b/src/search.zig
index bc29813..557b030 100644
--- a/src/search.zig
+++ b/src/search.zig
@@ -76,7 +76,6 @@ fn searchCallback(editor: *Editor, query: []const u8, last_key: Key, data: *Call
76 data.last_match = idx; 76 data.last_match = idx;
77 data.buffer.cy = idx; 77 data.buffer.cy = idx;
78 data.buffer.cx = row.rxToCx(data.buffer.config, match); 78 data.buffer.cx = row.rxToCx(data.buffer.config, match);
79 // TODO: data.buffer.rowoff = data.buffer.rows.items.len;
80 79
81 data.saved_hl = .{ 80 data.saved_hl = .{
82 .line = idx, 81 .line = idx,