Add commands for column marks

qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

Alexey wrote:Added opt

//Ruler: start numeration from 1 (otherwise from 0)
"ruler_from_1": false,
Thank you! Is this in a downloadable beta, or wait for next version?
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

Yes: i released 1.14.5 yesterday at night
Pls download, tell about bugs.
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

Alexey wrote:Added opt

//Ruler: start numeration from 1 (otherwise from 0)
"ruler_from_1": false,
Alexey wrote:Yes: i released 1.14.5 yesterday at night
Pls download, tell about bugs.
Hi Alexey, thanks for working on this.

If you look at the ruler, you see that the hash marks have numbers every 10 columns (10, 20, 30, etc. when starting at 0, with the new option turned off), and the hash marks at 5, 15, 25, etc. are slightly longer (higher) than the others. That is good, and the way it should be. And the column marks and right margin align with the proper marks on the ruler (but not on the status bar.)

With the 1.14.5 "ruler_from_1" option set to "true", the only thing that changes is each one of the numbers on the ruler increases by 1, so 0 becomes 1, 10 becomes 11, 20 becomes 21, etc. There are still 10 hash marks between 1 and 11. Also, the column marks and right margin now align on the ruler at a number one larger than what the user sets: user sets columns 5, 10, 20, right margin 80, but on the ruler they align 6, 11, 21, 81.

What should happen is that the ruler starts at 1, and then there should be only four hash marks (instead of five) from the 1 to the 5, and then five hash marks from the 5 to the first numbered mark, which should read 10 instead of 11, and everything normal after that. And that way, the column marks and right margin will align with the proper numbers on the ruler.

In other words, take the original ruler, shift it left one column so that the "1" hash mark is on the left edge, and just cut off that "0" hash mark. Does that make sense? If done this way, everything will align, and the ruler numbers and status bar column numbers will correspond.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

>What should happen is that the ruler starts at 1, and then there should be only four hash marks
I may agree. but if you show me that some app makes like you tell. With screenshot. Im not sure that numbers better be 10/20/30 if ruler_from_1=true.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

Marking 1-10-20-30.. makes no sence, sorry. It is marks for 0-based columns 0-9-19-29-... , it makes no sence. it wont help with fixed margin. e.g. margin=80 wont paint near 0-based mark 79.
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

Okay, try this:
Move your cursor down the screen to, say, line 20 for example. Now move it all the way to the left. Look at your status bar: it says Column 1. It never says Column 0--because there is no Column 0! The first physical position is 1.

Code: Select all

0         5        10        15        20        80
| i i i i | i i i i | i i i i | i i i i | i ... i |


#
Col 1, Ln 20 (20)
Now turn on the option that shows a vertical line at the cursor column; follow that line up to the ruler: it says Column 0.

Code: Select all

0         5        10        15        20        80
| i i i i | i i i i | i i i i | i i i i | i ... i |
|
|
#
Col 1, Ln 20 (20)
That is because you, as a programmer (and me too! ;) ), like to think in terms of base-0. But people (you and me, when we are not programming :D ) think in terms of base-1.

Okay, set column marks at 5, 10, and 20, and right margin at 80, just for demonstration purposes. The column lines will align with the ruler at 5, 10, 20 and 80. Now move your cursor right so that the vertical cursor line aligns with each column line in turn; the status bar says 6, 11, 21 and 81. That is because you have written your algorithms in order to make the lines align with the ruler, rather than with the status bar.

Code: Select all

0         5        10        15        20        80
| i i i i | i i i i | i i i i | i i i i | i ... i |
|         |         |         |         |         |
|         |         |         |         |         |
|         #         |         |         |         |
Col 6, Ln 20 (20)
It is this (very confusing) discrepancy which we are trying to work around. This is the way I envision it:

Code: Select all

1       5        10        15        20        80
| i i i | i i i i | i i i i | i i i i | i ... i |
|       |         |         |         |         |
|       |         |         |         |         |
|       #         |         |         |         |
Col 5, Ln 20 (20)
But it seems that this option (and it should be an option, for those who like the current way) would require not only changing the ruler, but also changing the algorithms so the the column/margin marks align with the status bar (and would also align with the new ruler).

You may have other ideas. But do you now at least see what it is that I am trying to get at? :lol:
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

I was not right, now i see that your case is OK. Doing option for it...
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

"ruler_from_1" deleted;
added:

//Ruler: numeration style
// 0: numbers 0 - 10 - 20 - 30...
// 1: numbers 1 - 11 - 21 - 31...
// 2: numbers 1 - 10 - 20 - 30...
"ruler_numeration": 0,
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

Wow, that is excellent! Thank you. I know it will likely take some time to adjust all the algorithms (column marks, right margin, etc.), but let us know when release (or beta) is ready, and will be happy to test.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

Release 1.15 is done. Pls test. Other options not changed (margin, col marks plugin etc); IMO its ok as is.
Post Reply