andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 38 forks source link

80-character vertical line #96

Closed vi closed 11 years ago

vi commented 11 years ago

In old enki I can set it up to display a vertical line on (for example) 80's character position.

I don't see such setting in qutepart enki.

andreikop commented 11 years ago

Done

vi commented 11 years ago

It looks ugly:

80fail

It makes one code character poorly visible. I prefer the faint line like in old Enki:

80ok

andreikop commented 11 years ago

Please check master

vi commented 11 years ago

A little bit better, but still looks not OK:

80q

Need to move it a bit to left. It should not "strike out" the 80'th character. It should also probably be in background, not in foreground.

  1. How to make it present everywhere, not only when it is exceed?
  2. How to override the colour? Currently it looks too much like "Hey, you crossed the line! Fix your code!".
andreikop commented 11 years ago
  1. If line is shown everywhere, it
    • distracts your vision even if your code is properly formatted
    • disappears, if your window is narrower, than allowed length. I use 120 chars max length, and big font. Long lines are wrapped, and I don't see the edge in old Enki. But current variant works fine.
    • doesn't work, if font is not monospace

Except it, current variant is easier to implement. So, now will be as is.

  1. "Hey, ...!!!" is exactly what I wanted to say. But, if you would like - I added an option. Old Enki settings should be applied. You can change the color in the config.
vi commented 11 years ago

The setting now applied.

But still there are two problems:

  1. Line is drawn too right;
  2. Line is foreground, so "crosses out" characters:

80w

\3. I think the line (when not shown everywhere) should be longer:

80w

"Hey, ...!!!" is exactly what I wanted to say.

I don't want the line to seem like if it is telling me what to do. The purpose of this line is to:

  1. Make me notice when the line is too long (it does not mean I'm going to fix it immediately, just notice).
  2. Visually show how much space is remaining before 80'th char. Also estimate the line length without counting and without looking at "Line: %d Column: %d". This is why I also want the line that is show everywhere.

With your current implementation you can just draw the line at 80'th position, and if the line is less than 80 characters, then (if it is enabled in the configuration) virtaully fill in it with '0' or ' 's to calculate the position. With non-monospace font the line will be crooky, but serve it's purpose.

andreikop commented 11 years ago

Line was moved right, because it where intersecting with cursor. Now it is exactly on place of cursor and not drawn, if cursor is in the position.