Comments (4)
- annoying scroll speed
scroll speed is faster, when you are traveling longer distance. this is already the normal behavior of sublimity.
because scroll speed depends on environments, it is also configurable. the variable "sublimity-scroll-weight1" is especially important for very long buffers. please read README.org for more informations.
- inertial scroll
sublimity is not a scroll command. to implement such features, emacs-native commands "scroll-down" "scroll-up" are perhaps not enough. i have never tried, but you may find an inertial scroll package for Emacs as an demonstration of deffered.el.
http://www.emacswiki.org/emacs/InertialScrolling
i'm not planning to implement such feature in sublimity, at least for now.
thanks.
from sublimity.
scroll speed is faster, when you are traveling longer distance. this is already the normal behavior of sublimity.
because scroll speed depends on environments, it is also configurable. the variable "sublimity-scroll-weight1" is especially important for very long buffers. please read README.org for more informations.
I know it exists, but the whole problem is that the speed is not big enough for long distances. You can do it easily by comparing directly against Sublime. I have it open on the exact same text, my package list, which is 2600 lines long. If I go to the top of the buffer in Sublime Text, and press first PgDn, then C-End, both scrolls will take the same time. Scroll by a page is visibly much slower, whereas scroll to the end whisks past almost all of the buffer at a much greater speed, and even though it slows down at the end, it's still much faster than the max speed a scroll by page ever reaches. The end result is that while the distance covered is much different, their speeds are adjusted in a way that makes the time spent on it constant, and the second scroll is visibly much faster, as it should be.
That is not the case if you do the same in sublimity. The scroll by page is much faster than in Sublime Text (defeating the point of having smooth scroll in the first place), whereas scroll to end is much slower. And that's with sublimity-scroll-weight1
already reduced to 5, much lower than the initial 10. The algorithm simply doesn't do the right thing, because the scaling it uses should result in a constant time spent on a single scroll regardless of the distance, and that doesn't happen right now.
sublimity is not a scroll command. to implement such features, emacs-native commands "scroll-down" "scroll-up" are perhaps not enough. i have never tried, but you may find an inertial scroll package for Emacs as an demonstration of deffered.el.
Ah, well, that's a pity.
from sublimity.
thanks for the response. now i understand the problem.
here's another algorithm i'm trying, which is perhaps not perfect but in usable condition.
(defcustom sublimity-scroll-weight 8
"scroll is maybe divided into N small scrolls"
:group 'sublimity)
(defun sublimity-scroll--gen-speeds (amount)
(let (a lst)
(flet ((fix-list (lst &optional eax)
(if (null lst) nil
(let* ((rem (car lst))
(val (floor rem))
(rem (+ (- rem val) (or eax 0)))
(val (if (>= rem 1) (1+ val) val))
(rem (if (>= rem 1) (1- rem) rem)))
(cons val (fix-list (cdr lst) rem))))))
(cond ((integerp sublimity-scroll-weight)
(setq sublimity-scroll-weight (float sublimity-scroll-weight))
(sublimity-scroll--gen-speeds amount))
((< amount 0)
(mapcar '- (sublimity-scroll--gen-speeds (- amount))))
(t
;; x = a t (t+1) / 2 <=> a = 2 x / (t^2 + t)
(setq a (/ (* 2 amount)
(+ (expt (float sublimity-scroll-weight) 2)
sublimity-scroll-weight)))
(dotimes (n sublimity-scroll-weight)
(setq lst (cons (* a (1+ n)) lst)))
(remove-if 'zerop (sort (fix-list lst) '>)))))))
does it work ? it seems not very smooth but scroll ends in (almost) constant time.
from sublimity.
found a reasonable solution and updated sublimity-scroll.el.
thanks
from sublimity.
Related Issues (20)
- (sublimity-map-set-delay nil) hides cursor near right border HOT 1
- Question: Is it possible to have no overlays in the minimap? HOT 1
- Code to disable trackpad scroll? HOT 3
- Slow copy/paste from OSX native clipboard HOT 2
- [performance] show active region in mini map only when mouse-over
- Minimap changes formatting of modeline HOT 4
- Looks terrible in emacs --tty / -nw mode HOT 1
- Option to turn off overflow arrows
- Open minimap only when needed HOT 4
- Not all of sublimity-map is syntax-highlighted
- Disable sumbility mode also disable linum-mode. HOT 2
- auto-hscroll-mode disabled? HOT 1
- Incompatibility with eyebrowse
- Smooth scrolling doesn't consistently respect scroll boundaries
- Smooth scrolling animation goes by too fast
- Feature Request: Shift mini map to extreme right, even when there are multiple buffers
- Images intermittently disappear in image-mode HOT 1
- Does this work at all? HOT 3
- Avoid cursor jumping towards middle when it goes out of bound HOT 1
- Can't install on emacs 28 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sublimity.