summaryrefslogtreecommitdiff
path: root/src/util.h
AgeCommit message (Collapse)Author
2021-01-07Fix none registered webextension in ephemeral mode.Daniel Carl
Fixes #652
2020-10-13Move some file to $XDG_DATA_HOME #582.Daniel Carl
Do not store all files in XDG_CONFIG_HOME.
2020-01-04Remove expansion of '%' #584.Daniel Carl
The % is often used in urls and in case of the x-hint-command those are feed to :shellcmd and will be replaced by current URL. This made the x-hint-command unusable on some search engines. The expansion of % to the current URL also required to give the current browser state to the expansion logic and to feed it to all callers of this too. This bloated the code. This patch removes the % expansion which was a redundant alternative to $VIMB_URI.
2019-10-09Added :clearcache by :cleardata command.Daniel Carl
Allow to clear different types of website data base on the last update time.
2019-06-04Added ephemeral mode #562.Daniel Carl
If vimb is started with --ephemeral option no files are created by default and no persistent cookie manager is used.
2018-10-15Fixed wrong return type for util_file_set_content().Daniel Carl
2018-10-12Use stat(2) to retrieve the file permissions modeLeonardo Taccari
Remove the mode arguments from util_file_prepend_line(), util_file_pop_line() and util_file_set_content(). Both util_file_prepend_line() and util_file_pop_line() just calls util_file_set_content() so stat(2) can be used there and if it fails the 0600 is used as a fallback. Thanks to @fanglingsu for reviews and suggestions!
2018-10-11Replace g_file_set_contents().Daniel Carl
The g_file_set_contents performs atomic write to file by creating a temporary file, writing to it and renaming it. But during the creation of the temporary file, the mode is set hard to 0666. So our files will silently always change their mode in case we processed their content. This patch adds the util_file_set_content() function which follows the same approach, but allows to set the mode that is used to create the temporary file. So the file is created with the right permissions.
2018-10-10Add a mode (in chmod(2) context) argument to util_get_filepath()Leonardo Taccari
Add a mode argument to util_get_filepath() in order to adjust file permissions when creating file. Adjust all util_get_filepath() call and file permissions making them readable and writable only by the user.
2018-06-14Do not damage utf8 string on escape.Daniel Carl
This fixes #492.
2018-04-14Do not give client to util functions.Daniel Carl
Give only those information the util functions need to work.
2018-03-28Update license year.Daniel Carl
2017-11-15Move sanitize_uri to utils.Daniel Carl
This will allow us to used this in other parts too.
2017-10-01Reintroduce autocmd and augroups. Fix #356Yoann Blein
2017-05-26Update license year.Daniel Carl
2017-05-12implements external editor (closes #347)Robert Timm
2017-04-27Moved closed file writing to util #379.Daniel Carl
2017-04-22Add profile option #343.Daniel Carl
2017-04-20Show if directory can't be created.Daniel Carl
2017-04-20Added :save command.Daniel Carl
2017-04-12Use script message handler to track elements focus changes.Daniel Carl
Use script message handler instead of dbus to track for focused editable elements to switch vimb into input mode or back to normal mode.
2017-02-28Allow to manage bookmarks and queue.Daniel Carl
2016-06-01Update license year.Daniel Carl
2016-03-30Startup webkit2 branch from the scratch.Daniel Carl
2015-11-27Added closed-max-items optionYutao Yuan
2015-09-21Add :source commandYutao Yuan
2015-07-29Support for multiple configuration profiles (#129)Jiri Marsicek
New parameter is introduced to allow multiple configuration profiles per user. If vimb is started with this parameter new configuration directory is created under default configuration directory. Cache and socket file are kept separate per profile as well. If vimb is started without this parameter, behaviour is unchanged. Resolves fanglingsu/vimb#129
2015-02-07Allocate new memory for history items.Daniel Carl
This makes it easier to maintain the code and to avoid memory leaks.
2015-02-07Use hash table for duplicate check of history (#163).Daniel Carl
The previous duplication check where don on the generated list of history items with callback function which is really slow for large history files. Now the histories url is put into a hash table for a faster duplicate check. Additional to this some unneeded memory allocation where removed. This makes the code a little harder to maintain, but hey we don't want to wast time and memory here.
2015-01-01Change year in license block.Daniel Carl
2014-09-22Removed unused util_wildmatch function.Daniel Carl
This was only used to test the wildmatching, but the autocmd allow always to match against list of patterns.
2014-09-07Allow to match multiple patterns (#100).Daniel Carl
Change the matching functions to not end at the NUL of the pattern. In stead we give a pattern length parameter. This allows to process multiple patterns without the need to put NUL-bytes into it or to allocate memory for the parts to match.
2014-09-01Added utility function for wildcard matching.Daniel Carl
2014-07-31Removed unused param for util_str_replace.Daniel Carl
2014-07-31Implemented extended :set syntax.Daniel Carl
Added the new :set flavours :set option+=..., :set option-=..., set option^=... like in vim.
2014-06-04Allow to escape ~user expansion with \ char.Daniel Carl
2014-06-04Use already existing expansion logic also for ex commands.Daniel Carl
2014-05-26Added completion for :shortcut-remove.Daniel Carl
Simplified some of the completions to avoid duplicate code.
2014-03-11Don't expand string via shell.Daniel Carl
The shell expansion was done via shell to keep complexity away from vimb, but this allowed to run other shell commands too, what's a big security issue. To avoid problems, the ~/, ~user, $ENV and ${ENV} expansions are done in the c code o vimb.
2014-03-09Added shell expansion for download paths.Daniel Carl
2014-01-11Change year in license block.Daniel Carl
2013-08-05Added command queue-unshift.Daniel Carl
New command allows to push new uri to the beginning of read it later list.
2013-07-30Added queue commands :push and :pop.Daniel Carl
2013-07-29Another history processing improvement.Daniel Carl
Don't translate file lines into history or bookmarks structs, if we have enough unique items in the processed list (history max items). So it's not necessary to convert the lines and to remove them in a second step from the list.
2013-07-26Moved functions from util to history and bookmark.Daniel Carl
Some of the functions where only used one time, so they where moved to the place where they are used.
2013-07-14Save also page title in history file (#46).Daniel Carl
2013-06-18Fixed function name typo.Daniel Carl
Renamed util_buil_path to util_build_path.
2013-06-08Added command to download current page to given path (#32).Daniel Carl
2013-06-01Changed completion of history an bookmarks (#27).Daniel Carl
Now we distinct between history completion and bookmark completion. 1. Bookmark completion is triggered by ':open !<tab>' to complete all bookmarks or by ':open !tag1 tag2' to complete only those bookmarks that have tags with the prefixes tag1 and tag2. 2. History completion is changed to split the search query at the space char and to search for all given words in the history. Only those history items are completed, that match all given words or tags. 3. Search completion works now also tag based like the url and bookmark completions.
2013-04-28Allow multiple placeholder in shortcuts.Daniel Carl
The single previous %s placeholder for url shortcuts is now removed by placeholders $0-$9 that make vimb browser more usable and the shortcut system more flexible. The $0 placeholder will be removed by all query parameter. So the previous search engine feature can be build up with this new shortcut feature. For example use 'dl=https://duckduckgo.com/lite/?q=$0' to define a shortcut for the great duckduckgo search engine.