aboutsummaryrefslogtreecommitdiffstats
path: root/config/config.go
Commit message (Collapse)AuthorAgeFilesLines
* config: move [ui] parsing in separate fileRobin Jarry2022-11-161-316/+5
| | | | | | | | | | | | | | | | | | | | | The config.go file is getting too big. Move the aerc.conf [ui] section parsing logic into a dedicated ui.go file. Add a defaultUiConfig() function to also get the default configuration values in a separate file. Extract fragmented bits of code in AercConfig.parseConfig() in a new AercConfig.parseUi() function defined in ui.go. Change parseUiConfig() into a UIConfig.parse() method. Change some methods receiver args to pointers to avoid unnecessary copies. No functional change. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: move binds.conf parsing in binds.goRobin Jarry2022-11-161-191/+2
| | | | | | | | | | The config.go file is getting too big. Move all binds.conf parsing logic into binds.go where it belongs. No functional change. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: move accounts.conf parsing in separate fileRobin Jarry2022-11-161-250/+1
| | | | | | | | | | The config.go file is getting too big. Move accounts.conf parsing logic into a dedicated accounts.go file. No functional change. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: remove unused Ini fieldRobin Jarry2022-11-161-3/+0
| | | | | | | There is no point in keeping an open reference to the ini file. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* reply: allow to override localized Re regexp in configurationjp392022-11-131-0/+10
| | | | | | | | | | | | | | | My corporate email server annoyingly adds an "[External] " prefix when delivering emails from outside my organization. I'd like to be able to automatically strip it from the subject line when replying to external emails. With this patch, I can achieve it by setting this line in my account configuration: subject-re-pattern = ^(\[External\] : )?((?i)((AW|RE|SV|VS|ODP|R): ?)+) Signed-off-by: jp39 <jp39@gmx.com> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* threadbuilder: sort siblings by sort criteriaKoni Marti2022-11-061-0/+1
| | | | | | | | | | | | | | Sort the client-side thread siblings according to the sort criteria. Activate this option by setting "sort-thread-siblings" to true in the ui section of aerc.conf. "sort-thread-siblings" is false by default and the siblings will be sorted based on their uid number. Note that this options will only work with client-side threading and when the backend supports sorting. Also, it comes with a slight performance penalty. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* auto-completion: add option to require a min number of charsRobin Jarry2022-11-061-0/+2
| | | | | | | | | | When doing address completion via commands that take a while to run, having the completion trigger even with a single character can be non-optimal. Add an option to allow requiring a minimum number of characters to actually run the completion command. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* threads: reverse thread orderingKoni Marti2022-10-271-1/+2
| | | | | | | | | | | Add reverse-thread-order option to the ui config to enable reverse display of the mesage threads. Default order is the the intial message is on the top with all the replies being displayed below. The reverse options will put the initial message at the bottom with the replies on top. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* store: reverse message list order with iteratorsKoni Marti2022-10-271-0/+2
| | | | | | | | | | | | | | | | | Reverse the order of the messages in the message list. The complexity of reversing the order is abstracted away by the iterators. To reverse the message list, add the following to your aerc.conf: [ui] reverse-msglist-order=true Thanks to |cos| for sharing his initial implementation of reversing the order in the message list [0]. [0]: https://git.netizen.se/aerc/commit/?h=topic/asc_sort_imap Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* msgview: add separate date formattingBence Ferdinandy2022-10-191-38/+55
| | | | | | | | | | The ThisDayTimeFormat and friends are missing from the message view which just uses the message list's default setting. This might not be desirable since the amount of space available is different. Introduce separate settings for formatting dates in the message view. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* compose: warn before sending without attachmentJason Cox2022-10-171-4/+17
| | | | | | | | | | Prevent the embarrassing forgotten attachment scenario by warning the user before sending a message that may need an attachment but does not have one. Whether a message needs an attachment is determined by testing a configurable regex against the message body. Signed-off-by: Jason Cox <dev@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* filters: append well known dirs to exec PATHRobin Jarry2022-10-161-3/+3
| | | | | | | | | | | | | | | | | | | To allow referencing built-in filters without hard coding a path during installation, append the following folders to the exec PATH when running the filter commands: ~/.config/aerc/filters ~/.local/share/aerc/filters $PREFIX/share/aerc/filters /usr/share/aerc/filters If a filter script has the same name than a command in the default exec PATH, it will not shadow it. In that edge case, the absolute path to the filter script must be specified. Suggested-by: Teo Luppi <me@luppi.uk> Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* viewer: option to not mark message as seenKoni Marti2022-10-041-0/+2
| | | | | | | | | | | | | | | | | Add option to open a message in the message viewer without setting the seen flag. Enables the message viewer to be used as a preview pane without changing the message flags unintentionally. Before, the message viewer would set the seen flag by default. The IMAP backend will now always fetch the message body with the peek option enabled (same as we fetch the headers). An "auto-mark-read" option is added to the ui config which is set to true by default. If set the false, the seen flag is not set by the message viewer. Co-authored-by: "James Cook" <falsifian@falsifian.org> Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* open: allow overriding default programRobin Jarry2022-10-011-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | Instead of xdg-open (or open on MacOS), allow forcing a program to open a message part. The program is determined in that order of priority: 1) If :open has arguments, they will be used as command to open the attachment. If the arguments contain the {} placeholder, the temporary file will be substituted, otherwise the file path is added at the end of the arguments. 2) If a command is specified in the [openers] section of aerc.conf for the part MIME type, then it is used with the same rules of {} substitution. 3) Finally, fallback to xdg-open/open with the file path as argument. Update the docs and default config accordingly with examples. Fixes: https://todo.sr.ht/~rjarry/aerc/64 Co-authored-by: Jason Stewart <support@eggplantsd.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: remove default values for this-*-time-formatRobin Jarry2022-09-251-3/+3
| | | | | | | | | | | | | | | Having a default value is confusing because to disable the dynamic time format, the users need to explicitly configure these settings to the empty string. Do not set default values for these settings when they are unset in the configuration. Comment the default config file values to serve as examples. Fixes: aae29324fdf5 ("config: fix default time format values") Reported-by: Nicolai Dagestad <nicolai@dagestad.fr> Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: add option to hide timezone in sent emailsMoritz Poldrack2022-09-141-0/+1
| | | | | | | | | | | | Some people are worried that they might leak their timezone and wish to send their mails with the Date header in UTC. For this a new key is added to the account sections to enforce sending in UTC instead of the system's timezone. Suggested-by: "Ricardo Correia" <aerc-lists.sr.ht@wizy.org> Thanks: to Ricardo for checking and correcting my incorrect assertions Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* config: keep cache of resolved credential commandsRobin Jarry2022-09-101-11/+25
| | | | | | | | | | | | | | | | | | outgoing-cred-cmd is used to retrieve the password from a password manager such as UNIX pass or bitwarden CLI. These tools often prompt for a passphrase to secure the passwords and it is annoying having to enter it every time sending an email with aerc. Add a new option outgoing-cred-cmd-cache (default to true) to control whether aerc will keep a cache of the password or run outgoing-cred-cmd every time an email needs to be sent. NB: If the cached password is incorrect, the only way to change it is to restart aerc. Fixes: ca9034385029 ("outgoing-cred-cmd: delay execution until an email needs to be sent") Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* main: change account order sortTobias Wölfel2022-09-101-1/+1
| | | | | | | Sort the accounts based on case insensitive names. Signed-off-by: Tobias Wölfel <tobias.woelfel@mailbox.org> Acked-by: Robin Jarry <robin@jarry.cc>
* config: move ui config parse in functionRobin Jarry2022-09-081-42/+38
| | | | | | | | | | Avoid repetition. Also, commit de24d2d5909a ("config: fix setting of zero-value time.Duration config values") did not apply to contextual ui config sections. Fix that. Fixes: de24d2d5909a ("config: fix setting of zero-value time.Duration config values") Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* config: fix default time format valuesRobin Jarry2022-09-081-4/+4
| | | | | | | | Adjust default values in config.go to follow what is set in the default aerc.conf file. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* main: add cli flag to load specified account(s)Tim Culverhouse2022-08-221-3/+25
| | | | | | | | | | Make it possible to specify which account(s) to load. Preserve listed order when creating account tabs. aerc -a <account-name[,account-name]> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* dirtree: add dirtree-collapse config settingSijmen2022-08-221-0/+1
| | | | | | | | | | | | | Adds a setting to the configuration to choose at which level the folders in the dirtree are collapsed by default. In my case, this is useful because my organisation has some rather deep nesting in the folder structure, and a _lot_ of folders, and this way I can keep my dirtree uncluttered while still having all folders there if I need them. Signed-off-by: Sijmen <me@sijman.nl> Acked-by: Koni Marti <koni.marti@gmail.com>
* go: removed io/ioutilMoritz Poldrack2022-08-221-3/+2
| | | | | | | | | | Since the minimum required version of Go has been bumped to 1.16, the deprecation of io/ioutil can now be acted upon. This Commit removes the remaining dependencies on ioutil and replaces them with their io or os counterparts. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: work nicely with wrapped errors (errorlint)Moritz Poldrack2022-08-041-4/+4
| | | | | | | | Error wrapping as introduced in Go 1.13 adds some additional logic to use for comparing errors and adding information to it. Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: homogenize operations and minor fixes (gocritic)Moritz Poldrack2022-08-041-31/+34
| | | | | | | | | | | | | | | | | | Apply GoDoc comment policy (comments for humans should have a space after the //; machine-readable comments shouldn't) Use strings.ReplaceAll instead of strings.Replace when appropriate Remove if/else chains by replacing them with switches Use short assignment/increment notation Replace single case switches with if statements Combine else and if when appropriate Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: ensure errors are at least logged (errcheck)Moritz Poldrack2022-08-041-1/+4
| | | | | Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: fix ineffective assignments (SA4005)Moritz Poldrack2022-08-041-1/+0
| | | | | Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: apply new formatting rulesMoritz Poldrack2022-08-011-15/+14
| | | | | | | Run `make fmt`. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* outgoing-cred-cmd: delay execution until an email needs to be sentStas Rudakou2022-07-311-42/+53
| | | | | | | | | | | | | | | | | | This can be useful in cases when: 1. outgoing-cred-cmd requires a user action or confirmation (e.g. when using pass with a Yubikey or similar smart card that requires a user to enter a pin or touch the device when decrypting the password) 2. A user starts aerc frequently, but not all the sessions end up with sending emails 3. So the user only wants to execute outgoing-cred-cmd when the password is really used, so the user doesn't have to enter pin or touch their Yubikey each time aerc starts Signed-off-by: Stas Rudakou <stas@garage22.net> Acked-by: Robin Jarry <robin@jarry.cc>
* threads: debounce client-side thread buildingKoni Marti2022-07-261-0/+2
| | | | | | | | | | | | | | | | Debounce client-side thread building in the message store. Debouncing is useful when multiple messages are loaded, i.e. when scrolling with PgUp/PgDown. Without the debouncing, all client-side threads will be built everytime the message store is updated which creates a noticable lag in the message list ui when client-side threading is activated. The default debouncing delay can be changed by changing 'client-threads-delay' in the UI config section. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* logging: print init procedure and config contentsRobin Jarry2022-07-231-5/+25
| | | | | | | This may help debugging issues. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* logging: use level-based logger functionsRobin Jarry2022-07-231-4/+5
| | | | | | | | | | | | Do not pass logger objects around anymore. Shuffle some messages to make them consistent with the new logging API. Avoid using %v when a more specific verb exists for the argument types. The loggers are completely disabled (i.e. Sprintf is not even called) by default. They are only enabled when redirecting stdout to a file. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* config: allow per-account address-book-cmdRobin Jarry2022-07-171-0/+3
| | | | | | | | When using multiple accounts, the contacts may be different. Allow using specific address book commands per account. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* threading: add force-client-threads optionTim Culverhouse2022-07-101-0/+1
| | | | | | | | | | | | | | | | | | | | This patch adds a config option to force the use of client side threads. This option will override a servers Thread capability, and only build threads on the client. It can be enabled contextually. For example: [ui] threading-enabled = true [ui:folder~^Archive] force-client-threads = true This config would enable threads for all views, and use client threads for folders that start with Archive. This can be advantageous if, for example, the folder is very large and the server has a slow response due to building threads for the entire mailbox Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* perf: reduce calls to GetUiConfigTim Culverhouse2022-07-031-0/+4
| | | | | | | | | | | | | | | | | | GetUiConfig was being called many times, and came up as a high CPU user in a cpuprofile. Every call would merge a UIConfig, which is a costly operation. Ideally, we would only need to have a config for every account X every directory. We also have a context for subjects. This patch stores all FOLDER and ACCOUNT level configs and reuses those merged objects. The SUBJECT contexts are not stored in favor of merging on-the-go, with a TODO comment to deprecate that feature and implement a better per-message styling option. I suspect this feature is not used very much. Before applying this patch with my setup, GetUiConfig is called 1159 times just to open aerc. After applying, this is reduced to 37. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* uiconfig: use pointer references to uiConfigTim Culverhouse2022-07-031-2/+2
| | | | | | | | This patch changes references to uiConfig in function signatures and structs to be pointers. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* pgp: add customizable iconsMoritz Poldrack2022-06-241-0/+12
| | | | | Signed-off-by: Moritz Poldrack <git@moritz.sh> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* config: fix setting of zero-value time.Duration config valuesTim Culverhouse2022-06-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using section.MapTo(struct) (go-ini), if the struct has a default value for a time.Duration type, a zero-value in the config will not overwrite the default. If the type is *time.Duration, it will be overwritten properly. One consideration was to change all time.Duration types to *time.Duration. This method was chosen for ease of implementation. For example, if you set dirlist-delay = 0s, the delay will be 200ms. This can be observed by logging the value just after mapping the ui section in config.go. A config value of 0.1ms will have a delay of 0.1ms. Currently, aerc has 4 time.Duration config values: 1. DirlistDelay - default 200 ms 2. CompletionDelay - default 250 ms 3. CheckMail - default unset (0) 4. CheckMailTimeout - default 10 s 1, 2, and 4 have a non-zero default value and are subject to this bug. Only 1 and 2 are fixed in this patch. Number 4 would not make sense to have a 0 second timeout, therefore we can prevent the user from doing this by keeping it as it is. Another option could be to set these to 0 in config.go. The default config (aerc.conf) has these keys in it with their default values. Presumably, we don't need to set them again in config.go. If a user deletes the config values out of aerc.conf, the UI will function but with 0s delays. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Moritz Poldrack <moritz@poldrack.dev>
* binds: add folder context for message list bindsTim Culverhouse2022-06-221-0/+5
| | | | | | | | | | | Add option to specify folder-specific binds for message lists. The binds are layered: any existing binds in [messages] are overwritten by a more specific bind in say, [messages:folder=Drafts]. The order is currently: [messages] < [messages:account=<account>] < [messages:folder=<folder>] Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* msgviewer: open http links from messagesKoni Marti2022-06-141-0/+2
| | | | | | | | | | | | | | | | | Parse http links from a message and display them as completions in the :open-link command. Add the following binds to the [view] section in your binds.conf: <C-l> = :open-link <space> Parsing can be disabled in aerc.conf by setting parse-http-links to false in the viewer section. Thanks to Moritz for the help with the regular expression. Signed-off-by: Koni Marti <koni.marti@gmail.com> Reviewed-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* msgviewer: parse and display authentication resultsKoni Marti2022-06-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Parse the Authentication-Results header and display it in the message viewer (not enabled by default). DKIM, SPF and DMARC authentication methods are supported. Implement recommendation from RFC 7601 Sec 7.1 to have an explicit list of trustworthy hostnames before displaying the authentication results. Be aware that the authentication headers can be forged. To display the results for a specific authentication method, add the corresponding name to the layout of headers in the viewer section of aerc.conf, e.g. to display all three, use: header-layout = From|To,Cc|Bcc,Date,Subject,DKIM|SPF|DMARC More information will be displayed when "+" is appended to the authentication method name, e.g. DKIM+ or SPF+ or DMARC+. Also, add the trustworthy hosts per account with the trusted-authres parameter, e.g. trusted-authres = * to trust every host or use regular expressions for a finer control. Multiple hosts can be entered as a comma-separated list. Authentication results will only be displayed when the host is listed in the trusted-authres list. Link: https://datatracker.ietf.org/doc/html/rfc7601 Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* feat: add background mail polling option for all workersTim Culverhouse2022-05-311-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Check for new mail (recent, unseen, exists counts) with an external command, or for imap with the STATUS command, at start or on reconnection and every X time duration IMAP: The selected folder is skipped, per specification. Additional config options are included for including/excluding folders explicitly. Maildir/Notmuch: An external command will be run in the background to check for new mail. An optional timeout can be used with maildir/notmuch. Default is 10s New account options: check-mail check-mail-cmd (maildir/notmuch only) check-mail-timeout (maildir/notmuch only), default 10s check-mail-include (IMAP only) check-mail-exclude (IMAP only) If unset, or set less than or equal to 0, check-mail will be ignored Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* pgp: add options auto-sign & opportunistic-encryptTim Culverhouse2022-05-061-1/+9
| | | | | | | | Add account level config options for auto-sign and opportunistic encryption. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Koni Marti <koni.marti@gmail.com>
* feat: add gpg integrationTim Culverhouse2022-04-271-1/+5
| | | | | | | | | | | | | | | | | | | This commit adds gpg system integration. This is done through two new packages: gpgbin, which handles the system calls and parsing; and gpg which is mostly a copy of emersion/go-pgpmail with modifications to interface with package gpgbin. gpg includes tests for many cases, and by it's nature also tests package gpgbin. I separated these in case an external dependency is ever used for the gpg sys-calls/parsing (IE we mirror how go-pgpmail+openpgp currently are dependencies) Two new config options are introduced: * pgp-provider. If it is not explicitly set to "gpg", aerc will default to it's internal pgp provider * pgp-key-id: (Optionally) specify a key by short or long keyId Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* refactor: refactor pgp implementationTim Culverhouse2022-04-271-0/+20
| | | | | | | | | This commit refactors the internal PGP implementation to make way for GPG integration. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* config: add unsafe-accounts-conf optionVictor Freire2022-04-251-6/+14
| | | | | | | | | | | This adds the option "unsafe-accounts-conf" under the section [general] of aerc.conf. This allows an user to specify if the accounts.conf file must be restrict to be read by the file owner (0600). By default it is set to "false". Signed-off-by: Victor Freire <victor@freire.dev.br> Acked-by: Robin Jarry <robin@jarry.cc>
* statusline: refactor to make it more customizableKoni Marti2022-04-251-5/+23
| | | | | | | | | | | | | | | | | Refactor statusline by clearly separating the rendering part from the text display. Use printf-like format string for statusline customization. Document printf-like format string to customize the statusline. Allow to completely mute the statusline (except for push notifications) with a format specifier. Provide a display mode with unicode icons for the status elements. Implements: https://todo.sr.ht/~rjarry/aerc/34 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* config: don't swallow error in checkConfigPermsConnor Kuehl2022-04-141-1/+5
| | | | | | | | | | os.Stat might return other errors aside from one stating that the file does not exist. If it does, propagate the error down. As before, if the file does not exist, just do nothing. Signed-off-by: Connor Kuehl <cipkuehl@gmail.com> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev> Tested-by: Moritz Poldrack <moritz@poldrack.dev>
* go vet: not compatible with reflect.StructTag.GetMoritz Poldrack2022-03-181-1/+1
| | | | | | | | This commit fixes all occurrences of the abovementioned lint-error in the codebase. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* viewer: add key passthrough modekt programs2022-03-141-23/+27
| | | | | | | | | | | | | | | | When trying to search in less, keys bound to viewer functions can't be used as part of the search query, which makes the search useless. Add a view::passthrough binding mode and a :toggle-key-passthrough command go toggle in and out of that mode. By default, typing '/' in the viewer is bound to enabling key passthrough and automatically inserting '/', to easily enter "less" search mode. When in the passthrough mode, all bindings are ignored by default. The default binds.conf only defines a single keybinding in that mode: <Esc> to get back out. $ex is bound to <C-x> to allow typing colons. Signed-off-by: Kt Programs <ktprograms@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>