10 Commits

Author SHA1 Message Date
Ingo Karkat a7dc6acdc7 FIX: ingo#cmdargs#GetStringExpr(): Escape (unescaped) double quotes when the argument contains backslashes; else, the expansion of \x will silently fail
Add ingo#cmdargs#GetUnescapedExpr(); when there's no need for empty expressions, the removal of the (single / double) quotes may be unexpected.
2017-05-26 17:43:53 +02:00
Ingo Karkat b41cb2e331 2017-05-26 17:33:59 +02:00
Ingo Karkat 7f229896b6 Move functions from ingo/cmdargs.vim to ingo/cmdargs/pattern.vim and ingo/cmdargs/substitute.vim 2017-05-26 17:28:37 +02:00
Ingo Karkat 5d04c721d7 Again change ingo#cmdargs#ParseSubstituteArgument() interface to parse the :substitute [flags] [count] by default 2017-05-26 17:14:20 +02:00
Ingo Karkat 3cb53fa7da 2017-05-26 17:03:57 +02:00
Ingo Karkat 34c244fcdb CHG: Redesign ingo#cmdargs#ParseSubstituteArgument() interface to the existing use cases
a:defaultReplacement should only be used when a:arguments is really empty, too. Introduce an optional options Dictionary and preset replacement / flags defaults of "~" and "&" resp. for when a:arguments is really empty, which makes sense for use with :substitute. Allow submatches for a:flagsExpr via a:options.flagsMatchCount, to avoid further parsing in the client.
ENH: Also parse lone {flags} (if a:flagsExpr is given) by default, and allow to turn this off via a:options.isAllowLoneFlags.
ENH: Allow to pass a:options.emptyPattern, too.
2017-05-26 17:03:39 +02:00
Ingo Karkat 8b79df9237 BUG: ingo#cmdargs#ParseSubstituteArgument() mistakenly returns a:defaultFlags when full /pat/repl/ or a literal pat is passed
Only return a:defaultFlags when the passed a:arguments is really empty.
2017-05-26 17:03:29 +02:00
Ingo Karkat 1d4bbf1c2c 2017-05-26 17:03:28 +02:00
Ingo Karkat e2b2cf3b60 BUG: ingo#cmdargs#ParseSubstituteArgument() mistakenly returns a:defaultFlags when full /pat/repl/ or a literal pat is passed
Only return a:defaultFlags when the passed a:arguments is really empty.
CHG: Redesign ingo#cmdargs#ParseSubstituteArgument() interface to the existing use cases. a:defaultReplacement should only be used when a:arguments is really empty, too. Introduce an optional options Dictionary and preset replacement / flags defaults of "~" and "&" resp. for when a:arguments is really empty, which makes sense for use with :substitute. Allow submatches for a:flagsExpr via a:options.flagsMatchCount, to avoid further parsing in the client.
ENH: Also parse lone {flags} (if a:flagsExpr is given) by default, and allow to turn this off via a:options.isAllowLoneFlags.
Move to ingo-library.
2017-05-26 17:03:20 +02:00
Ingo Karkat eb88648413 file creation 2017-05-26 17:03:12 +02:00