Mercurial > vim
comparison src/map.c @ 23493:f8382c4e6551 v8.2.2289
patch 8.2.2289: Vim9: 'cpo' can become empty
Commit: https://github.com/vim/vim/commit/e5a2dc87fd9d63dfd0d9c379e363ee8b8c05b14c
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 3 19:52:05 2021 +0100
patch 8.2.2289: Vim9: 'cpo' can become empty
Problem: Vim9: 'cpo' can become empty.
Solution: Use empty_option instead of an empty string. Update quickfix
buffer after restoring 'cpo'. (closes #7608)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 03 Jan 2021 20:00:03 +0100 |
parents | b545334ae654 |
children | db2b4e867d06 |
comparison
equal
deleted
inserted
replaced
23492:27c9e319653b | 23493:f8382c4e6551 |
---|---|
2473 add_map(char_u *map, int mode) | 2473 add_map(char_u *map, int mode) |
2474 { | 2474 { |
2475 char_u *s; | 2475 char_u *s; |
2476 char_u *cpo_save = p_cpo; | 2476 char_u *cpo_save = p_cpo; |
2477 | 2477 |
2478 p_cpo = (char_u *)""; // Allow <> notation | 2478 p_cpo = empty_option; // Allow <> notation |
2479 s = vim_strsave(map); | 2479 s = vim_strsave(map); |
2480 if (s != NULL) | 2480 if (s != NULL) |
2481 { | 2481 { |
2482 (void)do_map(0, s, mode, FALSE); | 2482 (void)do_map(0, s, mode, FALSE); |
2483 vim_free(s); | 2483 vim_free(s); |