Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Tatsuki-I
Copy link

When I set translated help(for example: set helplang=ja,en in .vimrc), open translated help and press CTRL-], Vim opens help in translated help, but open English help and press CTRL-], Vim opens translated help.
I'd like vim to open same language help as current opened help.
So, I fixed tag.c.

@vim-ml
Copy link

vim-ml commented Nov 12, 2016

Hi Tatsuki,

2016-11-12(Sat) 16:49:47 UTC+9 Tatsuki:

When I set translated help(for example: set helplang=ja,en in .vimrc), open translated help and press CTRL-], Vim opens help in translated help, but open English help and press CTRL-], Vim opens translated help.

I'd like vim to open same language help as current opened help.

So, I fixed tag.c.

You can view, comment on, or merge this pull request online at:

  #1249

Commit Summary

an action help language CTRL-] in tag.c fixed

File Changes

M
src/tag.c
(29)

Patch Links:

https://github.com/vim/vim/pull/1249.patch
https://github.com/vim/vim/pull/1249.diff

Nice patch!
It is indeed written in the document.
:h helplang

   When using CTRL-] and ":help!" in a non-English help file Vim will
   try to find the tag in the current language before using this option.

I wrote a patch to add a test for this. (Attached)
Check it out.

BTW, I found a bit wrong indentation.
tag.c;1527+ /* Prefer help tags according to 'helplang'. Put the

TAB SPC SPC SPC SPC TAB SPC SPC SPC SPC
It should be:

TAB TAB SPC SPC SPC SPC

Best regards,
Hirohito Higashi (a.k.a. h_east)

src/tag.c Outdated
#ifdef FEAT_MULTI_LANG
/* Set a flag if the file extension is .txt */
int is_txt = 0;
if ((flags & TAG_KEEP_LANG)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.
I fixed it.

src/tag.c Outdated
*/
#ifdef FEAT_MULTI_LANG
/* Set a flag if the file extension is .txt */
int is_txt = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a statment before this declaration. vim doesn't support C99. so move up this declaration with #ifdef FEAT_MULTI_LANG.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the definition to 1359.

@brammool
Copy link
Contributor

The declaration
int is_txt = FALSE;
Needs to go at the start of the block.

char_u *help_lang_find = NULL; /* lang to be found */
char_u help_lang[3]; /* lang of current tags file */
char_u *saved_pat = NULL; /* copy of pat[] */
int is_txt = FALSE; /* flag of file extension */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to enclose this in #ifdef FEAT_MULTI_LANG ~ #endif

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, It was already surrounded. sorry.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not necessary that you apologize
Thank you for teaching me.

@Tatsuki-I
Copy link
Author

this test was created by h_east.
I'm sorry to forget to wrote about it.

@mattn
Copy link
Member

mattn commented Nov 16, 2016

@Tatsuki-I thanks. looks good to me.

@brammool brammool closed this in 6dbf66a Dec 1, 2016
jamessan added a commit to jamessan/neovim that referenced this pull request Mar 20, 2017
Problem:    When reading English help and using CTRl-] the language from
            'helplang' is used.
Solution:   Make help tag jumps keep the language. (Tatsuki, test by Hirohito
            Higashi, closes vim/vim#1249)

vim/vim@6dbf66a
desvp pushed a commit to desvp/vim that referenced this pull request May 30, 2017
Problem:    When reading English help and using CTRl-] the language from
            'helplang' is used.
Solution:   Make help tag jumps keep the language. (Tatsuki, test by Hirohito
            Higashi, closes vim#1249)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants