Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add visited-links-display-limit variable defaulting to 2000.
To limit the number of elements added in visited-links-history command.
  • Loading branch information
Julien Pagès committed Oct 2, 2018
1 parent f3ee67a commit 8cb4a5a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -24,6 +24,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
instance name.
- Added **C-u C-u** prefix argument for command opening urls. Using it will open
the chosen url in a new window.
- Added the variable **visited-links-display-limit**, to limit the number of
elements displayed in the **visited-links-history** command. Defaults to 2000.

## [0.7] - 2018-09-20

Expand Down
11 changes: 11 additions & 0 deletions webmacs/visited_links.py
Expand Up @@ -15,6 +15,16 @@

import sqlite3
from datetime import datetime
from . import variables


visited_links_display_limit = variables.define_variable(
"visited-links-display-limit",
"Limit the number of history elements displayed in the"
" visited-links-history command.",
2000,
type=variables.Int(min=1)
)


class VisitedLinks(object):
Expand All @@ -35,6 +45,7 @@ def visit(self, url, title):
def visited_urls(self):
return [(row[0], row[1]) for row in self._conn.execute(
"select url, title from visitedlinks order by lastseen DESC"
" LIMIT %d" % visited_links_display_limit.value
)]

def remove(self, url):
Expand Down

0 comments on commit 8cb4a5a

Please sign in to comment.