| 219 | // It is an important behavior that we want to use. |
| 220 | |
| 221 | function map(command: VimCommand) { |
| 222 | if (!command.args) { |
| 223 | Logger.warn( |
| 224 | `Could not execute vimrc command "${command.name}: expected arguments"`, |
| 225 | ); |
| 226 | return; |
| 227 | } |
| 228 | if (!command.args.lhs || !command.args.rhs) { |
| 229 | Logger.warn( |
| 230 | `Could not execute vimrc command "${command.name}: expected arguments"`, |
| 231 | ); |
| 232 | return; |
| 233 | } |
| 234 | if (command.mode) { |
| 235 | Vim.map(command.args.lhs, command.args.rhs, command.mode); |
| 236 | } else { |
| 237 | //@ts-expect-error We can use this without providing context (mode) |
| 238 | Vim.map(command.args.lhs, command.args.rhs); |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | function noremap(command: VimCommand) { |
| 243 | if (!command.args) { |