[ldapvi] [PATCH] Add "vim:filetype=ldif:" to modeline
SATOH Fumiyasu
fumiyas at osstech.jp
Thu Apr 4 10:49:07 CEST 2013
Hi!
At Wed, 3 Apr 2013 03:52:42 -0700 (PDT),
Ken Stailey wrote:
> >> If somebody uses
> >>
> >> ldapvi --encoding ASCII
> >>
> >> should vim syntax highlight work or not?
>
> > It depends on your .vimrc.
>
> if you look at
>
> diff --git a/ldapvi/ldapvi.c b/ldapvi/ldapvi.c
> index b594327..48cfe06 100644
> --- a/ldapvi/ldapvi.c
> +++ b/ldapvi/ldapvi.c
> @@ -1419,7 +1419,7 @@ write_file_header(FILE *s, cmdline *cmdline)
> * and a "fileencoding" doesn't actually seem exist. Very
> * disappointing, but until a real solution turns up, it's
> * better to do nothing. */
> - fputs("# -*- coding: utf-8 -*-\n", s);
> + fputs("# -*- coding: utf-8 -*- vim:filetype=ldif:\n", s);
> nlines++;
> }
> if (cmdline->ldif) {
>
>
> you don't see that it is inside a condition. I take away the comments and it is:
Ah... I see. I'll revise and repost the patch later.
Thank you!!
> if (print_binary_mode == PRINT_UTF8 && !cmdline->ldif) {
> fputs("# -*- coding: utf-8 -*- vim:filetype=ldif:\n", s);
> nlines++;
> }
>
>
> What if
> ldapvi --encoding ASCII
>
> you get print_binary_mode != PRINT_UTF8
--
-- Name: SATOH Fumiyasu @ OSS Technology Corp. (fumiyas @ osstech co jp)
-- Business Home: http://www.OSSTech.co.jp/
-- GitHub Home: https://GitHub.com/fumiyas/
-- PGP Fingerprint: BBE1 A1C9 525A 292E 6729 CDEC ADC2 9DCA 5E1C CBCA
More information about the ldapvi
mailing list