Konfekt / vim-latexencode

convert UTF-8 characters to LaTeX commandos in Vim via pylatexenc
1 stars 1 forks source link

Whole document is converted when range is selected #1

Closed timtro closed 1 year ago

timtro commented 1 year ago

Thanks in advance.

Perhaps I'm using it wrong, or perhaps this is a neovim vs. vim issue (but I wouldn't think so).

Steps to reproduce

In my bib file I have, for example:

@inproceedings{Koubek1975,
  author = {Václav Koubek and Jan Reiterman},
  title = {Automata and categories---Input processes},
  booktitle = {Mathematical Foundations of Computer Science 1975},
  editor = {Be{\v{c}}v{\'a}{\v{r}}, J{\'i}{\v{r}}{\'i}},
  series = {Lecture notes in computer science},
  doi = {10.1007/3-540-07389-2_209},
  isbn = {978-3-540-37585-2},
  publisher = {Springer Berlin Heidelberg},
  pages = {280--286},
  day = 1,
  endday = 5,
  year = 1975,
  booksubtitle = {4th Symposium, {Mari{\'a}nsk{\'e} L{\'a}zn{\v{e}}}}
}

among many hundreds. In visual mode, (using vi}, or by going into visual mode v and moving the cursor) I visually select the the editor value and run

:'<,'>Latex2Text

and the whole bib file is converted, thereby destroying it.

Expected behaviour

The visually selected text, and only that text, is run through the conversion, and replaced by the result.

Question

Am I doing something wrong? If so, then I'm sorry to have wasted your time. If not, I will try to debug and issue a PR. VimScript is not a familiar language to me, but I don't see anything wrong with your code, so I'm confused.

Konfekt commented 1 year ago

Hello, the conversion functions generally changed the lines operated on. This was not necessary. Now, this plug-in does not achieve much more than :'<,'>!latex2text, but should work as expected.

timtro commented 1 year ago

Thanks. It works as described. I appreciate your time.

I'm going to open a new issue as a feature request.