mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-09 03:51:20 -03:00
Teach fish_indent about our feature flags
So it can handle syntax changes that call for different formatting.
This commit is contained in:
@@ -41,6 +41,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
#include "fds.h"
|
||||
#include "fish_version.h"
|
||||
#include "flog.h"
|
||||
#include "future_feature_flags.h"
|
||||
#include "highlight.h"
|
||||
#include "operation_context.h"
|
||||
#include "output.h"
|
||||
@@ -853,6 +854,12 @@ int main(int argc, char *argv[]) {
|
||||
setlocale(LC_ALL, "");
|
||||
env_init();
|
||||
|
||||
if (auto features_var = env_stack_t::globals().get(L"fish_features")) {
|
||||
for (const wcstring &s : features_var->as_list()) {
|
||||
mutable_fish_features().set_from_string(s);
|
||||
}
|
||||
}
|
||||
|
||||
// Types of output we support.
|
||||
enum {
|
||||
output_type_plain_text,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#RUN: %fish --features=ampersand-nobg-in-token %s
|
||||
#RUN: %fish --features=ampersand-nobg-in-token -C 'set -g fish_indent %fish_indent' %s
|
||||
|
||||
echo no&background
|
||||
# CHECK: no&background
|
||||
@@ -10,3 +10,6 @@ echo background &
|
||||
# CHECK: background
|
||||
|
||||
wait
|
||||
|
||||
echo no&bg | fish_features=ampersand-nobg-in-token $fish_indent --check
|
||||
echo $status #CHECK: 0
|
||||
|
||||
Reference in New Issue
Block a user