Commit Graph

4227 Commits

Author SHA1 Message Date
Mark Griffiths
668fa66d78 Fish documentation formatting guidelines 2014-09-03 14:43:27 +01:00
Mark Griffiths
98ebb21489 Consistency fixes 2014-09-03 14:43:27 +01:00
Mark Griffiths
137abd0cfa Make line length, wrapping and spacing consistent 2014-09-03 14:43:26 +01:00
Mark Griffiths
d7308fecbe gitignore changes 2014-09-03 14:43:26 +01:00
Mark Griffiths
73fb9915fd Fixed a few more edge cases 2014-09-03 14:43:26 +01:00
Mark Griffiths
855a119654 Fix trailing backslash after complex options 2014-09-03 14:43:26 +01:00
Mark Griffiths
cf7a6a6a65 Fix ampersand redirector 2014-09-03 14:43:26 +01:00
Mark Griffiths
509d152e54 Tutorial auto colouring, Man page and Make fixes
Completely fixes #1557 and the underlying Doxygen changes that caused
it. Should make fish docs simpler and more robust, more consistent and
generally prettier.

todo:
- trap unmarked text as arguments in context
- test & fix sed portability - see in particular. (so far tested on BSD
(Mac) and GNU sed).
- test Makefile changes
- last round of aesthetic changes and getting that ascii fish in there…
2014-09-03 14:43:26 +01:00
Mark Griffiths
35e6fb3788 Updated build_doc…sh to run cleanly in Xcode build
If the lexicon input filter isn't specified (as is the case in the
current Xcode project, the script quietly continues without it.
2014-09-03 14:43:26 +01:00
Mark Griffiths
9b79931265 Update configure.ac and README for Doxygen 1.8 2014-09-03 14:43:26 +01:00
Mark Griffiths
14a7118499 Revert 60b9f8d..e4d6eaf
This rolls back to commit 60b9f8db18.
2014-09-03 14:43:26 +01:00
Mark Griffiths
afdabd97ff Revert Xcode project
This reverts accidentally included files in commit
60b9f8db18.
2014-09-03 14:43:25 +01:00
Mark Griffiths
07f8fc7697 Update autoconf and README for Doxygen 1.8 2014-09-03 14:43:25 +01:00
Mark Griffiths
def7666609 Fix missed escaped '--' inside /fish block 2014-09-03 14:43:25 +01:00
Mark Griffiths
c900f23662 Add lexicon filter to manpages.
Fixed manpage 'NAME'. Under Doxygen 1.8, the output format has
changed, so the old sed script was leaving man pages with two titles.
2014-09-03 14:43:25 +01:00
Mark Griffiths
7b093ee4b3 Lexicon filter: fix 'if' and 'for' special cases 2014-09-03 14:43:25 +01:00
Mark Griffiths
9f75cef5e5 Style fix for sub-line comments 2014-09-03 14:43:25 +01:00
Mark Griffiths
a410c31bf8 Fixes lexicon filter pipes '|" 2014-09-03 14:43:25 +01:00
Mark Griffiths
1cd50ba572 Merged in latest changes to docs and formatting tweaks
Addresses issue #1557 as well as fixing many typos, HTML errors and
inconsistencies. Also introduces automatic syntax colouring and enables
new documentation to be written in Markdown. TODO fix Tutorial.
2014-09-03 14:43:25 +01:00
Mark Griffiths
1052eeee8c Simplify styling 2014-09-03 14:43:25 +01:00
Mark Griffiths
e22f0dda32 Removed dupes from gitignore 2014-09-03 14:43:24 +01:00
Mark Griffiths
766a6b8309 Added some clutter
Subllime and a few temporary files.
2014-09-03 14:43:24 +01:00
Mark Griffiths
d282bc4625 Documentation update
Rework for Doxygen >1.8. Moved large parts of the documentation to a
simplified format, making use of Markdown enhancements and fixing bad
long options.
2014-09-03 14:43:24 +01:00
Chris Wolfe
677cee44ad failiure/failure
Fix misspelling of failure in the fish shell design doc
2014-09-03 14:48:21 +02:00
Mark Griffiths
60e7726832 Merge branch 'master' into documentation-update 2014-09-03 13:14:25 +01:00
Mark Griffiths
385b00a468 Formatting updates 2014-09-03 13:06:49 +01:00
Kevin Ballard
1c4223889b Fix test output for complete -e tests
GNU sort behaves stupidly when LC_ALL is not C. This caused the test
output to be sorted wrong.
2014-09-02 15:52:56 -07:00
Kevin Ballard
90a4fd34d2 Add tests for the various complete -e changes 2014-09-02 15:30:58 -07:00
Kevin Ballard
2820c7a9cd Erase all completions with complete -c foo -e
When passing `-e` to `complete -c foo` without any other options, all
options for the command should be erased.

Fixes #380.
2014-09-02 15:30:58 -07:00
Kevin Ballard
edd4f3d5ad Don't erase old-style options with complete -l foo -e
When erasing long option completions, distinguish between gnu-style and
old-style options, just like we do when adding and printing completions.
2014-09-02 15:30:58 -07:00
Kevin Ballard
aa7fe3b132 Don't erase all long opts with complete -e
When using `complete -c foo -l bar -e`, all long options for the command
were being erased because it was also comparing the short option, which
was 0.
2014-09-02 15:30:58 -07:00
Kevin Ballard
1d9886d0f7 Don't segfault when erasing short option completions
When using `complete -s x -e`, the long option is unspecified, which
makes it NULL. Comparing this to a `wcstring` segfaults.

