Enso cannot be used in non-standard apps

Bug #559372 reported by Drarok
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Enso Project
Fix Committed
Medium
blackdaemon

Bug Description

Applications such as Vim and putty do not accept a standard Ctrl-V, could Enso have a list of these non-standard apps and type out replacement text key-by-key instead?

Obviously Enso won't be able to get the current selection, but that's ok for me because I use Vim most of the time for my development, and have written a basic text expander for Enso. I mainly need to paste into it (for example, I have a command "expand throw" which will paste "throw new Exception('message');").

Related branches

Revision history for this message
blackdaemon (blackdaemon) wrote :

Is Shift+Insert working for you in these applications?
I have tried vim/gVim 7.1 and Putty on windows, Shift+Insert works for inserting the text.

I am just asking to clarify the best approach when implementing the 'fix'

Revision history for this message
Drarok (webmaster-drarok) wrote :

I'll have to give that a try tomorrow. Interesting that they'd implement those shortcuts...

Revision history for this message
blackdaemon (blackdaemon) wrote :

Shift+Insert is better than inserting the text letter-by-letter because it works also inside vim normal mode.
I admit that it maybe does not work by default as I am using already tweaked configuration.

Revision history for this message
blackdaemon (blackdaemon) wrote :

I have tried again, running gvim without vimrc and plugins:

gvim.exe -u NONE

and even in this bare default config, Ctrl-Insert works for copying in every mode and Shift-Insert works for pasting in every mode.

Please confirm as well on your system. I will then implement the workaround in Enso.

Revision history for this message
blackdaemon (blackdaemon) wrote :

OK, correct sequence for vim/gVim seems to be following:

Copy (without clearing the selection):

1. copy to windows clipboard (clears selection): Ctrl-Insert
2. exit to normal mode: Ctrl-[
3. do it second time, if selection was made inside insert/append mode using Shift-arrowkeys, first Ctrl-[ only clears selection: Ctrl-[
4. return to last selection: gv

Paste

1. Shift-Insert

Revision history for this message
Drarok (webmaster-drarok) wrote :

Hmm, I'm seeing slightly different gvim behaviour.

Ctrl-Insert and Shift-Insert work for copy and paste, which is great! But the selection is immediately cleared when I copy with ctrl-insert. Then I can do "gv" to re-select, and shift-insert replaces the selection with the clipboard contents.

There's no need to exit to normal mode or press escape on my machine. I used `gvim -u NONE`.

I've confirmed that pasting with Shift-Insert works on PuTTY as well. Its default behaviour is to set the clipboard contents as soon as the selection is made, so do we need to assume the current clipboard contents is the selection?

Revision history for this message
blackdaemon (blackdaemon) wrote :

Yes, there we have to expect the user doing the selection before, I found no way to detect if the text in clipboard comes from Putty or not.

Regarding the Ctrl+[: It depends on where you do the selection. If you do it inside insert/append mode, then we need to go
into normal mode first, before using 'gv'. And if you are already in normal mode, extra Ctrl+[ doesn't hurt.

Revision history for this message
Drarok (webmaster-drarok) wrote :

Ah, I see it now - I very rarely use the mouse for selections so couldn't figure out how to get a selection in insert mode.

An extra Ctrl-[ can't hurt, as you said (apart from a beep), so I'd agree that's a sensible solution. :)

Changed in enso:
importance: Undecided → Medium
status: New → In Progress
assignee: nobody → blackdaemon (blackdaemon)
Revision history for this message
Drarok (webmaster-drarok) wrote :

Hmm, I've merged this branch into my testing one, and spotted some strange behaviour. Problem is, it's not Enso's fault!

According to my test, pressing Shift-Insert to paste a replacement swallows the space before the word, but only when the replaced word is on the end of the line. Bizarre!
Demo video: http://www.drarok.com/files/Vim%20WTF.mp4

Revision history for this message
blackdaemon (blackdaemon) wrote :

This is indeed bizarre. I have the same problem.
But if running Vim normally, with vimrc and plugins, everything works correctly.
It seems to be something in Vim settings.

I don't think we can solve this with any other approach.

Changed in enso:
status: In Progress → Fix Committed
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.