Code Monkey home page Code Monkey logo

Comments (12)

oaroldan avatar oaroldan commented on July 29, 2024 8

I found a workaround.

  • Go to: settings (mac:cmd+, Windows-Linux:Ctrl+,) > Open Config Folder (in the left panel)
  • open: packages/latextools/lib/snippet-manager.coffee

case 1: for the $-matcher, find and comment the code:

    if text =  te.getSelect edText()
      text = text.replace(/\\/g, "\\\\")
      range = te.getSelectedBufferRange()
      te.setSelectedBufferRange(range, '')
      @snippetService.insertSnippet("\$#{text}\$")
      return

replace it by:

    range = te.getSelectedBufferRange()
    text = te.getTextInBufferRange(range)
    text = text.replace(/\\/g, "\\\\")
    if text
      @snippetService.insertSnippet("\$#{text}\$")
      return

case 2: for the ' and "-matcher, find and comment the code:

    if text =  te.getSelectedText()
      text = text.replace(/\\/g, "\\\\")
      range = te.getSelectedBufferRange()
      te.setSelectedBufferRange(range, '')
      # Use snippet to leave selection on (same as ST)
      @snippetService.insertSnippet("#{left}${1:#{text}}#{right}")
      return

replace it by:

    range = te.getSelectedBufferRange()
    text = te.getTextInBufferRange(range)
    text = text.replace(/\\/g, "\\\\")
    if text
      @snippetService.insertSnippet("#{left}${1:#{text}}#{right}")
      return

Caveats

any update of the latextools package will delete your editings

from atom-latextools.

sheljohn avatar sheljohn commented on July 29, 2024 7

+1: Similar thing (quotes) started happening to me on OSX Sierra (10.12.6) using Atom 1.23.1 x86 with LatexTools 0.8.5.

Steps to reproduce:

  • Save document as tex file
  • Type text, select word(s), and type "
  • Error is triggered, linking to this issue.

Happy to provide more details if needed (eg package-list, console log, etc).

from atom-latextools.

nicola-gigante avatar nicola-gigante commented on July 29, 2024

To me it also happens where doing CMD+L+E to start an environment.

from atom-latextools.

gmendesb avatar gmendesb commented on July 29, 2024

Same here. Not sure how to fix that

from atom-latextools.

contefranz avatar contefranz commented on July 29, 2024

I can confirm that the bug is still there. I am using Atom 1.23.3 on High Sierra 10.13.3. It affects the dollars $, as well as single quote ', double quote ", two single quotes '' and the backtick `. It is getting frustrating now...any ideas on how to fix it?

from atom-latextools.

nicola-gigante avatar nicola-gigante commented on July 29, 2024

This bug is nearly a showstopper for the plugin and has been open for months. It's getting embarrassing on top of frustrating...

from atom-latextools.

af-ayala avatar af-ayala commented on July 29, 2024

It is the same for Atom 1.24.0, I've tried reinstalling, however the problem is still there.. and it's been there since late 2017... really frustrating..

from atom-latextools.

findlayjy avatar findlayjy commented on July 29, 2024

Still here in April, with Atom 1.25.0. Really frustrating!

from atom-latextools.

nicola-gigante avatar nicola-gigante commented on July 29, 2024

Still here in May, with Atom 1.26. Is this plugin maintained at all? If authors do not care about fixing embarrassing bugs they could just flag the package as unmaintained or deprecated so we can move on.

from atom-latextools.

findlayjy avatar findlayjy commented on July 29, 2024

What a hero! This is working for me, but I had issues with indenting to start with, so make sure it all matches up if you're having trouble.

Thank you, oaroldan! <3

from atom-latextools.

oaroldan avatar oaroldan commented on July 29, 2024

@findlayjy Nice to know that it helped you! Thanks for let me know about the indenting issue (I updated my post to include this)

from atom-latextools.

contefranz avatar contefranz commented on July 29, 2024

@oaroldan Thank you so much! It worked for me too!
Shall we close the issue or leave it open hoping that someone fix this thing once and for all?

from atom-latextools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.