make backspace work in find window
haldean
2 years ago
119 | 119 | method handlekey*(this: FindBuf, k: Key): bool = |
120 | 120 | if k.isEscape(): |
121 | 121 | return false |
122 | let c = toChar(k) | |
123 | if isNone(c): | |
124 | return false | |
125 | this.search = this.search & c.get() | |
122 | if k.isBackspace(): | |
123 | this.search = this.search.substr(0, this.search.len - 2) | |
124 | else: | |
125 | let c = toChar(k) | |
126 | if isNone(c): | |
127 | return false | |
128 | this.search = this.search & c.get() | |
126 | 129 | this.refresh() |
127 | 130 | return true |