Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change color does not work #31

Closed
cilia opened this issue Aug 15, 2015 · 8 comments
Closed

Change color does not work #31

cilia opened this issue Aug 15, 2015 · 8 comments

Comments

@cilia
Copy link

cilia commented Aug 15, 2015

'Change Color' is greyed out under the 'Notes' menu, and there is no 'Notes: change color' in the command palette.

Tried uninstalling and reinstalling PlainNotes but still does not work. Anywhere to check what the problem might be?

@fk128
Copy link
Collaborator

fk128 commented Aug 16, 2015

Are you saving your notes with a .note extension? Changing colour only works with that.

@cilia
Copy link
Author

cilia commented Aug 18, 2015

@fk128 yes, the files have .note extension.

Closing existing .note files in Sublime, then uninstalling and re-installing PlainNotes, and finally re-saving the .note files using 'Save as' seem to fix the problem. Strange.

@fk128
Copy link
Collaborator

fk128 commented Aug 18, 2015

Does this happen every time you create a new note?

@cilia
Copy link
Author

cilia commented Aug 18, 2015

No, this only happened once recently after I kept Sublime running for a long time and it crashed. After the crash, the coloring disappeared for both PlainNotes and PlainTasks.

@carlosprados
Copy link

carlosprados commented May 23, 2016

Same here with ST build 3114 on Ubuntu 14.04. I followed the instructions from cilia without luck.

@baringmo
Copy link

baringmo commented May 24, 2016

I'm a total newb on Sublime Text packages so I don't know the root cause of this issue, but it appears the syntax setting for the .note extension is changing to something notes.py doesn't expect.

In notes.py:NoteChangeColorCommand.is_enabled(), you can see that the 'Change Color' command will be enabled if the active window's syntax ends with "Note.tmLanguage". Running the following command in the console shows me that my syntax is set to 'Packages/PlainNotes/Note.sublime-syntax':
window.active_view().settings().get("syntax")

However, if I change the syntax setting to 'Packages/PlainNotes/Note.tmLanguage' then the 'Change Color' command returns:
window.active_view().settings().set("syntax", "Packages/PlainNotes/Note.tmLanguage")

This is at best a work-around, as the syntax setting goes back to 'Packages/PlainNotes/Note.sublime-syntax' when a new .note file is opened.

Perhaps notes.py:NoteChangeColorCommand.is_enabled() should be modified to enable the 'Change Color' command if the syntax setting ends with "Note.tmLanguage" OR "Note.sublime-syntax".

@carlosprados
Copy link

Hello @baringmo, I made the change and updated my local copy of the notes.py file with your suggestion of add window.active_view().settings().set("syntax", "Packages/PlainNotes/Note.sublime-syntax") in an or sentence and now it works.

I'll observe the behavior in order to see if there are any side effect.

Thank your for the tip!

@Sonnymiranda
Copy link

@carlosprados Hey, I´m using windows, where can I find the file notes.py?

@fk128 fk128 closed this as completed in ad1d73e May 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants