Bug 1163518 - LaTeX-suite clobbers the "a" macro
Summary: LaTeX-suite clobbers the "a" macro
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: vim-latex
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Till Maas
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-12 22:21 UTC by Daniel Wagner
Modified: 2015-06-30 01:38 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-06-30 01:38:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Daniel Wagner 2014-11-12 22:21:33 UTC
Description of problem: When editing LaTeX files in vim, the "a" register can get clobbered at strange moments.

Version-Release number of selected component (if applicable):
vim-latex Release     : 12.20130116.788.git2ef9956.fc20

How reproducible: Every time.


Steps to Reproduce:
1. Create a new file with a few lines of text, e.g. what you would get from `10ifoo^[`.
2. Turn on latex-suite by calling `:set filetype=tex`.
3. Jump to the top of the file and record a macro that puts a table alignment character in the text and goes to the next line. `ggqaA&^[^Mq`
4. Run the macro. `@a`
5. Run the macro again. `@a`

Actual results:
An alignment character is inserted on the first three lines, and vim is in insert mode on the fourth line. (Or: the macro does the same thing both times.)

Expected results:
An alignment character is inserted on the first three lines, and vim is awaiting commands on the fourth line. (Or: the macro behaves differently on its first and second invocation.)

Additional info:
I have tracked this down to a problem in the imaps plugin installed at /usr/share/vim/vimfiles/plugin/imaps.vim. The low-level problem (and solution) are described on StackOverflow [1]. See below for a patch that fixes the problem for me.

(Apologies for reporting here instead of upstream; I couldn't find an upstream that appeared to have a file as recent as the one included in the Fedora repos.)

[1]: http://stackoverflow.com/q/26896399/791604

--- /usr/share/vim/vimfiles/plugin/imaps.vim	2013-08-04 01:19:33.000000000 -0700
+++ ./imaps.vim	2014-11-12 14:10:44.734117106 -0800
@@ -249,11 +249,11 @@
 				call IMAP_Debug('getting abbreviationRHS = ['.abbreviationRHS.']', 'imap')
 
 				if @a =~ "No abbreviation found" || abbreviationRHS == ""
-					let @a = _a
+					call setreg("a",_a,"c")
 					return a:char
 				endif
 
-				let @a = _a
+				call setreg("a",_a,"c")
 				let abbreviationRHS = escape(abbreviationRHS, '\<"')
 				exec 'let abbreviationRHS = "'.abbreviationRHS.'"'
 
@@ -562,7 +562,7 @@
 
 		silent! exe normcmd
 		" this is to restore the r register.
-		let @r = _r
+		call setreg("r",_r,"c")
 		" and finally, this is to restore the search history.
 		execute s:RemoveLastHistoryItem

Comment 1 Suchakra 2014-11-12 23:19:18 UTC
Thanks for the patch. I could not find any updated source upstream as well. I will initially include the patch (after testing it) in our package and try to contact upstream in the meantime and see if they are willing to update it (I doubt it as it seems to have ceased development quite sometime back)

Comment 2 Till Maas 2014-11-15 16:10:49 UTC
@Daniel: Thank you for your bug report and patch. I extended it to cover more of these cases and pushed it upstream. Where did you look for upstream? The upstream page is at http://vim-latex.sourceforge.net/ and there was a working link to the upstream git repository. For future patches, please attach the patch to the bug report, because the patch as you pasted it did not work (maybe it was the missing diff command line).

@Suchakra:
I will take care of this and prepare a new upstream release. I do not have much time to do upstream development for vim-latex, but I merge patches if I find the time.

Comment 3 Fedora Update System 2014-11-16 14:49:11 UTC
vim-latex-1.8.23-14.20141116.812.gitd0f31c9.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/vim-latex-1.8.23-14.20141116.812.gitd0f31c9.fc19

Comment 4 Fedora Update System 2014-11-16 14:49:18 UTC
vim-latex-1.8.23-14.20141116.812.gitd0f31c9.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/vim-latex-1.8.23-14.20141116.812.gitd0f31c9.fc20

Comment 5 Fedora Update System 2014-11-16 14:49:25 UTC
vim-latex-1.8.23-14.20141116.812.gitd0f31c9.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/vim-latex-1.8.23-14.20141116.812.gitd0f31c9.fc21

Comment 6 Fedora Update System 2014-11-17 06:32:37 UTC
Package vim-latex-1.8.23-14.20141116.812.gitd0f31c9.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing vim-latex-1.8.23-14.20141116.812.gitd0f31c9.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-15234/vim-latex-1.8.23-14.20141116.812.gitd0f31c9.fc21
then log in and leave karma (feedback).

Comment 7 Fedora End Of Life 2015-05-29 13:17:26 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Fedora End Of Life 2015-06-30 01:38:14 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.