Skip to content

Commit

Permalink
Make autocomplete configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmedv committed Dec 2, 2018
1 parent a29d430 commit c8cd6ce
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ Command-line JSON processing tool

## Features

* Don't need to learn new syntax
* Plain JavaScript
* Formatting and highlighting
* Standalone binary
* Interactive mode 🎉
* Themes support 🎨

## Install

Expand Down
8 changes: 8 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
'use strict'
const chalk = require('chalk')
const noop = x => x
const list = {
fg: 'black',
bg: 'cyan',
selected: {
bg: 'magenta'
}
}

module.exports = {
space: global.FX_STYLE_SPACE || 2,
Expand All @@ -12,4 +19,5 @@ module.exports = {
bracket: global.FX_STYLE_BRACKET || noop,
comma: global.FX_STYLE_COMMA || noop,
colon: global.FX_STYLE_COLON || noop,
list: global.FX_STYLE_LIST || list,
}
9 changes: 2 additions & 7 deletions fx.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const blessed = require('@medv/blessed')
const stringWidth = require('string-width')
const reduce = require('./reduce')
const print = require('./print')
const config = require('./config')

module.exports = function start(filename, source) {
let json = source
Expand Down Expand Up @@ -54,13 +55,7 @@ module.exports = function start(filename, source) {
height: 7,
left: 1,
bottom: 1,
style: {
fg: 'black',
bg: 'cyan',
selected: {
bg: 'magenta'
}
},
style: config.list,
})

screen.title = filename
Expand Down

0 comments on commit c8cd6ce

Please sign in to comment.