Cursor position in placeholder when selection = exclusive

Bug #790103 reported by Charles Gunawan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
UltiSnips
Fix Released
Low
Unassigned

Bug Description

Hi,

When selection=exclusive (in windows gvim), cursor position when selecting a placeholder is at the left of the last character so it looks like the last character is not selected. Is there any way the cursor can be positioned after the last character

Example: ${1: 'word'} -> expand -> wor|d (where | = cursor position)

Revision history for this message
SirVer (sirver) wrote :

On my system, the cursor does select the last as well (as it would in visual mode, when I would use c to overwrite), so I cannot follow your complain. UltiSnip aims to mirror vims conventions. If you feel there is an error, could you please provide a screenshot, I cannot understand the ascii explanation you added.

Changed in ultisnips:
status: New → Incomplete
Revision history for this message
Charles Gunawan (peacech) wrote :

It's not a bug, more like a request for enhancement, if it is possible.

I attach a screenshot of my gvim. On the left is the test snippet, and on the right is how it looks like when the snippet is expanded. My &selection value is 'inclusive' as set by mswin.vim.

In windows the cursor is a thin line and not a block. When a character a selected, therefore there could be two possible place for the cursor, on the left or right of the selected character. If I select a word using visual mode, the thin line cursor is placed on the right, but when UltiSnips select a word, the cursor is placed on the left of the last character of the work, making the word looks like not completely selected, but the last character does get selected.

Revision history for this message
SirVer (sirver) wrote :

mmh.. I cannot reproduce this still. My selection mode is also inclusive, but my cursor is not a line in selection mode (it is a full block). Also under linux, windows. Could the line cursor come from another option?

Revision history for this message
Charles Gunawan (peacech) wrote :

Hi,

I'm really sorry, I typed it wrong. It should be exclusive (as set by 'behave mswin') and not inclusive. Sorry for the confusion.

summary: - Cursor position in placeholder when selection = inclusive
+ Cursor position in placeholder when selection = exclusive
description: updated
Revision history for this message
SirVer (sirver) wrote :

alright, I can reproduce this now. It is only a "visual glitch" though as the behaviour is as expected otherwise.

A simple solution would be to just hit the l button one more time while selecting tabstops when the option is set, would this seem like a proper solution to you?

Changed in ultisnips:
status: Incomplete → Confirmed
importance: Undecided → Low
Revision history for this message
Charles Gunawan (peacech) wrote :

Yes, it seems like a working solution.

It's not really a problem until the replacement is a single character where the result is that the selection becomes invisible. Not really a problem just a little confusing.

Revision history for this message
SirVer (sirver) wrote :

This will be critical in v2.0. I therefore have a fix in the 2.0 branch.

Changed in ultisnips:
status: Confirmed → In Progress
milestone: none → 2.0
Revision history for this message
SirVer (sirver) wrote :

Merged my 2.0 branch in r413. This is now fixed in trunk.

Changed in ultisnips:
status: In Progress → Triaged
status: Triaged → Fix Committed
Revision history for this message
SirVer (sirver) wrote :

Released in 2.0.

Changed in ultisnips:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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