Is your feature request about something that is currently impossible or hard to do? Please describe the problem.
I see both libc *printf and vim's own vim_*printf are used. The latter doesn't support format specifiers like %1$s which specifies which argument to use.
This is used to rephrase translation messages because different languages have different ordering.
Describe the solution you'd like
Use libc's *printf throughout the codebase.
Most systems including Linux (glibc), FreeBSD, OpenBSD, MacOS support this as I read their man pages. Windows may not support this but I plan to fallback to foreign order for it.
Describe alternatives you've considered
%1$s in vim_*printf. Someone (not me) needs to write the code.—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
The reason we use vim_snprintf() is that snprintf() is not available or not properly implemented on some platforms. We could use the library snprintf() when it works, but then the translations would fail, and possibly cause a crash, when vim_snprintf() is used.
A generic solution would be to make the "%1$s" form work with vim_snprintf(). I don't know how complicated this is, getting the right argument from through va_arg().
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
A generic solution would be to make the "%1$s" form work with vim_snprintf(). I don't know how complicated this is, getting the right argument from through va_arg().
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Hi,
Op wo 15 jun. 2022 12:55 schreef Bram Moolenaar ***@***.***>:
> A generic solution would be to make the "%1$s" form work with
> vim_snprintf(). I don't know how complicated this is, getting the right
> argument from through va_arg().
>
I'll try to see if I can come up with something...
Christ van Willegen
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Hi Christ van Willegen, where is your patch that I can try out?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
Hi Christ van Willegen, where is your patch that I can try out?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
If I send you the output of "git diff", is that enough to test?
Yes!
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
If I send you the output of "git diff", is that enough to test?
Yes!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Tentatively fixed by #12140
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
Hi, Op do 2 mrt. 2023 11:20 schreef 依云 @.***>:
Hi Christ van Willegen, where is your patch that I can try out?
Please check out the latest commit on #12140, I've caught an error (I had read documentation that was .. not as detailed as I wanted it to, and had reversed the [flags] and [pos-arguments] part of the format string).
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.![]()
Hi, Op do 2 mrt. 2023 11:20 schreef 依云 @.***>:
Hi Christ van Willegen, where is your patch that I can try out?
Please check out the latest commit on #12140, I've caught an error (I had read documentation that was .. not as detailed as I wanted it to, and had reversed the [flags] and [pos-arguments] part of the format string).
A generic solution would be to make the "%1$s" form work with vim_snprintf(). I don't know how complicated this is, getting the right argument from through va_arg().
I implemented this in this pr (#12140), but I'm not sure if you caught that...
Christ van Willegen
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.![]()
Now that PR #12140 is included, can this issue be closed?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
Closed #10577 as completed.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()