By using `replaces` it doesn't attempt to interpret \U as regex escape sequence. The \U comes from `C:\Users` which is like `/home` on Linux.
This closes#755
* edit/edcore: Implement some insert-mode functions for word-based movement.
Implemented `kill-word-right`, `kill-small-word-right`, `move-dot-left-small-word`, and `move-dot-right-small-word`.
* eval/bundled: Create default bindings for `kill-word-left` and `kill-word-right`.
* edit/edcore: Fix a dumb arithmetic error in `kill-word-right`.
* edit/edcore: Purify move- and kill- buffer commands.
* Implement category-based movement, per discussions in #696
* edit/edcore: Design unit tests for moveDot functions.
* edit/edcore: Revise categorizer-based movement for clarity; rewrite some comments.
* Add compatibility test with old implementation
* Add color type
* Add basic style structs and utilities
* Add structs for styled segments and texts
* Add default style transformers to reimplement $edit:styled~
* Add builtins to manipulate styled segments and texts
* Rename style 'underline' -> 'underlined'
* Fix test case
* Add conversion from styled text to ansi sequences
* Return errors rather than throwing
* Validate the type of boolean options
* Delegate old to new styled function
* Rebase for new test framework api and expand test cases
* Remove old builtin function $edit:styled~
* Use strings to represent colors
* Convert bool pointers to simple bool values
* Validate color strings
* Do no longer expose builtin style transformers
* Fix confusion about pointers
* Make outputs more stable
* Expand tests
* Use pointers instead of passing setter functions
* Unexport and rename color check
* Use the empty string for default colors
* Expand tests
* Simplify styled transformers
Now there are three transformers for each boolean style attribute that
allow setting, unsetting and toggling the corresponding attribute.
* Rework and add doc comments
* Remove use of external commands in epm:installed
Remove dependency on the ls and find commands, which introduced some
problems, particularly due to differences in find versions.
Fixes https://github.com/elves/elvish/issues/655
* Remove module name references
* Code cleanup
- Renamed internal functions to start with -
- Reorganized some functions
- Pass directories through tilde-abbr before displaying them
- Leave tabs and newlines in history mode. Makes it MUCH faster for
the listing to appear.
* Don't crash when git update fails
When git update fails for any reason (i.e. not a git repo, unstaged
changes, etc.), catch the exception and print an error, but don't crash.
Fixes#626
* Use try to catch git errors
- Cleaned up utility functions
- If the location attribute in an rsync domain contains a tilde at the
beginning, it gets expanded to the user's home directory.
If the installation of the package dependencies fails, we print an error
and leave any already-installed dependencies in place, but remove the
target package.
If an installed package has a metadata file, and if the metadata has a
`dependencies` key, then it is expected to be a list of strings
indicating packages that must also be installed.
There is still no error handling for this. If the
installation of dependencies fails, should we just uninstall everything?
Feedback welcome.
The `metadata` function now returns not only package-provided metadata
(if any) but also some base attributes such as package name, install
status, source and destination (if installed), and install method.
- Improved splits/joins lines
- Removed in-memory domain config caching
- Disabled creation of domain config files by default, new function
`-write-domain-config` can be used when needed.
- Made error statements more consistent
Each package method now supports a `src` function which returns the
source from which the package is fetched. The `epm:query` function
prints this information as well.
If a `metadata.json` file exists in the top-level directory of the
package, then the `epm:metadata` file reads it, parses it and returns it
as a data structure. The metadata is not used for anything at this
moment, nor is its structure or contents enforced in any way.
Reimplementation of epm to be fully file-based, with per-domain
configuration for different package installation methods. The scheme is
described in
https://github.com/elves/elvish/pull/547#issuecomment-354560975. In
short:
- Packages are specified as `domain/package`. For example,
`github.com/zzamboni/modules.elv`
- Packages are stored under `~/.elvish/lib` under their full path. For
example, `~/.elvish/lib/github.com/zzamboni/modules.elv/`
- Each domain has a configuration file stored in
`~/.elvish/lib/<domain>/epm-domain.cfg`. Currently epm has built-in
domain configuration for the `github.com` domain. This file is a JSON file which
contains the following fields:
- `method` specifies the method used to transfer the module files.
Currently supported are `git` and `rsync`.
- `levels` specifies how many directories under the domain directory
are packages located. For example, the github.com domain has
`levels` set to 2, which means the packages are directories stored
2 levels under `~/.elvish/lib/github.com`.
- Other fields may be specified, depending on the method. For example,
method `git` needs `protocol` (e.g. `https` or `git`) and
method `rsync` needs `location` (the location from which to rsync the
files).
For domains with built-in configuration (github.com at the moment), the
`epm-domain.cfg` file is created automatically the first time a package
from that domain is installed. For others, you have to create the file
by hand. For example, to have a "dev" domain which installs packages
specified as `dev/foo` from `~/devel/foo`, you must create file
`~/.elvish/lib/dev/epm-domain.cfg` containing the following:
```
{
"method" : "rsync",
"location" : "/Users/taazadi1/Personal/devel/elvish/dev",
"levels" : "1"
}
```