Commit Graph

387 Commits

Author SHA1 Message Date
Florian Bruhin
2a343cb3a1 Various code style improvements 2016-04-27 20:25:27 +02:00
Florian Bruhin
341dae0b3f Simplify deleting fragment 2016-04-25 19:05:20 +02:00
Florian Bruhin
d6c72c5821 Merge branch 'develop' of https://github.com/kanikaa1234/qutebrowser into kanikaa1234-develop 2016-04-25 19:03:20 +02:00
Florian Bruhin
6349c00c72 Fix crash with :tab-{prev,next,focus} with 0 tabs
When using :tab-prev/:tab-next (or :tab-focus which uses :tab-next
internally) immediately after the last tab, those functions could be
called with 0 tabs open, which caused a ZeroDivisionError when trying to
do % 0.

Fixes #1448.
2016-04-25 18:55:15 +02:00
kanikaa1234
22ad416f35 Addressing test 2016-04-24 19:33:31 +05:30
Florian Bruhin
ef91fa3821 Merge branch 'marks' of https://github.com/rcorre/qutebrowser into rcorre-marks 2016-04-21 20:05:41 +02:00
Florian Bruhin
e18b056877 Merge branch 'pretty_url' of https://github.com/forkbong/qutebrowser into forkbong-pretty_url 2016-04-20 22:15:54 +02:00
Panagiotis Ktistakis
1ef2f042cf Mention {url:pretty} in the docs 2016-04-20 19:39:18 +03:00
Panagiotis Ktistakis
6c3b0219e7 Style fix 2016-04-20 17:25:26 +03:00
kanikaa1234
fae005ab7f :navigate: command and test feature 2016-04-19 20:30:20 +05:30
Panagiotis Ktistakis
bd6783c7e6 Add --pretty flag to :yank
With --pretty, the URL is yanked in a "pretty form", with most
percent-encoded characters decoded. Partially fixes #1372.
2016-04-18 23:10:53 +03:00
Ryan Roden-Corrent
a924144d9a Set ' mark after searching.
Allow jumping back to the previous position after a search jumps you around.
2016-04-17 21:04:08 -04:00
Ryan Roden-Corrent
49b2f6e967 Move jump_mark logic to TabbedBrowser.
This simplifies the MarkKeyParser by removing its dependency on the
commandrunner. It also removes the need for a new exception type.
2016-04-17 21:04:08 -04:00
Ryan Roden-Corrent
e684cfa03f Trivial fixes for marks based on code review.
- Fix a docstring copy-paste
- Add own name/copyright date to new file
- Simplify a bdd expression (no need for regex)
- Scroll to a pixel position in a single operation
2016-04-17 21:04:08 -04:00
Ryan Roden-Corrent
540f4af225 Set the ' mark after following a link.
This moves mark storage from CommandDispatcher to TabbedBrowser, so it can also
be accessed by the HintManager.
2016-04-17 21:04:08 -04:00
Ryan Roden-Corrent
c7b830d69d Fix up mistakes caught by pylint. 2016-04-17 21:04:08 -04:00
Ryan Roden-Corrent
84eb30bc9a Marks are local to urls, not tabs.
Rather than binding each set of local marks to a tab, bind them to a
url. Strip the fragment from the url, as two pages that differ only in
fragment are likely the same page.
2016-04-17 21:04:08 -04:00
Ryan Roden-Corrent
9062f5925e Set the ' mark on a jump.
Automatically set the special "'" mark when jumping.
jump-mark "'" will jump to the last position before the previous jump.
A jump could be navigating via a link, jumping to another mark, or
scrolling by percentage (e.g. gg or G).
2016-04-17 21:04:08 -04:00
Ryan Roden-Corrent
ddcae14ba4 Implement set-mark and jump-mark.
set-mark <key> saves your current scroll position as mark <key>.
jump-mark <key> jumps to the position previously set for mark <key>.

If <key> is lowercase, it is local to the current tab. Each tab has its
own set of lowercase marks.

If <key> is uppercase, it is global across tabs, and stores a url and a
scroll position. Jumping to an uppercase mark navigates to that url,
then scrolls to the saved position.

Resolves #310.
2016-04-17 21:04:08 -04:00
Ryan Roden-Corrent
f5bb75a186 Fix docstring in scroll_px. 2016-04-17 21:04:08 -04:00
Johannes Martinsson
570d8b4abe Make tab-focus count from end with negative index
This makes it possible to jump to the very last tab, as opposed to the
last focused tab, by using -1 as the index. Generally negative indexes
are counted from the end.

Solves issue #1166
2016-04-09 03:40:36 +02:00
kanikaa1234
a2bcf80aae Fixed the tests 2016-04-08 20:51:07 +05:30
kanikaa1234
5c976d724b Fixes #1318 2016-04-08 19:40:45 +05:30
Florian Bruhin
c4878bb7ed Don't raise cmdexc.CommandError in :open
:open can be called via :edit-url async, so we need to use message.error
by hand there.
2016-04-06 06:46:42 +02:00
Florian Bruhin
776c4c4400 Ensure -t/-b/-w are exclusive in :edit-url
Otherwise those would be passed as-is to :open and an unhandled
cmdexc.CommandError would be raised there.
2016-04-06 06:44:50 +02:00
Florian Bruhin
9db697452d Remove self._editor in CommandDispatcher
This was needed before there was editor.ExternalEditor as there were
various commands which needed to access the editor object.

