Closed karan closed 9 years ago
Yep, same issue here. Works sporadically, more not than working.
Good it's not just me.
In situations where you expect it to work and it isn't, could you run the "Editor: Log Cursor Scope" command? It only works in situations the grammar identifies as quoted strings. That's my first thought as to what might be going wrong.
Nope. Still not working.
I forgot to mention, could you open the dev tools and paste the output of the "Log Cursor Scope" command in the location where toggle quotes isn't working?
["source.js","string.quoted.single.js", "punctuation.definition.string.end.js"]
Also FYI - my first thought was that something had higher selector precedence than toggle quotes. Unfortunately, it's the only thing that shows up in the keybinding resolver for the ctrl
-"
keybinding.
Weird. Do you have an example file you'd be comfortable sharing in a gist so I can try to reproduce this?
Also, just in case, any errors in your dev tools console?
yes errors, but none related to your plugin. And I emailed you the gist address.
@bbudd @karan, I can't reproduce this bug. If you are still running into this please reopen this issue :smile:!
I have to run the command twice for it to work.
It happens when you have selected text, I can get it to work correctly when you place the cursor in-between them.
Looking into this now. I'm having trouble reproducing the bad behavior. I'm able to toggle quotes with both an empty and non-empty selection. Can you help me with specific reproduction steps, and maybe a content snippet that exhibits the issue? Thanks!
Select the whole line including the quotes, that is how I can reproduce
On Fri, Sep 26, 2014 at 2:39 PM, Nathan Sobo notifications@github.com wrote:
Looking into this now. I'm having trouble reproducing the bad behavior. I'm able to toggle quotes with both an empty and non-empty selection. Can you help me with specific reproduction steps, and maybe a content snippet that exhibits the issue? Thanks!
[image: toggle-quotes] https://cloud.githubusercontent.com/assets/1789/4427942/9300b8a4-45c5-11e4-941e-8f901868c0ed.gif
— Reply to this email directly or view it on GitHub https://github.com/atom/toggle-quotes/issues/2#issuecomment-57024029.
I don't know if this is the same issue, but I can't get this plugin to work at all. I'm using Atom 0.140.0 on OS X.
I'm using a file like this:
# example.coffee
console.log "Hello, World"
Placing the cursor in the string and invoking the command does nothing, either via the command palette or keyboard shortcut.
Update: I uninstalled and re-installed the plugin and now it works fine.
It's kinda weird, but to me I changed this:
'atom-workspace':
'cmd-"': 'toggle-quotes:toggle'
by that:
'.workspace':
'cmd-"': 'toggle-quotes:toggle'
and now workds perfectly!
Unsure if related, but I have the following Puppet code:
exec { "Installing godep for managing Go dependencies":
command => "go get github.com/tools/godep",
environment => ["GOPATH=${workspace}"],
path => "/usr/bin",
creates => "${workspace}/bin/godep",
require => File['/usr/bin/go'],
}
The toggle seems to work with all the assignment lines (=>), but the exec line cannot be converted from double to single quotes. Weird.
Still not working... any clue ? Also tried to set another keymap but still not working! :'-(
I'm seeing this somewhat randomly throughout several files in Atom 0.204.0. Some examples that demonstrate the issue in a completely clean installation that only has the toggle-quotes plugin installed:
<!DOCTYPE html>
<html lang='en'> <!-- Works -->
<body class='text'></body> <!-- Fails -->
</html>
<?php
function f_name() {
if ($arry['asdf']) { // Fails
$var = "text"; // Works
}
}
?>
I'm pretty sure that this isn't toggle-quote's that is the problem here, but rather the Atom API calls that are at fault. When debugging the code for this plugin it seems that the calls to editor.getTextInBufferRange(range);
are returning only parts of the string instead of properly starting with the initial quote character.
With the HTML example no matter the cursor position the text is set to "text'>". Oddly enough when the cursor is between the ' and > Atom still thinks the cursor is within a string.quoted.single.html scope.
The PHP code snippet is similar, the lines that are failing seem to have their range offset by one.
It doesn't seem that the editor.displayBuffer.bufferRangeForScopeAtPosition()
hack is at fault here since even using the official (but incorrect for multiple cursors according to https://discuss.atom.io/t/multiple-cursor-issues/7369) editor.getTextInBufferRange(editor.bufferRangeForScopeAtCursor('string.quoted'))
returns the "off-by-one" text selection.
As I'm somewhat new to Atom I'm not exactly sure where in Atom this could be getting screwed up, but hopefully this information can point somebody in the right direction.
I'm having trouble reproducing this on master (which includes everything in 0.204.0). As you can see in this gif, I'm able to toggle quotes in the first example.
Interestingly it works on my work computer (Win7x64, Atom 0.204.0), but but is failing on my home computer (Win8.1x64, Atom 0.204.0) and a Win10 VM I installed a fresh copy of Atom on. All see if I can figure out what the differences are later today.
This seems to be a somewhat random issue, both of the above snippets work on both of my computers now :unamused:.
Currently at least the following snippet is showing the issue on both my work and home computers, as well as a completely blank profile (with just this plugin):
<?php
function get_hist($attr) {
$max = $bounds[0]['max_val'];
}
?>
I'm unable to reproduce this issue on any of my 3 installations of Atom as of 1.0.0. Is anyone else still seeing this issue?
:+1: I'm no longer seeing this issue on 1.0.0
Ok, I'm going to close this for now. If anyone can still reproduce this issue on 1.0.0+, please comment here!
I just installed this package and it's mostly not working on Atom 1.8.0 (OS X 10.11.5) with the latest toggle quotes. Ruby files it works but JavaScript, CSS, HTML, Handlebars etc... no dice.
Maybe I'm doing something wrong, but this doesn't seem to work for me.
Tried,
cmd+shift+'
,cntr+shift+'
and all combinations. On Mavericks.