this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

tty: add events to parser handling, update comment

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>

+24 -3
+24 -3
src/Tty.zig
··· 134 134 const result = try parser.parse(buf[start..n]); 135 135 start = result.n; 136 136 // TODO: if we get 0 byte read, copy the remaining bytes to the 137 - // beginning of the buffer and read mmore? 137 + // beginning of the buffer and read mmore? this should only happen 138 + // if we are in the middle of a grapheme at and filled our 139 + // buffer. Probably can happen on large pastes so needs to be 140 + // implemented but low priority 138 141 139 142 const event = result.event orelse continue; 140 143 switch (event) { ··· 143 146 vx.postEvent(.{ .key_press = key }); 144 147 } 145 148 }, 146 - .focus_in => {}, 147 - .focus_out => {}, 149 + .focus_in => { 150 + if (@hasField(EventType, "focus_in")) { 151 + vx.postEvent(.focus_in); 152 + } 153 + }, 154 + .focus_out => { 155 + if (@hasField(EventType, "focus_out")) { 156 + vx.postEvent(.focus_out); 157 + } 158 + }, 159 + .paste_start => { 160 + if (@hasField(EventType, "paste_start")) { 161 + vx.postEvent(.paste_start); 162 + } 163 + }, 164 + .paste_end => { 165 + if (@hasField(EventType, "paste_end")) { 166 + vx.postEvent(.paste_end); 167 + } 168 + }, 148 169 } 149 170 } 150 171 }