morbac / xmltools

XML Tools plugin for Notepad++
GNU General Public License v3.0
259 stars 57 forks source link

Language Menu selection does not change. #130

Open boris-999 opened 2 years ago

boris-999 commented 2 years ago

Installed latest 3.1.1.10 XML Tools, into latests Notepad++ 8.1.9.3 and it prevents changing the language menu.. eg. i load a XML file, and try to switch to something else, it doesn't change off the XML language menu setting.

see https://github.com/notepad-plus-plus/notepad-plus-plus/issues/10939 for details of proving this issue is in the XML Tools plugin.

morbac commented 2 years ago

In the XMLTools menu, please uncheck "Set XML type automatically" This option force XML language when xml is recognized.

boris-999 commented 2 years ago

Seems like something that should occur when the file is opened, not break the ability to select another language. It's sounding like your saying any language that by chance has some XML, as trivial as it may be, will cause XML to be set and unresponsive to language changes. If my million likes of JS had a 20 character string in it that has some XML, teh document is XML?

morbac commented 2 years ago

Initially the automatic XML language switch was performed on document loading only. But some users requested that language change automatically when pasting xml code in a blank document or when typing xml from scratch. I'll look to add an option which permit to customize the behaviour of this feature.

Now just one precision. XMLTools set XML language when:

  1. option "Set XML type automatically" is set and
  2. if document content starts with "<?xml "

Therefore I'm surprised that XMLTools force XML language on javascript code containing some XML.

mike-loux-planview commented 2 years ago

I like the way the JSON viewer plugin handles it. It's not set automatically, but when you pretty-print, it gets set. And it would be nice to not need the <?xml tag, for when we're pasting things like SOAP envelopes (I know, I know...old stuff...).

PopeJareth commented 2 years ago

Auto setting language XML on pretty-print would be a fantastic enhancement!