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

Color code uppercase words #114

Open
aaxu opened this issue Nov 27, 2017 · 7 comments
Open

Color code uppercase words #114

aaxu opened this issue Nov 27, 2017 · 7 comments

Comments

@aaxu
Copy link
Contributor

aaxu commented Nov 27, 2017

Seems like a good feature, both for coding and note taking., since I use caps for some headers and terms.
Maybe a nice blue? Although I think I said before, but this could make the message line at the bottom of the screen ("Save changes? (yes, no, or cancel):") less noticeable when it appears. I don't think we've used green, brown, magenta, or yellow yet, so maybe one of these basic colors? We could also play around with maybe the background rather than the foreground color, though I don't think that would be very aesthetically pleasing. Maybe we could have a highlighting feature though or custom text colors that allow for overriding these defaults.

@dschuyler
Copy link
Collaborator

For note taking, maybe the 'text' grammar could be augmented? Here's what that looks like now.

    'text': {
      'indent': '  ',
      'special': [__sha_1,],
      'contains': ['quoted_string1', 'quoted_string2'],
    },

So quoted strings have color and so to sha1 sequences.

Maybe add a keywords line

      'keywords': ['[A-Z]{2,}',],

Or add to 'special'

      'special': [__sha_1,  '\b[A-Z]{2,}\b',],

(Don't put it in both keywords and special because one will take precedence anyway).

Keywords are a different color from a 'special'. Also, keywords automatically have \b added to the beginning and end. So if you'd like to get the caps in FOObar a 'special' (without \b) will be needed (because 'keywords' will only match whole words due to the \b at the beginning and end).

@aaxu
Copy link
Contributor Author

aaxu commented Nov 28, 2017

I personally would prefer the entire word being highlighted, as it might irk me if only half of it is highlighted as in FOObar. Also, what is the 'special' field and how is it different from the 'keywords' aside from the \b appending? Is the comment underneath 'grammar': up to date with this 'special' field?

@dschuyler
Copy link
Collaborator

dschuyler commented Nov 28, 2017

Is the comment underneath 'grammar': up to date with this 'special' field?

Nope! Fixed.

I also just added another highlighting set for 'error'. It's very similar to 'special' except that it draws the text in reverse, bold, red.

Mainly the differences between them are choosing whether you'd like them drawn in blue, or brown, or reverse-bold-red. (Other than keywords being whole-word matches).*

*of course, this may vary depending on what the color palette is set to.

@aaxu
Copy link
Contributor Author

aaxu commented Nov 28, 2017

Oh okay! Cool, I'll probably play around with this a bit more and note down some possible improvements as I try to finish some projects. Is there a way you can set the document (grammar) type, or is that automatically detected via the file name's extension?

@aaxu
Copy link
Contributor Author

aaxu commented Dec 8, 2017

Do we currently have something that displays the palette? If I remember correctly, it was set to be F4 before, but it wasn't working.

@dschuyler
Copy link
Collaborator

There is, but it's buggy so I often disable it.
Search for
#KEY_F4: self.changeToPaletteWindow,
in ci_edit/app/cu_editor.py and uncomment it.

@aaxu
Copy link
Contributor Author

aaxu commented Jan 11, 2018

This should be resolved via #138. Still don't know how to tell which file mode is active (.txt, .py, .c) and how to change it dynamically in the program (unless this isn't implemented yet)

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

2 participants