LaTeXYZ icon indicating copy to clipboard operation
LaTeXYZ copied to clipboard

^ triggering odd response

Open aaltland opened this issue 6 years ago • 8 comments

Suppost I want to get \psi^a. When I type \psi + ^ + a, what I get instead is \psi{a}. The ^ followed by a yields an {a}. Is that intended? It really disrupts the work flow for me (I do not always write \psi^{a})

(Lovely package!)

aaltland avatar May 06 '18 12:05 aaltland

Are you sure it is caused by LaTeXYZ?

randy3k avatar May 06 '18 13:05 randy3k

I would think so. I have been using LatexTools for ages. This hevavior appeared for the first time right after I installed LaTeXYZ few days ago. a.

On May 6, 2018, at 3:09 PM, Randy Lai [email protected] wrote:

Are you sure it is caused by LaTeXYZ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/randy3k/LaTeXYZ/issues/15#issuecomment-386878356, or mute the thread https://github.com/notifications/unsubscribe-auth/AF2ezjzhNUqUuc-mAK3WfkYJHNFNiDPeks5tvvYbgaJpZM4T0AeO.

aaltland avatar May 06 '18 13:05 aaltland

Found the source of the problem. There was a conflicting keybinding in my LaTeXTools files. It must have interfered with some bindings in LaTeXYZ which after the installation of the latter caused the odd behavior. Apologies for the noise.

aaltland avatar May 06 '18 14:05 aaltland

Great.

randy3k avatar May 06 '18 14:05 randy3k

@aaltland can u say, what I need to do to resolve the same problem?

AntRay avatar Jan 04 '19 20:01 AntRay

Sorry to say, no. I forgot. I guess I just inspected occurrences of '^' in the LaTeXTools files, but really can't remember. If it helps, I can send you my keybinding files.

aaltland avatar Jan 05 '19 06:01 aaltland

@aaltland Ok, send it, please)

AntRay avatar Jan 05 '19 19:01 AntRay

I had the same issue. As far as I can tell, I have no conflicting keybindings. I fixed it by adding the following to my key bindings

{ "keys": ["^"], "command": "insert_snippet", "args": {"contents": "^"}, "context": [
            { "key": "selector", "operator": "equal", "operand": "text.tex.latex meta.environment.math" },
            { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
            { "key": "preceding_text", "operator": "regex_contains", "operand": "\\^$", "match_all": true }
        ]
    },

but I lost the ability to use the double ^^.

The culprit seems to be the following

{ "keys": ["^"], "command": "latexyz_insert_snippet", "args": {"contents": "{$0}", "create_fields": true}, "context":
    [
        { "key": "selector", "operator": "equal", "operand": "text.tex.latex meta.environment.math" },
        { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
        { "key": "preceding_text", "operator": "regex_contains", "operand": "\\^$", "match_all": true }
    ]
},

in the file support/Default.sublime-keymap. Is this working as intended?

haerski avatar Mar 27 '20 23:03 haerski