Mercurial > vim
comparison src/ex_getln.c @ 28771:cf9f5b5c8079 v8.2.4910
patch 8.2.4910: imperfect coding
Commit: https://github.com/vim/vim/commit/9ff7d717aa3176de5c61de340deb93f41c7780fc
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 7 17:45:16 2022 +0100
patch 8.2.4910: imperfect coding
Problem: Imperfect coding.
Solution: Make code nicer.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 07 May 2022 19:00:03 +0200 |
parents | add09d468c0d |
children | d770568e6c98 |
comparison
equal
deleted
inserted
replaced
28770:c475992c9bee | 28771:cf9f5b5c8079 |
---|---|
4128 | 4128 |
4129 if (cmdline_star > 0) | 4129 if (cmdline_star > 0) |
4130 return NULL; | 4130 return NULL; |
4131 | 4131 |
4132 p = get_ccline_ptr(); | 4132 p = get_ccline_ptr(); |
4133 if (p && p->xpc != NULL) | 4133 if (p != NULL && p->xpc != NULL) |
4134 { | 4134 { |
4135 char_u *cmd_compl; | 4135 char_u *cmd_compl; |
4136 | 4136 |
4137 set_expand_context(p->xpc); | 4137 set_expand_context(p->xpc); |
4138 | 4138 |
4139 cmd_compl = cmdcomplete_type_to_str(p->xpc->xp_context); | 4139 cmd_compl = cmdcomplete_type_to_str(p->xpc->xp_context); |
4140 if (cmd_compl != NULL) | 4140 if (cmd_compl != NULL) |
4141 return vim_strnsave(cmd_compl, strlen((char *)cmd_compl)); | 4141 return vim_strsave(cmd_compl); |
4142 } | 4142 } |
4143 | 4143 |
4144 return NULL; | 4144 return NULL; |
4145 } | 4145 } |
4146 | 4146 |