Fixes #1182.
2014-09-02 15:30:51 -07:00
Mark Griffiths
6068e85ef2 Merge branch 'master' into documentation-update 2014-08-30 12:38:57 +01:00
Mark Griffiths
ced471d4ce Supporting files for development 2014-08-30 12:21:46 +01:00
Mark Griffiths
2445ac4a53 Addition of 'ascii fish' logo
+ small fixes
2014-08-30 11:03:02 +01:00
Konrad Borowski
1d0279eac5 Fix F1 binding to work with multiple tokens. 2014-08-30 11:18:56 +02:00
ridiculousfish
f8b21fe199 Merge pull request #1655 from xakon/master
Fix small typo in documentation
2014-08-29 23:21:34 -07:00
Christos Kontas
0f330d7226 Fix small typo in documentation 2014-08-30 08:03:24 +02:00
Nikolai Aleksandrovich Pavlov
cb29350954 Fix fish_vi_mode.fish 2014-08-29 13:15:13 -07:00
Kevin Ballard
7fce9e2411 Trim trailing newline on cmdsubst when IFS=''
When $IFS is empty, command substitution no longer splits on newlines.
However we still want to trim off a single trailing newline, as most
commands will emit a trailing newline and it makes it harder to work
with their output.
2014-08-29 12:48:45 -07:00
Kevin Ballard
cc52a59e1a Rework how screen size is tracked
The screen size is fetched after a SIGWINCH is delivered. The current
implementation has two issues:

* It calls ioctl() from the SIGWINCH signal handler, despite ioctl() not
  being a function that is known to be safe to call.
* It's not thread-safe.

Signals can be delivered on arbitrary threads, so we don't know if it's
actually safe to be modifying the cached winsize in response to a
signal. It's also plausible that the winsize may be requested from a
background thread.

To solve the first issue, we twiddle a volatile boolean flag in the
signal handler and defer the ioctl() call until we actually request the
screen size.

To solve the second issue, we introduce a pthread rwlock around the
cached winsize. A rwlock is used because it can be expected that there
are likely to be far more window size reads than window size writes. If
we were using C++11 we could probably get away with atomics, but since
we don't have that (or boost), a rwlock should suffice.

Fixes #1613.
2014-08-29 12:46:03 -07:00
Kevin Ballard
24ac7d2698 Fix commandline behavior in bind functions
When a key is bound to a fish function, if that function invokes
`commandline`, it gets a stale copy of the commandline. This is because
any keys passed to `self-insert` (the default) don't actually get added
to the commandline until a special character is processed, such as the
R_NULL that gets returned after running a binding for a fish command.

To fix this, don't allow fish commands to be run for bindings if we're
processing more than one key. When a key wants to invoke a fish command,
instead we push the invocation sequence back onto the input, followed by
an R_NULL, and return. This causes the input loop to break out and
update the commandline. When it starts up again, it will re-process the
keys and invoke the fish command.

This is primarily an issue with pasting text that includes bound keys in
it. Typed text is slow enough that fish will update the commandline
between each character.

---

I don't know of any way to write a test for this, but the issue can be
reproduced as follows:

    > bind _ 'commandline -i _'

This binds _ to a command that inserts _. Typing the following works:

    > echo wat_is_it

But if you copy that line and paste it instead of typing it, the end
result looks like

    > _echo wat_isit

With this fix in place, the pasted output correctly matches the typed
output.
2014-08-29 12:29:48 -07:00
Kevin Ballard
130619d6b0 Fix $SHLVL
Due to being read-only, SHLVL wasn't being incremented properly for
recursive invocations of fish.
2014-08-29 12:22:35 -07:00
Konrad Borowski
71ab40e536 Add Fossil command completions. 2014-08-29 14:19:55 +02:00
Philipp Klose
7638a7d531 Fix typo in German translation 2014-08-29 11:23:08 +02:00
Kevin Ballard
b92a09d5e7 Fix the assertion failure in expand_variables()
expand_variables() is slightly confused about how to handle last_idx. On
input, it expects it to be the index to start processing at, but when
called recursively it always passes the current index. This means that
it may sometimes pass an index 1 past the end of the input string.
Notably, that happens when typing something like

> echo "$foo

(where "foo" is any string that is not a prefix of some existing
variable name)

Fix this by explicitly defining last_idx as being the last processed
index, meaning the next index to process is actually last_idx-1. This
means we should call it with next.size() instead of next.size()-1.
2014-08-28 13:29:43 -07:00
Mark Griffiths
3d29cc8636 Various additions and fixes 2014-08-27 00:30:08 +01:00
Mark Griffiths
d6c5a1e0c4 Merge branch 'master' into documentation-update
Conflicts (FIXED):
	doc_src/command.txt
	doc_src/index.hdr.in
	doc_src/read.txt
	doc_src/type.txt
2014-08-26 20:05:46 +01:00
Mark Griffiths
9bcd4a6811 Merge remote-tracking branch 'upstream/master' 2014-08-26 19:23:50 +01:00
Mark Griffiths
e90b1651e4 Fish documentation formatting guidelines 2014-08-26 19:19:48 +01:00