mirror of
https://github.com/neovim/neovim.git
synced 2025-10-15 22:36:09 +00:00
fix(api): nvim_create_user_command addr option should allow ranges #35077
Problem: Using `addr` without `range` in nvim_create_user_command gives "No range allowed" error, inconsistent with `:command -addr` behavior. Solution: Set EX_RANGE flag when `addr` option is specified to match `:command` behavior.
This commit is contained in:
@@ -1170,6 +1170,7 @@ void create_user_command(uint64_t channel_id, String name, Union(String, LuaRef)
|
||||
goto err;
|
||||
});
|
||||
|
||||
argt |= EX_RANGE;
|
||||
if (addr_type_arg != ADDR_LINES) {
|
||||
argt |= EX_ZEROR;
|
||||
}
|
||||
|
Reference in New Issue
Block a user