Rename :scroll-perc to :scroll-to-perc

Closes #2819
This commit is contained in:
Florian Bruhin 2017-10-03 22:44:21 +02:00
parent d70bdb5552
commit feaccb3083
8 changed files with 67 additions and 66 deletions

View File

@ -42,6 +42,7 @@ Breaking changes
- The `--harfbuzz` and `--relaxed-config` commandline arguments got dropped.
- `:set` now doesn't support toggling/cycling values anymore, that functionality
got moved to `:config-cycle`.
- `:scroll-perc` got renamed to `:scroll-to-perc`.
Major changes
~~~~~~~~~~~~~

View File

@ -1135,8 +1135,8 @@ How many steps to zoom out.
|<<run-with-count,run-with-count>>|Run a command with the given count.
|<<scroll,scroll>>|Scroll the current tab in the given direction.
|<<scroll-page,scroll-page>>|Scroll the frame page-wise.
|<<scroll-perc,scroll-perc>>|Scroll to a specific percentage of the page.
|<<scroll-px,scroll-px>>|Scroll the current tab by 'count * dx/dy' pixels.
|<<scroll-to-perc,scroll-to-perc>>|Scroll to a specific percentage of the page.
|<<search-next,search-next>>|Continue the search to the ([count]th) next term.
|<<search-prev,search-prev>>|Continue the search to the ([count]th) previous term.
|<<set-mark,set-mark>>|Set a mark at the current scroll position in the current tab.
@ -1556,9 +1556,22 @@ Scroll the frame page-wise.
==== count
multiplier
[[scroll-perc]]
=== scroll-perc
Syntax: +:scroll-perc [*--horizontal*] ['perc']+
[[scroll-px]]
=== scroll-px
Syntax: +:scroll-px 'dx' 'dy'+
Scroll the current tab by 'count * dx/dy' pixels.
==== positional arguments
* +'dx'+: How much to scroll in x-direction.
* +'dy'+: How much to scroll in y-direction.
==== count
multiplier
[[scroll-to-perc]]
=== scroll-to-perc
Syntax: +:scroll-to-perc [*--horizontal*] ['perc']+
Scroll to a specific percentage of the page.
@ -1573,19 +1586,6 @@ The percentage can be given either as argument or as count. If no percentage is
==== count
Percentage to scroll.
[[scroll-px]]
=== scroll-px
Syntax: +:scroll-px 'dx' 'dy'+
Scroll the current tab by 'count * dx/dy' pixels.
==== positional arguments
* +'dx'+: How much to scroll in x-direction.
* +'dy'+: How much to scroll in y-direction.
==== count
multiplier
[[search-next]]
=== search-next
Continue the search to the ([count]th) next term.

View File

@ -507,7 +507,7 @@ Default:
* +pass:[B]+: +pass:[set-cmd-text -s :quickmark-load -t]+
* +pass:[D]+: +pass:[tab-close -o]+
* +pass:[F]+: +pass:[hint all tab]+
* +pass:[G]+: +pass:[scroll-perc]+
* +pass:[G]+: +pass:[scroll-to-perc]+
* +pass:[H]+: +pass:[back]+
* +pass:[J]+: +pass:[tab-next]+
* +pass:[K]+: +pass:[tab-prev]+
@ -542,7 +542,7 @@ Default:
* +pass:[gb]+: +pass:[set-cmd-text -s :bookmark-load]+
* +pass:[gd]+: +pass:[download]+
* +pass:[gf]+: +pass:[view-source]+
* +pass:[gg]+: +pass:[scroll-perc 0]+
* +pass:[gg]+: +pass:[scroll-to-perc 0]+
* +pass:[gl]+: +pass:[tab-move -]+
* +pass:[gm]+: +pass:[tab-move]+
* +pass:[go]+: +pass:[set-cmd-text :open {url:pretty}]+

View File

