danielmagnussons / orgmode

orgmode is for keeping notes, maintaining TODO lists, planning projects, and authoring documents with a fast and effective plain-text system.
MIT License
753 stars 70 forks source link

forces orgmode filetype by default on all opened files #33

Closed sammoth closed 10 years ago

sammoth commented 10 years ago

I'm not sure if this is a clash with another extension, but every file I open, regardless of the extension, is opened in orgmode syntax mode (a la bottom right of the sublime window).

danielmagnussons commented 10 years ago

What sublime version? what os?

What happens if you set correct syntax manually ( ctrl+shift then search for python or whatever syntax) on the problematic file?

I had some issues with orgmode syntax not being applied in some scenarios to org files, but nothing like this ;p

sammoth commented 10 years ago

Sublime 3 build 3059 on Windows 8.1. I don't have many settings changed or packages installed, it's a new sublime install.

It seems quite inconsistent but if I keep opening and closing different files, they often open incorrectly in orgmode syntax mode. If I click the syntax menu in the bottom right, the correct syntax mode has a check mark by it in the menu, instead of the orgmode entry. If I click the correct one again the syntax highlighting is set correctly and Sublime will seem to remember it at least for that file for a bit, but if I close all files, open and close an org file, and then open anything else again, it always seems to revert to orgmode syntax. Can't really find much more pattern to it!

danielmagnussons commented 10 years ago

Ah, I can reproduce.

  1. Close all files.
  2. Open .py file
  3. open .org file
  4. Check .py file. Its ormode syntax.

It should be some problem with the save code folding commit. Not tested proper =)

Removeing syntax specific code here https://github.com/danielmagnussons/orgmode/blob/master/orgmode_store.py#L138

And here: https://github.com/danielmagnussons/orgmode/blob/master/orgmode_store.py#L86

Solved the problem. Will push later tonight. Not sure why we save the syntax anyway ;p

Thanks alot for reporting the bug!

sammoth commented 10 years ago

Thanks Daniel for a quick fix, and no problem!

danielmagnussons commented 10 years ago

Should be fixed with https://github.com/danielmagnussons/orgmode/commit/d978f07050da9d631a91a8899b069a72e6c9da0c

Takes a while before package manager picks up new release, but will get there in the end