Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VIM Editor - TOhtml is not capturing the Character level differences #1725

Open
sandosh143 opened this issue May 25, 2017 · 14 comments
Open
Labels

Comments

@sandosh143
Copy link

I am using the "diffchar.vim" plugin to get the character level differences between 2 files. In the terminal I am able to see the character differences but when I try to convert that to html using :TOhtml, its not capturing the character differences. Its capturing only the line differences.

Version-Release number of selected component (if applicable): Vim (version: 7.4.629)
Operating system/version: CentOS release 6.8 (Final) 2.6.32-642.1.1.el6.centos.plus.x86_64
Terminal name/version: /dev/pts/1
$TERM: xterm

Steps to Reproduce:
Install the diffchar.vim plugin and run the below command to compare the two files using "vimdiff" or "vim -d"

vimdiff <file1> <file2> -c :TOhtml -c wqa

Actual results:
In the terminal you will be able to see the character level differences but when you convert that to html file its showing the line differences.

line difference

Expected results:
Both in the terminal & html we need to see the character level differences.

exact difference

@sandosh143 sandosh143 changed the title VIM Editor - TOhtml is not capturing the word differences VIM Editor - TOhtml is not capturing the Character level differences May 25, 2017
@vim-ml
Copy link

vim-ml commented May 30, 2017 via email

@vim-ml
Copy link

vim-ml commented May 30, 2017 via email

@vim-ml
Copy link

vim-ml commented May 30, 2017 via email

@sandosh143
Copy link
Author

Sorry for the stupid question. Do I need to use "diff" command if I need to use "2html.vim"? Please assist.

@vim-ml
Copy link

vim-ml commented Jun 2, 2017 via email

@sandosh143
Copy link
Author

I tried using this modified 2html.vim file but its not working. Getting this error while executing.

$ vim -d old_172.30.78.101 new_172.30.78.101 -c :TOhtml -c wqa
2 files to edit
"old_172.30.78.101.html" [New File]
Error detected while processing /home/test/.vim/plugin/2html.vim:
line 725:
E121: Undefined variable: g:loaded_2html_plugin
E116: Invalid arguments for function extend
Press ENTER or type command to continue

@sandosh143
Copy link
Author

I placed the file in $VIMRUNTIME/syntax/ directory. When i do a TOhtml its highlighting only the first occurance of difference. Its not highlighting the other occurances in the same line. Its just moving to the next line. Can you please help?

@kekec14
Copy link

kekec14 commented Apr 24, 2019

I am using vim8.1 from vim.org (self installing executable), with latest diffchar.vim plugin. Which 2html.vim i should use to export html in the same format as it is seen in vim.
Thank you!

@chrisbra
Copy link
Member

I suppose the 2html plugin does not notice that the diffchar.vim plugin was used and highlights the diff differently. I think it doesn't handle the matchadd() functionality yet.

Related 2html issue:
https://bitbucket.org/fritzophrenic/vim-tohtml/issues/9/suggestion-question-option-to-export-to

@kekec14
Copy link

kekec14 commented Apr 24, 2019

Is there any other option to get export of vim diff? It is not necessary to be html.

@chrisbra
Copy link
Member

What do you mean with export of vim diff? I think all you can do is share the patch file.

@kekec14
Copy link

kekec14 commented Apr 24, 2019

I am working on a script, which uses vim diff to compare two csv files. I want to get result of vim diff written in file, as for example:TOhtml. But with :TOhtml I can’t get the same output as it is seen directly in vim (with diffchar plugin). Now I am asking if there is any other option to get identical output as in vim directly.

What do you mean by sharing patch file?

Thank you!

@chrisbra
Copy link
Member

git diff --no-index plus e.g. using diff-highlight from git.
Please ask user questions on the vim_use mailinglist or use vi.stackexchange.com. This here is a bug tracker for problems with Vim. We cannot provide individual help here

@fritzophrenic
Copy link
Contributor

No new status on this, but the migrated issue tracker for adding matchadd() tohtml is here: https://sourceforge.net/p/vim-tohtml/issues/9/

That does seem like something I'll want to prioritize for new features after I get bugfixes completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants