Commit Graph

6364 Commits

Author SHA1 Message Date
Michael Steinert
e2ed561264 Fixes behavior of 'x' in normal mode
After 'x' is used to delete a character at the end of a line the cursor
should be repositioned at the last character, i.e. repeatedly pressing
'x' in normal mode should delete the entire string.
2016-12-01 16:23:59 -08:00
Radomír Bosák
1fbcb1ee9d Add the possibility to rename abbreviations
The abbr function doesn't have the possiblity to rename abbreviations.
You have to delete the old one and create a new one. This commit adds
this functionality and uses the syntax:

abbr -r OLD_KEY NEW_KEY

Fixes #2155.
2016-12-01 14:42:20 -08:00
David Adam
a0d9db94cb osx/config.h: update to match current configure output 2016-11-30 18:50:23 +08:00
Aaron Gyes
6a5a1a8964 [[noreturn]] instead of __attribute__ ((noreturn))
C++11 does this, better to use a standard attribute than a compiler
extension.
2016-11-29 01:41:03 -08:00
Aaron Gyes
a8b2da8405 Use early returns throughout builtin_cd and fix my no-HOME output. 2016-11-28 23:59:37 -08:00
Kurtis Rader
7cfe028b9d fix functions --copy
Fixes #3601
2016-11-28 18:04:37 -08:00
Kurtis Rader
1ca1667786 fix bug introduced by fish_indent
Commit 11a60c8 restyled all the fish scripts using fish_indent. Sadly a
bug in fish_indent did not correctly reformat an unusual structure.
2016-11-28 17:13:01 -08:00
Kurtis Rader
c8d2e6d972 two more tests of VTE_VERSION that need protection 2016-11-28 14:39:41 -08:00
David B. Lamkins
ca33bbd4e0 Eliminate spurious startup message when $VTE_VERSION is unset. 2016-11-28 14:36:20 -08:00
Aaron Gyes
f47ebc4b1c builtin cd: Handle unset HOME. 2016-11-28 12:40:55 -08:00
Aaron Gyes
682af2f83f Remove 4 cppcheck suppressions reported unmatched. 2016-11-28 11:54:03 -08:00
Aaron Gyes
7c6527e9cf Fix segfault with bad USER and unset HOME
A couple things went wrong with `env -u HOME USER=x ./fish -c ''`
We failed to check that `pw` isn't NULL leading to a crash when USER is
bogus. After fixing that we were not left with both variables in a
correct state still.

We now go back and force fish to dig up a working USER when we notice
this and then get both set successfully. Fixes #3599
2016-11-28 09:34:56 -08:00
Aaron Gyes
121109ee4d Adds a --quiet/-q option for command -s (#3591)
devnull'ing this builtin to check presence is a common
enough chore that a --quiet option which works like it does on
`type` would be handy.
2016-11-28 07:26:01 -08:00
Kurtis Rader
11a60c8374 reformat all fish scripts
I hate doing this but I am tired of touching a fish script as part of
some change and having `make style` radically change it. Which makes
editing fish scripts more painful than it needs to be. It is time to do
a wholesale reformatting of these scripts to conform to the documented
style as implemented by the `fish_indent` program.
2016-11-27 21:27:22 -08:00
Kurtis Rader
54a76bb9e5 emit error message when test is given invalid int
This augments the previous change for issue #3346 by adding an error
message when an invalid integer is seen. This change is likely to be
controversial so I'm not going to squash it into the previous change.
2016-11-27 20:37:30 -08:00
Kurtis Rader
2f33c24a07 fix handling of odd strings by test builtin
The `test` builtin currently has unexpected behavior with respect to
expressions such as `'' -eq 0`. That currently evaluates to true with a
return status of zero. This change addresses that oddity while also
ensuring that other unusual strings (e.g., numbers with leading and
trailing whitespace) are handled consistently.

Fixes #3346
2016-11-27 20:37:21 -08:00
Aaron Gyes
d0146d7b6f builtin test: output correct program name on error
Only in one instance would test as `[` have the the errors formatted
as "[: foo". This fixes that. When trying to track down the source of
an error this could lead someone astray.
2016-11-27 20:28:38 -08:00
Fabian Homborg
9ad1b86e4e Reset bindings if the new value was bogus.
See #3590.
2016-11-27 14:17:24 +01:00
Aaron Gyes
f63c8a703e 'test' completions: comment out entries
Our builtin doesn't do some of this stuff. See #3589
2016-11-27 03:05:11 -08:00
Aaron Gyes
4f6ac06b21 Don't automatically generate completions without python
This is doomed to cause a messy error on every launch on any systems
that are using fish without python installed. Fixes #3588
2016-11-27 02:00:21 -08:00
Aaron Gyes
18cc06b38f Don't no-op terminal.app title if it's customized
We only want to override the internal fish hardcoded title.
Fixes #3578
2016-11-26 20:02:51 -08:00
ridiculousfish
c1d4c07548 Update Xcode project for Xcode 8.1 2016-11-26 16:25:55 -08:00
ridiculousfish
e97c5b552c Update make_tarball.sh to run autoreconf instead of autoconf
This is necessary as part of the autotools build changes
for C++11
2016-11-26 15:02:19 -08:00
ridiculousfish
9588c9a811 Teach make distclean to delete autom4te.cache aclocal.m4 2016-11-26 14:58:31 -08:00
ridiculousfish
94ef40fb19 Add aclocal.m4 to .gitignore 2016-11-26 14:46:28 -08:00
ridiculousfish
87b0d1b828 Merge pull request #3585 from fornwall/build-without-shmem
Fix build on systems without shm_open()
2016-11-26 14:38:07 -08:00
ridiculousfish
38ea6e088e Don't invoke make in pcre directory unless it has a Makefile
make clean was outputting misleading messages due to our
recursive invocation of make in the pcre directory, even if
that directory has no Makefile. This can easily come about if
the ./configure script determines we have a system installed PCRE.

This change simply checks for the presence of the Makefile in
the PCRE directory before invoking recursive make, for the clean
and distclean targets.

Fixes #3586
2016-11-26 14:33:15 -08:00
ridiculousfish
0eda4020a2 Update README to describe automake dependency 2016-11-26 14:03:31 -08:00
Patrick Häcker
ded6e726e5 Output current default priority in dpkg-reconfigure completion
This might be a bit over the top, but getting the information that a default priority threshold is used without knowing what that value is or how to find out might not be so useful after all. Thus, change the completion to include this information dynamically.
2016-11-26 22:53:54 +01:00
ridiculousfish
df55991806 Teach ./configure to rerun autoreconf --no-recursive
Currently, the ./configure script generated by autotools will
test if the configure.ac script is newer than its output configure
script, and if so, run autoconf to rebuild it. However autoconf
is no longer sufficient because we have some m4 macros. So now
run autoreconf --no-recursive (per #3572)
2016-11-26 13:17:23 -08:00
ridiculousfish
73bd7c51cf Update README to describe C++11 support 2016-11-26 13:16:50 -08:00
Fredrik Fornwall
df12ac24b2 Fix build on systems without shm_open()
Notably, this fixes building on Android.
2016-11-26 16:14:15 -05:00
ridiculousfish
fb63bee322 Merge branch 'cpp11'
Defaults fish to build as C++11 by default.
See #3572.
2016-11-26 13:10:00 -08:00
ridiculousfish
c7a016a137 Enable C++11 in 'make lint'
autotools implements C++11 support by setting $CXX to
"g++ -std=c++11", so we have to make sure to quote $CXX when
passing it to the linter script
2016-11-26 12:59:00 -08:00
ridiculousfish
3a03d5df53 Enable C++11 in Xcode build
This commit does a few things:
  - Switches to C++11 as the language dialect
  - Eliminates the Release_C++11 configuration (now C++11 is default)
  - Switches to libc++ from libstdc++, since the libstdc++ that ships
    with Xcode does not support C++11
2016-11-26 12:59:00 -08:00
ridiculousfish
f0ba37b73a Enable C++11 in autotools build 2016-11-26 12:59:00 -08:00
Kurtis Rader
a928517e95 improve converting strings to ints/longs
The existing code is inconsistent, and in a couple of cases wrong, about
dealing with strings that are not valid ints. For example, there are
locations that call wcstol() and check errno without first setting errno
to zero. Normalize the code to a consistent pattern.  This is mostly to
deal with inconsistencies between BSD, GNU, and other UNIXes.

This does make some syntax more liberal. For example `echo $PATH[1 .. 3]`
is now valid due to uniformly allowing leading and trailing whitespace
around numbers. Whereas prior to this change you would get a "Invalid
index value" error. Contrast this with `echo $PATH[ 1.. 3 ]` which was
valid and still is.
2016-11-25 18:52:15 -08:00
David B. Lamkins
5ec9fcd8d4 Allow browser for help to be chosen indenpendent of $BROWSER. 2016-11-25 18:35:22 -08:00
Valentin Hăloiu
ed5f90d22e Update key binding docs to reflect actual behavior
Some key bindings were updated in fish 2.4.0 but in some cases the
documentation does not correctly reflect the actual behavior. This
commit attempts to fix that.
2016-11-24 18:58:08 -08:00
Harm Aarts
5cfd3eb63a Update LXD completions. 2016-11-23 23:48:01 +01:00
Kurtis Rader
aad2848e80 use consistent mechanism to validate var names
Builtin commands that validate var names should use a consistent
mechanism. I noticed that builtin_read() had it's own custom code that
differed slightly from wcsvarname().

Fixes #3569
2016-11-22 16:18:20 -08:00
Kurtis Rader
320cb6857f an invalid flag to function is handled wrong
Specifically, an invalid flag keeps the function from being defined but
does not emit an error message.

Fixes #2827
2016-11-22 16:17:51 -08:00
Kurtis Rader
9ac78e06b4 fix builtin ulimit arg handling
Fixes #3570
2016-11-21 21:15:59 -08:00
Aaron Gyes
93e6f57dfc Run make depend
Some object file dependencies have changed.
2016-11-20 20:38:52 -08:00
Kurtis Rader
45c7836bec remove is_wchar_ucs2()
My previous change removed one place where is_wchar_ucs2() was used and
replaced it with compile time tests. This change does the same for the
other uses.
2016-11-20 18:25:49 -08:00
Kurtis Rader
b8778ba4a2 make fish_tests work on MS Windows with C++11
On Cygwin there are two narrowing conversions at line 931 in
src/fish_tests.cpp due to the code assuming a wchar_t is four bytes.
Obviously that's wrong but only became an issue with the pending change to
switch to C++11. The problematic values aren't actually used on Windows
because the tests that would use them are bypassed if is_wchar_ucs2()
returns true. This change predicates that code on a compile time rather
than a run time test.
2016-11-20 18:05:34 -08:00
Kurtis Rader
b16511344e fix incorrect pointer to int comparison
This came to my attention while testing the PR that switches us to the
C++11 standard and one of the compilers reported this error.
2016-11-20 15:04:51 -08:00
Aaron Gyes
1054a2fd36 Makefile.in: fix output alignment spacing 2016-11-20 14:38:02 -08:00
ridiculousfish
b86b84e2a9 L'\0' is not a pointer, don't compare it to one
Compare to NULL instead. Comparison with original code
shows this is what is intended.
2016-11-20 00:30:55 -08:00
ridiculousfish
52d1b6b97d Remove some dead functions
icompare_pred and icompare in history.cpp are unused
2016-11-19 23:12:49 -08:00