autoclose-html icon indicating copy to clipboard operation
autoclose-html copied to clipboard

Last update replaces ":" for ">"

Open HenryVonfire opened this issue 9 years ago • 39 comments

There seems to be an issue related to the last update that switch the colon ":" for the symbol less-than "<".

HenryVonfire avatar Feb 26 '16 13:02 HenryVonfire

Can you give a bit more context? Simply typing a ":" produces a ":" for me. I also tried tags like <a:test> and they did not convert ":" to "<"

mattberkowitz avatar Feb 26 '16 14:02 mattberkowitz

Atom 1.5.3 installed in Opensuse 3.16 Installed packages: ember-snippets 1.4.0 minimap 4.19.0

Today I saw that there was an updated for autoclose-html (it was in the previous version) and after updating it, typing ":" produced the "<" instead of ":".

I rebooted Atom to be sure that it wasn't the problem but it persisted. After uninstalling autoclose-html the problem disappeared. Installing it again makes the problem happens again.

HenryVonfire avatar Feb 26 '16 15:02 HenryVonfire

Do you use by chance use some other keyboard layout than http://www.cooltoyzph.com/image/US_Keyboard_layout.jpg? Perhaps that might have something to do with it.

Can you press ctrl/cmd + ., This should start the key binding resolver, which appears below the text editing area. When you press ":" what bindings resolve?

mattberkowitz avatar Feb 26 '16 15:02 mattberkowitz

QWERTZ keyboard but with a QWERTY configuration. It works without any problem in the rest of the applications.

It resolves this: Key Binding Resolver: > (It hasn't changed from "<" to ">", I wrote the issue by heart and wrote the wrong symbol but it is writing ">" instead of ":").

I don't know if I have to clarify this, but to get ":" it's needed to press SHIFT+:.

HenryVonfire avatar Feb 26 '16 16:02 HenryVonfire

Ok, found the problem:

In the settings there's an option enabled by default called Keybindings. It has associated the key ">" to the command autoclose-html:close-and-complete. By disabling it, the colon works again.

HenryVonfire avatar Feb 26 '16 16:02 HenryVonfire

I'll reach out to the atom team, seems like this is a bug deeper in the atom architecture than with this application in general. Thanks for reporting it, hopefully we'll be able to figure out a solution

mattberkowitz avatar Feb 26 '16 20:02 mattberkowitz

According to http://www.itwissen.info/bilder/qwertz-tastaturbelegung.png ":" is in the same place as ">" on a QWERTY. What do you use to remap keys? I imagine that will be important.

Also when you say it uses a QWERTY mapping, I assume that's only for the alpha keys (if : normally doesn't produce >)

mattberkowitz avatar Feb 26 '16 20:02 mattberkowitz

Hi, I'd like to contribute with a piece of information: same problem here with QWERTY keyboard and italian layout (I can confirm that : is in the same place where the > is on the US layout).

devsware avatar Feb 27 '16 10:02 devsware

I wonder is there any temp fix that we can use?

Editing CSON to 'atom-text-editor[data-grammar~="html"]':'shift->': 'autoclose-html:close-and-complete' doesn't seem to work atm.

Nikki1993 avatar Feb 27 '16 10:02 Nikki1993

It doesn't seem like there's a corresponding key, based on the link above. What does the keybinding resolver (cmd/ctrl + .) register when you do ">" on your keyboard

mattberkowitz avatar Feb 27 '16 14:02 mattberkowitz

On QWERTY keyboard with italian layout, the keybinding resolver registers the following

the > symbol if : is pressed the | symbol if > is pressed

devsware avatar Feb 27 '16 15:02 devsware

@devsware It seems the solution would be to bind "|" to "autoclose-html:close-and-complete", rather than ">". Does that work?

mattberkowitz avatar Feb 27 '16 23:02 mattberkowitz

Users in https://github.com/atom/atom-keymap/issues/35, which is apparently the blocking issue, have also suggested https://atom.io/packages/keyboard-localization to fix their problems, can anyone try that and report back?

mattberkowitz avatar Feb 27 '16 23:02 mattberkowitz

@mattberkowitz I tried it, didn't make a difference. Set locale to fi_FI and left autoclose on default settings, same thing.

It fixes the issue where instead of : atom outputs > but autoclose still doesn't work unless manually called from the search window.

Nikki1993 avatar Feb 28 '16 09:02 Nikki1993

Hi, I can confirm that after installing the keyboard-localization package the problem of the colon is fixed on the italian layout.

Now the keybinding resolver show : if the : is pressed, even though it changed the binding of > to ° instead of | and I had to map the shift-° to autoclose-html:close-and-complete in order to have the tag autoclosed when I press > on my keyboard.

Anyway, at this moment, it is still necessary to discover what Atom receive when > is pressed (with a kb layout other than US) in order to add the correct mapping.

devsware avatar Feb 28 '16 09:02 devsware

I also noticed an odd thing. In package settings it shows that tags are autoclosed when > is pressed, however in the search window a combination of shift + . is required

Not sure if it's relevant but here is the screenshot

autoclose

Nikki1993 avatar Feb 28 '16 09:02 Nikki1993

