titoBouzout / WordCount

Real-time Word, Char, Line and Page counter, in the status-bar for the document, line or selection. Sublime Text
Other
291 stars 50 forks source link

Unexpected behaviour in page count #40

Closed mjklin closed 9 years ago

mjklin commented 9 years ago

Hi, thanks for adding the "current page" option! Unfortunately, I'm getting some unexpected behaviour now. Usually, the total page count will change depending on where I click in the document (from 19 to 25 to 21, for example). Hopefully this is an easy fix?

Thanks again!

titoBouzout commented 9 years ago

the page count is taken from the visible lines, the visible lines reduce at the end of the document, that will make the amount of pages vary, I know is not the better but well can you add a blank page at the end? or disable "scroll_pastend" in ST preferences... In any case, I would appreciate a test case. Thanks

On Thu, 22 Jan 2015 17:50 Mark notifications@github.com wrote:

Hi, thanks for adding the "current page" option! Unfortunately, I'm getting some unexpected behaviour now. Usually, the total page count will change depending on where I click in the document (from 19 to 25 to 21, for example). Hopefully this is an easy fix?

Thanks again!

— Reply to this email directly or view it on GitHub https://github.com/titoBouzout/WordCount/issues/40.

mjklin commented 9 years ago

Hmm, I tried both of your suggestions and neither one worked. Still getting changing numbers.

Can you not do a simple script that does (current line number / 300) / (total lines / 300) ?

titoBouzout commented 9 years ago

o.O

titoBouzout commented 9 years ago

okei done as you suggested

mjklin commented 9 years ago

o.O

this is the behaviour I get with "page_count_mode_count_words": false

http://i.imgur.com/UXLODD2.gif

I guess it's not as easy as I thought? Wish I was smart enough to figure it out...anyway I appreciate your work!

titoBouzout commented 9 years ago

Please, the number changes when you hit the bottom of the document? That's expected behaviour if you turn off "page_count_mode_count_words", because it takes the number of rows in a page from the visible lines, and that changes, if you hit the final of the document.

If you want to count words as pages, then turn it on. That does not alter page count.

Can you please add a testcase, a real one. I mean, something like:

  1. Paste this text: balabalabba
  2. Click line 4, "it should display" Page 1/4
  3. Click line 14, "it should display" Page 2/4 but instead ...

Thank you!

That you may ignore how to do a ST package does not mean you are not smart, just that you don't know, and its ok to not know some things :) hehe

titoBouzout commented 9 years ago

OKei, in lack of more information I'm closing

mjklin commented 9 years ago

I think I'm getting most of what I wanted from your addon, so I can't complain :)

Really all I wanted was to see approximately how far I was through the document, and your addon provides that even if the page count varies. Good enough!