@ -688,7 +688,7 @@ class CommandDispatcher:
scope='window')
@cmdutils.argument('count', count=True)
@cmdutils.argument('horizontal', flag='x')
def scroll_perc(self, perc: float = None, horizontal=False, count=None):
def scroll_to_perc(self, perc: float = None, horizontal=False, count=None):
"""Scroll to a specific percentage of the page.
The percentage can be given either as argument or as count.

View File

@ -1991,8 +1991,8 @@ bindings.default:
l: scroll right
u: undo
<Ctrl-Shift-T>: undo
gg: scroll-perc 0
G: scroll-perc
gg: scroll-to-perc 0
G: scroll-to-perc
n: search-next
N: search-prev
i: enter-mode insert

View File

@ -21,7 +21,7 @@ Feature: Setting positional marks
Scenario: Jumping back after jumping to a particular percentage
When I run :scroll-px 10 20
And I wait until the scroll position changed to 10/20
And I run :scroll-perc 100
And I run :scroll-to-perc 100
And I wait until the scroll position changed
And I run :jump-mark "'"
And I wait until the scroll position changed to 10/20
@ -116,7 +116,7 @@ Feature: Setting positional marks
Scenario: Hovering a hint does not set the ' mark
When I run :scroll-px 30 20
And I wait until the scroll position changed to 30/20
And I run :scroll-perc 0
And I run :scroll-to-perc 0
And I wait until the scroll position changed
And I hint with args "links hover" and follow s
And I run :jump-mark "'"

View File

@ -77,7 +77,7 @@ Feature: Special qute:// pages
When I set ignore_case to never
And I open qute://settings
# scroll to the right - the table does not fit in the default screen
And I run :scroll-perc -x 100
And I run :scroll-to-perc -x 100
And I run :jseval document.getElementById('input-ignore_case').value = ''
And I run :click-element id input-ignore_case
And I wait for "Entering mode KeyMode.insert *" in the log
@ -91,7 +91,7 @@ Feature: Special qute:// pages
Scenario: Focusing input fields in qute://settings and entering invalid value
When I open qute://settings
# scroll to the right - the table does not fit in the default screen
And I run :scroll-perc -x 100
And I run :scroll-to-perc -x 100
And I run :jseval document.getElementById('input-ignore_case').value = ''
And I run :click-element id input-ignore_case
And I wait for "Entering mode KeyMode.insert *" in the log

View File

@ -156,86 +156,86 @@ Feature: Scrolling
And I run :scroll down
Then the page should not be scrolled
## :scroll-perc
## :scroll-to-perc
Scenario: Scrolling to bottom with :scroll-perc
When I run :scroll-perc 100
Scenario: Scrolling to bottom with :scroll-to-perc
When I run :scroll-to-perc 100
Then the page should be scrolled vertically
Scenario: Scrolling to bottom and to top with :scroll-perc
When I run :scroll-perc 100
Scenario: Scrolling to bottom and to top with :scroll-to-perc
When I run :scroll-to-perc 100
And I wait until the scroll position changed
And I run :scroll-perc 0
And I run :scroll-to-perc 0
And I wait until the scroll position changed to 0/0
Then the page should not be scrolled
Scenario: Scrolling to middle with :scroll-perc
When I run :scroll-perc 50
Scenario: Scrolling to middle with :scroll-to-perc
When I run :scroll-to-perc 50
Then the page should be scrolled vertically
Scenario: Scrolling to middle with :scroll-perc (float)
When I run :scroll-perc 50.5
Scenario: Scrolling to middle with :scroll-to-perc (float)
When I run :scroll-to-perc 50.5
Then the page should be scrolled vertically
Scenario: Scrolling to middle and to top with :scroll-perc
When I run :scroll-perc 50
Scenario: Scrolling to middle and to top with :scroll-to-perc
When I run :scroll-to-perc 50
And I wait until the scroll position changed
And I run :scroll-perc 0
And I run :scroll-to-perc 0
And I wait until the scroll position changed to 0/0
Then the page should not be scrolled
Scenario: Scrolling to right with :scroll-perc
When I run :scroll-perc --horizontal 100
Scenario: Scrolling to right with :scroll-to-perc
When I run :scroll-to-perc --horizontal 100
Then the page should be scrolled horizontally
Scenario: Scrolling to right and to left with :scroll-perc
When I run :scroll-perc --horizontal 100
Scenario: Scrolling to right and to left with :scroll-to-perc
When I run :scroll-to-perc --horizontal 100
And I wait until the scroll position changed
And I run :scroll-perc --horizontal 0
And I run :scroll-to-perc --horizontal 0
And I wait until the scroll position changed to 0/0
Then the page should not be scrolled
Scenario: Scrolling to middle (horizontally) with :scroll-perc
When I run :scroll-perc --horizontal 50
Scenario: Scrolling to middle (horizontally) with :scroll-to-perc
When I run :scroll-to-perc --horizontal 50
Then the page should be scrolled horizontally
Scenario: Scrolling to middle and to left with :scroll-perc
When I run :scroll-perc --horizontal 50
Scenario: Scrolling to middle and to left with :scroll-to-perc
When I run :scroll-to-perc --horizontal 50
And I wait until the scroll position changed
And I run :scroll-perc --horizontal 0
And I run :scroll-to-perc --horizontal 0
And I wait until the scroll position changed to 0/0
Then the page should not be scrolled
Scenario: :scroll-perc without argument
When I run :scroll-perc
Scenario: :scroll-to-perc without argument
When I run :scroll-to-perc
Then the page should be scrolled vertically
Scenario: :scroll-perc without argument and --horizontal
When I run :scroll-perc --horizontal
Scenario: :scroll-to-perc without argument and --horizontal
When I run :scroll-to-perc --horizontal
Then the page should be scrolled horizontally
Scenario: :scroll-perc with count
When I run :scroll-perc with count 50
Scenario: :scroll-to-perc with count
When I run :scroll-to-perc with count 50
Then the page should be scrolled vertically
@qtwebengine_skip: Causes memory leak...
Scenario: :scroll-perc with a very big value
When I run :scroll-perc 99999999999
Scenario: :scroll-to-perc with a very big value
When I run :scroll-to-perc 99999999999
Then no crash should happen
Scenario: :scroll-perc on a page without scrolling
Scenario: :scroll-to-perc on a page without scrolling
When I open data/hello.txt
And I run :scroll-perc 20
And I run :scroll-to-perc 20
Then the page should not be scrolled
Scenario: :scroll-perc with count and argument
When I run :scroll-perc 0 with count 50
Scenario: :scroll-to-perc with count and argument
When I run :scroll-to-perc 0 with count 50
Then the page should be scrolled vertically
# https://github.com/qutebrowser/qutebrowser/issues/1821
Scenario: :scroll-perc without doctype
Scenario: :scroll-to-perc without doctype
When I open data/scroll/no_doctype.html
And I run :scroll-perc 100
And I run :scroll-to-perc 100
Then the page should be scrolled vertically
## :scroll-page
@ -280,14 +280,14 @@ Feature: Scrolling
Then the page should not be scrolled
Scenario: :scroll-page with --bottom-navigate
When I run :scroll-perc 100
When I run :scroll-to-perc 100
And I wait until the scroll position changed
And I run :scroll-page --bottom-navigate next 0 1
Then data/hello2.txt should be loaded
Scenario: :scroll-page with --bottom-navigate and zoom
When I run :zoom 200
And I run :scroll-perc 100
And I run :scroll-to-perc 100
And I wait until the scroll position changed
And I run :scroll-page --bottom-navigate next 0 1
Then data/hello2.txt should be loaded
@ -317,7 +317,7 @@ Feature: Scrolling
Scenario: Relative scroll position with a position:absolute page
When I open data/scroll/position_absolute.html
And I run :scroll-perc 100
And I run :scroll-to-perc 100
And I wait until the scroll position changed
And I run :scroll-page --bottom-navigate next 0 1
Then data/hello2.txt should be loaded