selections=old breaks UltiSnips

Bug #1132315 reported by reckoner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
UltiSnips
Confirmed
Low
Unassigned

Bug Description

This is for python 2.7 on windows 7. VIM version 7.3.

In a TeX file (using tex.snippets), the problem is that completing

b<tab>

yields

\begin{something}

\end{something}

as expected. But the initial cursor position is right on top of the closing brace on the \begin line. The problem with this is that
when you start typing, it does not fill out the fields properly. You have to move the cursor over one character and THEN begin typing to get the snippet to complete properly.

Any help appreciated!

Revision history for this message
reckoner (reckoner) wrote :
Download full text (3.7 KiB)

Here's the test.py output:

---
======================================================================
FAIL: runTest (test.ParseSnippets_MultiWord_UnmatchedContainer)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\vim\vimfiles\UltiSnips-2.2\test.py", line 239, in runTest
    def runTest(self): self.check_output()
  File "C:\vim\vimfiles\UltiSnips-2.2\test.py", line 237, in check_output
    self.assertEqual(self.output, wanted)
AssertionError: " --- some text before --- \n\n\tnv snip\t\n\n --- some text aft
er --- \nUltiSnips: Invalid multiword trigger: '!inv snip/' in test_file(2)" !=
" --- some text before --- \n\ninv snip\t\n\n --- some text after --- \nUltiSnip
s: Invalid multiword trigger: '!inv snip/' in test_file(2)"

======================================================================
FAIL: runTest (test.PythonCode_IndentNoetSwTs)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\vim\vimfiles\UltiSnips-2.2\test.py", line 239, in runTest
    def runTest(self): self.check_output()
  File "C:\vim\vimfiles\UltiSnips-2.2\test.py", line 237, in check_output
    self.assertEqual(self.output, wanted)
AssertionError: ' --- some text before --- \n\n hi\n i1\n i2\ni0\n i1
\n End\n\n --- some text after --- ' != ' --- some text before --- \n\n hi\n
   i1\n\t i2\ni0\n i1\n End\n\n --- some text after --- '

======================================================================
FAIL: runTest (test.PythonCode_MultiAppendShift)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\vim\vimfiles\UltiSnips-2.2\test.py", line 239, in runTest
    def runTest(self): self.check_output()
  File "C:\vim\vimfiles\UltiSnips-2.2\test.py", line 237, in check_output
    self.assertEqual(self.output, wanted)
AssertionError: ' --- some text before --- \n\n\n hi\n i1\n
 i1\n i2\ni0\n i3\n End\n\n --- som
e text after --- ' != ' --- some text before --- \n\n\n\thi\n\ti1\n\ti1\n\t\ti2\
ni0\n\t\t\ti3\n\tEnd\n\n --- some text after --- '

======================================================================
FAIL: runTest (test.PythonCode_MultiAppendShiftMethods)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\vim\vimfiles\UltiSnips-2.2\test.py", line 239, in runTest
    def runTest(self): self.check_output()
  File "C:\vim\vimfiles\UltiSnips-2.2\test.py", line 237, in check_output
    self.assertEqual(self.output, wanted)
AssertionError: ' --- some text before --- \n\n\n hi\n i1\n
 i1\n i2\ni0\n i3\n End\n\n --- som
e text after --- ' != ' --- some text before --- \n\n\n\thi\n\ti1\n\ti1\n\t\ti2\
ni0\n\t\t\ti3\n\tEnd\n\n --- some text after --- '

======================================================================
FAIL: runTest (test.PythonCode_ResetIndent)
----------------------------------------------------------------------
Traceback (most recent call last):
  File...

Read more...

Revision history for this message
SirVer (sirver) wrote :

I believe the test outputs are flakiness and no true errors (you can run individual tests by giving their name to test.py): ./test.py PythonCode_MultiAppendShiftMethods . Could you verify this?

Otherwise I cannot reproduce this bug. I guess there is some plugin or Vim setting intertwined with Ultisnips which trigger this error. Can you try reducing your config to a minimal reproducable case?

Changed in ultisnips:
status: New → Incomplete
Revision history for this message
reckoner (reckoner) wrote : Re: [Bug 1132315] Re: snippet's initial cursor position makes it fail

I'm not having any luck turning off plug-ins one at a time. Are there
suspicious VIM settings I should be looking at?

Thanks!

On 2/25/2013 12:59 AM, SirVer wrote:
> I believe the test outputs are flakiness and no true errors (you can run
> individual tests by giving their name to test.py): ./test.py
> PythonCode_MultiAppendShiftMethods . Could you verify this?
>
> Otherwise I cannot reproduce this bug. I guess there is some plugin or
> Vim setting intertwined with Ultisnips which trigger this error. Can you
> try reducing your config to a minimal reproducable case?
>
>
> ** Changed in: ultisnips
> Status: New => Incomplete
>

Revision history for this message
SirVer (sirver) wrote : Re: snippet's initial cursor position makes it fail

I do not know which option could be the cause of this, sorry. There is no other way than making your config more minimalistic to track this down, sorry.

Revision history for this message
reckoner (reckoner) wrote : Re: [Bug 1132315] Re: snippet's initial cursor position makes it fail

Here's who's to blame:

    set selection=old

It works otherwise!

Thanks!

On 2/27/2013 2:43 PM, SirVer wrote:
> I do not know which option could be the cause of this, sorry. There is
> no other way than making your config more minimalistic to track this
> down, sorry.
>

Revision history for this message
SirVer (sirver) wrote : Re: snippet's initial cursor position makes it fail

I remeber having to special case 'inclusive' in some places in the code base - i wasn't even aware of 'old'. Yes. this is the likely culprit - if you want to fix it yourself, try grepping for inclusive or exclusive in the code base, add a bunch of tests and special case this.

summary: - snippet's initial cursor position makes it fail
+ selections=old breaks UltiSnips
Changed in ultisnips:
status: Incomplete → Confirmed
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.