Commit Graph

38 Commits

Author SHA1 Message Date
Dax T. Games
3a44bc809d add ~ match to vendor/clink.lua/ 2019-09-27 18:17:24 -04:00
Joshua Webb
52eea5fe9f Close file handles in clink.lua 2019-04-19 16:16:45 +10:00
b0bh00d
89499f2a60 Replaced the 'hg -id' command with the 'hg branch' and 'hg status' pair for improved response times. 2019-01-20 21:02:31 -07:00
b0bh00d
5a48e568a8 Updated the HG prompt code to use the '-ib' option to 'hg id' to always have the branch name available. 2019-01-01 11:17:53 -07:00
Martin Böhm
51e75d4bb5 add percent escaping for string.gsub (#1991)
In `string.gsub()`, the `%` character has special meaning and must be escaped to be treated verbatim, otherwise the "invalid use of '%' in replacement string" warning will show up.

This adds a verbatim() function for that purpose. It fixes this warning for situations where `'%` characters are in the current path (cwd), version control branch names, or in the previous `PROMPT` set by the user.
2018-12-19 21:17:45 +01:00
Dax T. Games
749ce17dbe git prompt yellow 2018-09-16 15:53:49 -05:00
Dax T. Games
1d36ba4ed4 fix user lua and git detection 2018-09-16 10:18:10 -05:00
Benjamin Staneck
0d2e16c653
Merge pull request #1871 from daxgames/user_lua
Embed 'alias' functionality into 'vendor\bin' and Load User Lua files
2018-09-13 22:41:19 +02:00
Dax T. Games
059a31618b cleanup 2018-09-01 15:32:43 -04:00
Dax T. Games
e69e7f9b82 run user lua afer cmder lua 2018-09-01 14:59:40 -04:00
Dax T. Games
e93231114f Merge remote-tracking branch 'origin' into user_lua 2018-09-01 14:35:41 -04:00
Bob Hood
0f99f66b42 Refactored the Mercurial prompt code to be more efficient. 2018-07-06 14:34:48 -06:00
Benjamin Staneck
e3cdf43afc better fix for #1265 2018-06-07 18:29:48 +02:00
Benjamin Staneck
6c016788d4 Revert "sanitize dir before assigning to prompt"
This reverts commit 0b2d7bd655.
2018-06-07 17:04:06 +02:00
Benjamin Staneck
0b2d7bd655 sanitize dir before assigning to prompt
Fixes #1265
2018-06-07 16:08:53 +02:00
Dax T. Games
864f778099 load user clink 2018-03-24 08:03:28 -05:00
David Refoua
ff2e09849e simplified λ prompt in lua (#1693)
* replace lambda with $

* simplified $ prompt

The $ character for the prompt is defined only once instead of twice

* fixed λ prompt
2018-03-08 12:01:48 +01:00
Benjamin Staneck
a71c6a50ad always close open file handles
Fixes #1619
2018-01-16 21:59:11 +01:00
Benjamin Staneck
5e703796c9 git should no longer require extra file closing after the recent changes 2018-01-09 14:52:48 +01:00
Benjamin Staneck
b88a01822f re-order git/hg/svn functions 2018-01-09 14:52:48 +01:00
Benjamin Staneck
145a1b144b Fix for the last 2018-01-06 23:52:24 +01:00
Benjamin Staneck
29c5e83975 Replace --no-lock-index with the new --no-optional-locks 2018-01-06 23:43:50 +01:00
Benjamin Staneck
46d468aea0 touch up clink.lua 2017-11-03 13:13:51 +01:00
Benjamin Staneck
a8d32611a9 Fix lamda color after a ConEmu change
Seems like https://github.com/Maximus5/ConEmu/issues/1288 caused this
2017-10-29 10:46:38 +01:00
Benjamin Staneck
399999d7f7 Merge pull request #1299 from alexandr-san4ez/master
Changed the way directory is defined .git
2017-04-07 02:42:18 +02:00
dr024625
9977c0563d Adding svn support 2017-04-03 21:07:41 -05:00
Alexandr
018cc9ceda Changed the way directory is defined .git
clink.find_dirs - do not specify the directory if there is Cyrillic in the way.
clink.is_dir - more logical and faster.
2017-03-09 19:22:13 +03:00
Alexandr
c8adf424e2 Added closing process in get_git_status (#1)
After execution command: git add * git continues to operate without closing. The process does not stop.
2016-09-27 22:59:09 +02:00
Benjamin Staneck
bb312ad74b try --no-lock-index for Git 2016-09-17 22:48:02 +02:00
Jan Schulz
6b10771312 Parse the original prompt for cwd and env names
clink.get_cwd() is returning a string which is differently encoded than what
clink.prompt.value expects. This results in garbled path names if the path
condains non-ASCII chars. The (arguable hacky) solution is to parse the old
prompt for the current directory (which breaks if the user sets a PROMPT env var
which is incompatible to the regex used here...).

Also parse out a environment name set by systems like virtualenv or conda: this
could be done more specifically by targeting each such system and using the
usually set environment variable but this would mean that we would have to do
that for each and every such system out there and that is probably not a sane
idea...
2016-08-09 13:45:36 +02:00
Benjamin Staneck
13fd41eb82 change how we ask hg for the status
closes #1035
Thanks @raleighr3
2016-07-30 00:36:32 +02:00
Benjamin Staneck
924ab12aeb we don't need a second function for that. 2016-06-30 02:53:00 +02:00
Łukasz Papierz
9c0ad9fd81 Fix git branch name colouring
Colouring fixed when there are some changes in a branch
2016-06-28 14:13:35 +02:00
Jan Schulz
a542f4e20c cmd: change the prompt in lua
This keeps the PROMPT variable as is and changes the prompt to the cmder style
in the clink code.

This has two advantages:

* opening a cmd in a cmder session will now show the old prompt code instead of
  a ugly raw prompt without the replacements. This led to ugly output when a
  batch file echoed their content (e.g `conda build recipe/`).

* when a command rewrites the prompt (e.g. an activate in a virtualenv), these
  command sometimes simply overwrites the PROMPT so that the cmder enhancements
  were not anymore in place. Now we simply don't care and overwrite it with our
  stuff in the clink part. This might mean that a user has to install a lua
  script so that e.g. conda environments are visible on the prompt.
2016-06-21 13:33:49 +02:00
Jan Schulz
c19412045c Fix git branch name never shown as dirty
The problem was that io.popen() returns a file and not the return code of the
called program.

The new code was inspired by
http://stackoverflow.com/a/14031974/1380673
2016-06-02 12:45:07 +02:00
Gregory Pakosz
64d981e470 Fixed get_git_dir() to take submodules into account. Fixes #833 2016-02-16 11:15:42 +01:00
Jan Schulz
fe45b186e0 clink.lua: add header
Introduce a header like in the rest of the scripts that this file
is overwritten on updates and should not be modified.
2016-01-15 18:06:35 +01:00
Jan Schulz
788b5262b4 Reorganize how clink settings are loaded
4bfdf04d59 moved all clink config files
to vendor/ and therefore the files in config/ were not used and .history
was also moved to vendor/.

The new arrangement uses `--script` to load our own clink.lua file which in
turn as the first thing loads the original clink.lua file. The user defined
files are again in config/. As clink regenerates these files, if they are not
present, this also means that we don't need to include the settings file
in the git repo and therefore don't overwrite it on updates.
2016-01-15 18:02:10 +01:00