Just an addition: I noticed that keyboard-layout package does not autodetect the layout when it installs, so I changed the settings to it_IT and now the > key is bound to shift-> by Atom, as Nikki1993 noticed.

Even switching to it_IT layout on keyboard-layout package settings, I still need to have a binding from shift-> to autoclose-html:close-and-complete in order to have the tag closed when I press >

devsware avatar Feb 28 '16 09:02 devsware

Can't get my keybinding to work no matter what. It worked once for some reason with shift-> but refuses to work again after I closed the keymap.cson file (I saved it like 10 times :P)

Nikki1993 avatar Feb 28 '16 09:02 Nikki1993

Ok, weirdest bug found. If I open Keymap-Generator from Keyboard-localization package and put in Shift-> combo to type out > the autoclose WORKS o_O I still need to manually set autoclose keybinding to shift-> but it works when I simple test the mapping with Keymap-Generator in atom.

After I reload Atom or close the Keymap-generator I have to do the same thing again and leave the window open for autoclose to work otherwise it doesn't do anything.

Nikki1993 avatar Feb 28 '16 09:02 Nikki1993

Here is the keymap screenshot keymap

Nikki1993 avatar Feb 28 '16 10:02 Nikki1993

Can't input : colon @0.22.0 - Disabled this plugin for now, so I can type again.

fedu avatar Mar 01 '16 20:03 fedu

@HenryVonfire @devsware @Nikki1993 @fedu I just published a new version 0.23.0 which includes a new options "Legacy/International Mode" which should all you all to continue using the plugin until the issues in core are worked out (which might be a while)

Please let me know if this is an acceptable solution, for the time being, and if so I'll close this issue.


Also, here's the note I added to the README.md, just so you know what you're getting into:

Enables the old style of completion detection using buffer events rather than keybindings. Atom doesn't work well currently with non-US/non-QUERTY keyboards and will not correctly fire events when '>' is pressed and/or fire events for entirely different keys. Please note that this mode is buggy (ie can complete after undo) and may not be compatible with new features and bug fixes in future releases, post-0.22.0 If/when the core issues behind keybindings not reporting correctly on international keyboards is solved this option will be removed.

mattberkowitz avatar Mar 01 '16 22:03 mattberkowitz

Cheers. If it's no trouble, could you also update this issue when problem gets fixed upstream (if you happen to notice first)?

Nikki1993 avatar Mar 01 '16 22:03 Nikki1993

@Nikki1993 Yes, I'll keep an eye one it. If/when it seems like things are in a better place i'll reach out to the users on this issue to test it out, since I don't really have the means to test myself

mattberkowitz avatar Mar 01 '16 22:03 mattberkowitz

Hi, I tried the updated version of the plugin, and the behaviour is now the same as before.

What I've done:

  • updated the autoclose-html plugin to version 0.23.0
  • disabled the keyboard-localization plugin
  • removed from keybindings the entry from "shift->" to autoclose-html:close-and-complete
  • checked the new Legacy/International Mode

and I can confirm that everything on the italian layout is working again.

Thank you for adding this option!

devsware avatar Mar 02 '16 14:03 devsware

Still getting this with swedish keyboard layout on 0.23.0.

'atom-text-editor[data-grammar~="html"]':
    '>': 'autoclose-html:close-and-complete'

Disable keybindings for the plugin lets me use : again.

baelter avatar Mar 03 '16 16:03 baelter

@baelter Are you checking the "Legacy/International Mode" option in the settings? If you are the keybinding shouldn't fire per https://github.com/mattberkowitz/autoclose-html/blob/master/lib/autoclose-html.coffee#L22-L24

mattberkowitz avatar Mar 03 '16 21:03 mattberkowitz

@mattberkowitz Yeah that is also working. Feels like a shitty "solution" to have to opt out on new features just because I don't live in the land of the donald...

baelter avatar Mar 04 '16 08:03 baelter

@baelter Yes, I agree it's a shit solution, but at this point in time I don't see a better way given the poor handling atom does of keybindings with non-US/query keyboards currently.

My options are to either work with each individual user to figure out what keybinding works for them, or how to correctly set up another plugin like atom https://atom.io/packages/keyboard-localization. That's a task in itself, only made worse by the fact that I don't have the means to actually debug every situation myself so it becomes a very back and forth process. I simply don't have time and resources to support this.

The other option is the legacy mode, which checks completion based on what is actually added to the text buffer. This sidesteps the problem of keybindings, but lacks the robustness necessary for some of the other options I'd like to add (specifically, I can't do things like detect ctrl+> to preform some other action like forcing inline/block like #120 or inserting a comment for #106) and lacks the ability to differentiate between text added from typing and text added from paste/undo/etc

If you can think of another path forward, I'm happy to explore it, however at this point the best option seems to be to have an easy way to enable the functionality international users have come to expect and invest any effort into helping atom core get to the place it needs to be to enable the keybindings approach for all users

mattberkowitz avatar Mar 04 '16 15:03 mattberkowitz

I get that. Thanks for an otherwise nice plugin.

baelter avatar Mar 05 '16 09:03 baelter