()
| 182 | rebuildKeymap(); |
| 183 | |
| 184 | function registerCoreCommands() { |
| 185 | addCommand({ |
| 186 | name: "focusEditor", |
| 187 | description: "Focus editor", |
| 188 | readOnly: true, |
| 189 | requiresView: false, |
| 190 | run(view) { |
| 191 | const resolvedView = resolveView(view); |
| 192 | resolvedView?.focus(); |
| 193 | return true; |
| 194 | }, |
| 195 | }); |
| 196 | addCommand({ |
| 197 | name: "findFile", |
| 198 | description: "Find file in workspace", |
| 199 | readOnly: true, |
| 200 | requiresView: false, |
| 201 | run() { |
| 202 | acode.exec("find-file"); |
| 203 | return true; |
| 204 | }, |
| 205 | }); |
| 206 | addCommand({ |
| 207 | name: "closeCurrentTab", |
| 208 | description: "Close current tab", |
| 209 | readOnly: false, |
| 210 | requiresView: false, |
| 211 | run() { |
| 212 | acode.exec("close-current-tab"); |
| 213 | return true; |
| 214 | }, |
| 215 | }); |
| 216 | addCommand({ |
| 217 | name: "closeAllTabs", |
| 218 | description: "Close all tabs", |
| 219 | readOnly: false, |
| 220 | requiresView: false, |
| 221 | run() { |
| 222 | acode.exec("close-all-tabs"); |
| 223 | return true; |
| 224 | }, |
| 225 | }); |
| 226 | addCommand({ |
| 227 | name: "togglePinnedTab", |
| 228 | description: "Pin or unpin current tab", |
| 229 | readOnly: true, |
| 230 | requiresView: false, |
| 231 | run() { |
| 232 | acode.exec("toggle-pin-tab"); |
| 233 | return true; |
| 234 | }, |
| 235 | }); |
| 236 | addCommand({ |
| 237 | name: "newFile", |
| 238 | description: "Create new file", |
| 239 | readOnly: true, |
| 240 | requiresView: false, |
| 241 | run() { |
no test coverage detected