Since this is encapsulated in ExternalEditor now, no need to keep a
reference to the object around.
2016-04-05 18:48:58 +02:00
Florian Bruhin
6b3ee53064 Fix lint 2016-04-05 18:37:50 +02:00
Florian Bruhin
fc92137706 Handle count correctly for :edit-url 2016-04-05 18:37:03 +02:00
Ryan Roden-Corrent
e0d1e527d0 Fix up edit-url implementation.
Remove spaces around '=' for kwargs, don't set the _editor member.
2016-04-05 07:49:01 -04:00
Ryan Roden-Corrent
c8848a2641 Implement edit-url to craft a url with an editor.
The edit-url command opens a url (by default, the current url) in the
user's external editor and navigates to the result when the editor is
closed. This makes it easy to tweak the current url to navigate within
a site.

`edit-url` accepts the same flags as `open` (e.g. -t will open in a new
tab.

One may provide a url as an argument to create a shortcut to
pre-populate part of a url and allow filling in the rest.

There is no default keybinding.

Resolves #1261.
2016-04-04 20:47:42 -04:00
Jimmy
1c10a1aecf Adds new buffer command with completion.
`buffer` takes either a tab index or a string and focuses the specified
tab. The index can be of the form [0-9]+ which will switch to the
relevant tab in the current window or [0-9]+/[0-9]+ (that is
win_id/index) which will focus the specified window before switching
tabs. If a string is passed the list of open tabs across all windows is
sorted based on title and url (just like in the completion widget) and
the top result is selected.
2016-03-31 14:00:36 +13:00
Florian Bruhin
f2f0f429fb Update docs 2016-03-25 11:10:38 +01:00
Tarcisio Fedrizzi
8f593d948c Fixing flake8 error 2016-02-28 23:56:23 +01:00
Tarcisio Fedrizzi
25bc2dc1db Changes formatters to print multiline text on one line 2016-02-28 23:45:02 +01:00
Tarcisio Fedrizzi
0ab44c4f4a Reformats code as requested 2016-02-28 23:41:20 +01:00
Tarcisio Fedrizzi
702b235981 Fixes formatting to make pylint happy. 2016-02-27 11:54:23 +01:00
Tarcisio Fedrizzi
006d8760c4 Adds path checking to the multiline url heuristic 2016-02-27 11:54:23 +01:00
Tarcisio Fedrizzi
4aa7649c0a Implemented heurisitc on multiline paste 2016-02-27 11:54:23 +01:00
Florian Bruhin
79f83a033d Add a fake clipboard for tests
There are a lot of problems and flakiness with using a real clipboard.

Instead we now have a :debug-set-fake-clipboard command to set a text, and use
logging when getting the contents.

Fixes #1285.
2016-02-03 20:27:11 +01:00
Florian Bruhin
7fe818f9c8 Revert "Delay :yank notification until message was yanked."
This reverts commit b79049261e.
2016-02-03 19:19:13 +01:00
Florian Bruhin
14042403f6 Fix pasting of empty URLs. 2016-02-02 06:37:49 +01:00
Jakub Klinkovský
cc8e7007b4 Fixed docstring formatting error 2016-01-30 14:13:41 +01:00
Jakub Klinkovský
db6a0d53ca Addressed code-quality remarks 2016-01-27 10:04:24 +01:00
Jakub Klinkovský
35e16a8e6e paste-primary: fix undo/redo not working
It seems that unlike Gecko, WebKit does not support undo/redo operations
when the textarea's `value` attribute is changed directly. Fortunately
there is a WebKit-specific workaround using textInput event.

References:
* http://stackoverflow.com/a/7554295
* http://help.dottoro.com/ljuecqgv.php
2016-01-22 18:18:17 +01:00
Jakub Klinkovský
4d7e39470e Added paste-primary command
The Shift+Ins key should arguably insert primary selection, not the
clipboard selection as every Qt program does. This commit makes it
possible via the hidden paste-primary command (enabled by default).

Unfortunately QtWebKit does not provide any straightforward way to
insert text at cursor position into editable fields, so we work around
this by executing a JavaScript snippet - inspired by this SO answer:
http://stackoverflow.com/a/11077016
2016-01-21 22:30:43 +01:00
Florian Bruhin
0203bb3ed5 Add a :debug-clear-ssl-errors command. 2016-01-13 21:05:48 +01:00
Florian Bruhin
f61b9fd42c Update docs. 2016-01-13 18:20:44 +01:00
Tarcisio Fedrizzi
4bbc1e2d8a Changes line as suggested in review 2016-01-12 09:58:08 +01:00
Tarcisio Fedrizzi
1b31a3fee4 Allows to paste multiple URLs
- The paste command will now open one tab/window per url if multiple
  URLs (separated by newline) are present in the clipboard
- Adds the tests for the new multitab functionality
- Changes test/integration/conftest.py to be able to insert newlines in
  the clipboard for the test
2016-01-09 11:32:12 +01:00
Florian Bruhin
3f15186a64 Add some coverage pragmas for caret workarounds. 2016-01-06 17:52:44 +01:00