Home Download Buy Blog Forum Support

Txt File Syntax and Format Problem

Txt File Syntax and Format Problem

Postby diek on Wed Sep 04, 2013 4:03 am

I am having an issue with the syntax/format for txt files, I am using Grandson Of Obsidian but even when I change it the problem remains. Grandson Of Obsidian is a dark theme, and when I open a text file it is grey, with dark grey font. In addition the text in the text file is about 1/3 from the border, there is no way to move it. It is almost like there is a forced margin.

Image


I have tried to figure this out myself but I cannot. I would appreciate any guidance.

Thank you.
diek
 
Posts: 13
Joined: Fri Jul 26, 2013 3:40 pm

Re: Txt File Syntax and Format Problem

Postby skuroda on Wed Sep 04, 2013 7:12 am

Don't know about the coloring issue, but ensure "draw_centered" is not set to true in your user preferences (it defaults to false). You could also just add "draw_centered": false to your user preferences.

After you open a file, if you go to Preferences -> Color Scheme, is Grandson of Obsidian selected?
skuroda
 
Posts: 676
Joined: Fri Oct 05, 2012 8:11 am

Re: Txt File Syntax and Format Problem

Postby diek on Wed Sep 04, 2013 8:52 pm

Hey,
The resident expert is back.
So the draw center is not in my user preferences. And the theme is the same after I open a file. Poking around in my preferences reminded me that I recently added a package for MarkDownEditor, and this seems to be a recent issue. I will do some testing to see if this is the issue. I appreciate the help.

derrick
diek
 
Posts: 13
Joined: Fri Jul 26, 2013 3:40 pm

Re: Txt File Syntax and Format Problem

Postby diek on Wed Sep 04, 2013 8:58 pm

That was exactly it, MarkDown Editor package! That said I want to use MarkDown Editor without it screwing with my .txt files. Why would it do that?
diek
 
Posts: 13
Joined: Fri Jul 26, 2013 3:40 pm

Re: Txt File Syntax and Format Problem

Postby skuroda on Wed Sep 04, 2013 9:40 pm

Can you post a link to that package? I can't find it on package control.
skuroda
 
Posts: 676
Joined: Fri Oct 05, 2012 8:11 am

Re: Txt File Syntax and Format Problem

Postby diek on Wed Sep 04, 2013 10:05 pm

I am pretty sure this is it:
https://github.com/ttscoff/MarkdownEditing
diek
 
Posts: 13
Joined: Fri Jul 26, 2013 3:40 pm

Re: Txt File Syntax and Format Problem

Postby diek on Wed Sep 04, 2013 10:25 pm

And of course the old classic, I reinstalled it and things are fine. Humm, my brain is so far gone with django I am not quite on my game of figuring stuff out.
diek
 
Posts: 13
Joined: Fri Jul 26, 2013 3:40 pm

Re: Txt File Syntax and Format Problem

Postby skuroda on Thu Sep 05, 2013 7:26 am

I took a quick look at some of the settings in that plugin. They do set change it (take a look at Markdown.sublime-settings). Anyways, setting in your user settings should override what they have. I'm not sure why they decided to roll their own coloring file, but that's besides the point. Anyways, glad things got fixed for you.
skuroda
 
Posts: 676
Joined: Fri Oct 05, 2012 8:11 am

Re: Txt File Syntax and Format Problem

Postby diek on Tue Sep 10, 2013 4:39 am

Josh Earl's SBT tips most recent e-mail answered it, I think:
"Sublime does a decent job of guessing what syntax highlighting to apply when you open a file, but it can't quite read your mind. (Although I'm thinking of submitting a UserEcho request for ST4 ... anybody with me?)

So it has no way of knowing that you want .txt files to always open with Markdown highlighting.

Fortunately, there's a simple fix: Sublime allows you to specify what syntax to use for a given file extension.

To force Sublime to open all .txt files with Markdown highlighting, open a file with a .txt extension, then click View | Syntax | Open all with current extension as ... | Markdown."
diek
 
Posts: 13
Joined: Fri Jul 26, 2013 3:40 pm

Re: Txt File Syntax and Format Problem

Postby skuroda on Tue Sep 10, 2013 5:09 am

Yup that works. Another possible solution is using a plugin like ApplySyntax. For a file extension, I believe this will give you the same behavior. The benefit of ApplySyntax is it gives you a bit more flexibility. For example, with the plugin, you can look for a particular mutlipart extension, such as *.spec.rb. You may also look at the the contents of the file and do some pattern matching. For what it's worth, I believe ST guessing is based on a list of extensions/patterns defined in the tmLanguage file.
skuroda
 
Posts: 676
Joined: Fri Oct 05, 2012 8:11 am


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 31 guests