| 1 | function _autopair_insert_left --argument-names left right |
| 2 | set --local buffer (commandline) |
| 3 | set --local before (commandline --cut-at-cursor) |
| 4 | |
| 5 | commandline --insert -- $left |
| 6 | |
| 7 | switch "$buffer" |
| 8 | case "$before"{," "\*,$autopair_right\*} |
| 9 | set --local index (commandline --cursor) |
| 10 | commandline --insert -- $right |
| 11 | commandline --cursor $index |
| 12 | end |
| 13 | end |