Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to set statusBar foreground color #2350

Merged
merged 3 commits into from
Feb 15, 2018

Conversation

mgor
Copy link
Contributor

@mgor mgor commented Jan 31, 2018

What this PR does / why we need it:
Basically a reimplementation of #2102. Updated documentation to include instructions on how colors are set.

Having the possibility to set the foreground color makes it easier to select a background color and get a good contrast between the two.

Which issue(s) this PR fixes
N/A.

Special notes for your reviewer:
N/A.

@TravisBuddy
Copy link

Travis tests have failed

Hey Mikael Göransson,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

Node.js: 8.9.1

git ls-tree -r HEAD --name-only | grep ".*.[t|j]s$" | xargs ./node_modules/prettier/bin/prettier.js --write --print-width 100 --single-quote --trailing-comma es5
extension.tsextension.ts 473ms
gulpfile.jsgulpfile.js 79ms
src/actions/base.tssrc/actions/base.ts 100ms
src/actions/commands/actions.tssrc/actions/commands/actions.ts 1128ms
src/actions/commands/insert.tssrc/actions/commands/insert.ts 169ms
src/actions/include-all.tssrc/actions/include-all.ts 10ms
src/actions/motion.tssrc/actions/motion.ts 406ms
src/actions/operator.tssrc/actions/operator.ts 202ms
src/actions/plugins/easymotion/easymotion.cmd.tssrc/actions/plugins/easymotion/easymotion.cmd.ts 88ms
src/actions/plugins/easymotion/easymotion.tssrc/actions/plugins/easymotion/easymotion.ts 79ms
src/actions/plugins/easymotion/markerGenerator.tssrc/actions/plugins/easymotion/markerGenerator.ts 16ms
src/actions/plugins/easymotion/registerMoveActions.tssrc/actions/plugins/easymotion/registerMoveActions.ts 47ms
src/actions/plugins/easymotion/types.tssrc/actions/plugins/easymotion/types.ts 6ms
src/actions/plugins/surround.tssrc/actions/plugins/surround.ts 150ms
src/actions/textobject.tssrc/actions/textobject.ts 230ms
src/cmd_line/commandLine.tssrc/cmd_line/commandLine.ts 17ms
src/cmd_line/commands/close.tssrc/cmd_line/commands/close.ts 12ms
src/cmd_line/commands/deleteRange.tssrc/cmd_line/commands/deleteRange.ts 27ms
src/cmd_line/commands/file.tssrc/cmd_line/commands/file.ts 31ms
src/cmd_line/commands/nohl.tssrc/cmd_line/commands/nohl.ts 5ms
src/cmd_line/commands/only.tssrc/cmd_line/commands/only.ts 20ms
src/cmd_line/commands/quit.tssrc/cmd_line/commands/quit.ts 32ms
src/cmd_line/commands/read.tssrc/cmd_line/commands/read.ts 23ms
src/cmd_line/commands/register.tssrc/cmd_line/commands/register.ts 16ms
src/cmd_line/commands/setoptions.tssrc/cmd_line/commands/setoptions.ts 11ms
src/cmd_line/commands/sort.tssrc/cmd_line/commands/sort.ts 15ms
src/cmd_line/commands/substitute.tssrc/cmd_line/commands/substitute.ts 46ms
src/cmd_line/commands/tab.tssrc/cmd_line/commands/tab.ts 15ms
src/cmd_line/commands/wall.tssrc/cmd_line/commands/wall.ts 4ms
src/cmd_line/commands/write.tssrc/cmd_line/commands/write.ts 17ms
src/cmd_line/commands/writequit.tssrc/cmd_line/commands/writequit.ts 18ms
src/cmd_line/commands/writequitall.tssrc/cmd_line/commands/writequitall.ts 15ms
src/cmd_line/lexer.tssrc/cmd_line/lexer.ts 67ms
src/cmd_line/node.tssrc/cmd_line/node.ts 30ms
src/cmd_line/parser.tssrc/cmd_line/parser.ts 14ms
src/cmd_line/scanner.tssrc/cmd_line/scanner.ts 33ms
src/cmd_line/subparser.tssrc/cmd_line/subparser.ts 8ms
src/cmd_line/subparsers/close.tssrc/cmd_line/subparsers/close.ts 4ms
src/cmd_line/subparsers/deleteRange.tssrc/cmd_line/subparsers/deleteRange.ts 2ms
src/cmd_line/subparsers/file.tssrc/cmd_line/subparsers/file.ts 6ms
src/cmd_line/subparsers/nohl.tssrc/cmd_line/subparsers/nohl.ts 2ms
src/cmd_line/subparsers/only.tssrc/cmd_line/subparsers/only.ts 1ms
src/cmd_line/subparsers/quit.tssrc/cmd_line/subparsers/quit.ts 6ms
src/cmd_line/subparsers/read.tssrc/cmd_line/subparsers/read.ts 10ms
src/cmd_line/subparsers/register.tssrc/cmd_line/subparsers/register.ts 3ms
src/cmd_line/subparsers/setoptions.tssrc/cmd_line/subparsers/setoptions.ts 14ms
src/cmd_line/subparsers/sort.tssrc/cmd_line/subparsers/sort.ts 3ms
src/cmd_line/subparsers/substitute.tssrc/cmd_line/subparsers/substitute.ts 32ms
src/cmd_line/subparsers/tab.tssrc/cmd_line/subparsers/tab.ts 11ms
src/cmd_line/subparsers/wall.tssrc/cmd_line/subparsers/wall.ts 4ms
src/cmd_line/subparsers/write.tssrc/cmd_line/subparsers/write.ts 8ms
src/cmd_line/subparsers/writequit.tssrc/cmd_line/subparsers/writequit.ts 6ms
src/cmd_line/subparsers/writequitall.tssrc/cmd_line/subparsers/writequitall.ts 3ms
src/cmd_line/token.tssrc/cmd_line/token.ts 4ms
src/common/matching/matcher.tssrc/common/matching/matcher.ts 37ms
src/common/matching/quoteMatcher.tssrc/common/matching/quoteMatcher.ts 6ms
src/common/matching/tagMatcher.tssrc/common/matching/tagMatcher.ts 12ms
src/common/motion/position.tssrc/common/motion/position.ts 278ms
src/common/motion/range.tssrc/common/motion/range.ts 23ms
src/common/number/numericString.tssrc/common/number/numericString.ts 13ms
src/configuration/configuration.tssrc/configuration/configuration.ts 68ms
src/configuration/decoration.tssrc/configuration/decoration.ts 4ms
src/configuration/notation.tssrc/configuration/notation.ts 8ms
src/configuration/remapper.tssrc/configuration/remapper.ts 45ms
src/editorIdentity.tssrc/editorIdentity.ts 7ms
src/error.tssrc/error.ts 13ms
src/globals.tssrc/globals.ts 2ms
src/history/historyTracker.tssrc/history/historyTracker.ts 121ms
src/mode/mode.tssrc/mode/mode.ts 8ms
src/mode/modeHandler.tssrc/mode/modeHandler.ts 247ms
src/mode/modeHandlerMap.tssrc/mode/modeHandlerMap.ts 7ms
src/mode/modes.tssrc/mode/modes.ts 13ms
src/neovim/nvimUtil.tssrc/neovim/nvimUtil.ts 46ms
src/register/register.tssrc/register/register.ts 72ms
src/state/globalState.tssrc/state/globalState.ts 11ms
src/state/recordedState.tssrc/state/recordedState.ts 23ms
src/state/replaceState.tssrc/state/replaceState.ts 4ms
src/state/searchState.tssrc/state/searchState.ts 36ms
src/state/vimState.tssrc/state/vimState.ts 27ms
src/statusBar.tssrc/statusBar.ts 8ms
src/taskQueue.tssrc/taskQueue.ts 14ms
src/textEditor.tssrc/textEditor.ts 46ms
src/transformations/transformations.tssrc/transformations/transformations.ts 17ms
src/util.tssrc/util.ts 9ms
test/actions/baseAction.test.tstest/actions/baseAction.test.ts 34ms
test/cmd_line/lexer.test.tstest/cmd_line/lexer.test.ts 40ms
test/cmd_line/parser.test.tstest/cmd_line/parser.test.ts 8ms
test/cmd_line/scanner.test.tstest/cmd_line/scanner.test.ts 17ms
test/cmd_line/sort.test.tstest/cmd_line/sort.test.ts 9ms
test/cmd_line/subparser.close.test.tstest/cmd_line/subparser.close.test.ts 7ms
test/cmd_line/subparser.quit.test.tstest/cmd_line/subparser.quit.test.ts 15ms
test/cmd_line/subparser.substitute.test.tstest/cmd_line/subparser.substitute.test.ts 5ms
test/cmd_line/subparser.test.tstest/cmd_line/subparser.test.ts 13ms
test/cmd_line/substitute.test.tstest/cmd_line/substitute.test.ts 66ms
test/cmd_line/vsplit.test.tstest/cmd_line/vsplit.test.ts 7ms
test/cmd_line/writequit.test.tstest/cmd_line/writequit.test.ts 14ms
test/configuration/notation.test.tstest/configuration/notation.test.ts 6ms
test/error.test.tstest/error.test.ts 5ms
test/extension.test.tstest/extension.test.ts 8ms
test/index.tstest/index.ts 4ms
test/macro.test.tstest/macro.test.ts 14ms
test/mode/modeHandler.test.tstest/mode/modeHandler.test.ts 7ms
test/mode/modeHandlerMap.test.tstest/mode/modeHandlerMap.test.ts 11ms
test/mode/modeInsert.test.tstest/mode/modeInsert.test.ts 58ms
test/mode/modeNormal.test.tstest/mode/modeNormal.test.ts 338ms
test/mode/modeReplace.test.tstest/mode/modeReplace.test.ts 9ms
test/mode/modeVisual.test.tstest/mode/modeVisual.test.ts 208ms
test/mode/modeVisualBlock.test.tstest/mode/modeVisualBlock.test.ts 81ms
test/mode/modeVisualLine.test.tstest/mode/modeVisualLine.test.ts 187ms
test/mode/normalModeTests/commands.test.tstest/mode/normalModeTests/commands.test.ts 92ms
test/mode/normalModeTests/dot.test.tstest/mode/normalModeTests/dot.test.ts 20ms
test/mode/normalModeTests/motions.test.tstest/mode/normalModeTests/motions.test.ts 114ms
test/motion.test.tstest/motion.test.ts 137ms
test/number/numericString.test.tstest/number/numericString.test.ts 4ms
test/operator/comment.test.tstest/operator/comment.test.ts 5ms
test/operator/put.test.tstest/operator/put.test.ts 5ms
test/operator/shift.test.tstest/operator/shift.test.ts 6ms
test/plugins/easymotion.test.tstest/plugins/easymotion.test.ts 22ms
test/plugins/surround.test.tstest/plugins/surround.test.ts 19ms
test/register/register.test.tstest/register/register.test.ts 17ms
test/register/repeatableMovement.test.tstest/register/repeatableMovement.test.ts 4ms
test/testSimplifier.tstest/testSimplifier.ts 46ms
test/testUtils.tstest/testUtils.ts 18ms
test/textEditor.test.tstest/textEditor.test.ts 11ms
typings/custom/promised-neovim-client.d.tstypings/custom/promised-neovim-client.d.ts 93ms

gulp
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
/home/travis/.nvm/versions/node/v8.9.1/bin/gulp -> /home/travis/.nvm/versions/node/v8.9.1/lib/node_modules/gulp/bin/gulp.js
+ [email protected]
added 274 packages in 6.315s

$ npm install;

> [email protected] postinstall /home/travis/build/VSCodeVim/Vim/node_modules/typings-global
> node ./dist/install.js

@types/node already installed

> [email protected] postinstall /home/travis/build/VSCodeVim/Vim
> node ./node_modules/vscode/bin/install && gulp init

Detected VS Code engine version: ^1.17.0
Found minimal version that qualifies engine range: 1.17.0
Fetching vscode.d.ts from: https://raw.githubusercontent.com/Microsoft/vscode/be377c0faf7574a59f84940f593a6849f12e4de7/src/vs/vscode.d.ts
vscode.d.ts successfully installed!

[19:29:42] Using gulpfile ~/build/VSCodeVim/Vim/gulpfile.js
[19:29:42] Starting 'typings'...
[19:29:43] Finished 'typings' after 947 ms
[19:29:43] Starting 'typings-vscode-definitions'...
[19:29:43] Finished 'typings-vscode-definitions' after 4.54 ms
[19:29:43] Starting 'init'...
[19:29:43] Finished 'init' after 61 μs
added 624 packages in 14.469s

$ git ls-tree -r HEAD --name-only | grep ".*.[t|j]s$" | xargs ./node_modules/prettier/bin/prettier.js --write --print-width 100 --single-quote --trailing-comma es5
extension.tsextension.ts 473ms
gulpfile.jsgulpfile.js 79ms
src/actions/base.tssrc/actions/base.ts 100ms
src/actions/commands/actions.tssrc/actions/commands/actions.ts 1128ms
src/actions/commands/insert.tssrc/actions/commands/insert.ts 169ms
src/actions/include-all.tssrc/actions/include-all.ts 10ms
src/actions/motion.tssrc/actions/motion.ts 406ms
src/actions/operator.tssrc/actions/operator.ts 202ms
src/actions/plugins/easymotion/easymotion.cmd.tssrc/actions/plugins/easymotion/easymotion.cmd.ts 88ms
src/actions/plugins/easymotion/easymotion.tssrc/actions/plugins/easymotion/easymotion.ts 79ms
src/actions/plugins/easymotion/markerGenerator.tssrc/actions/plugins/easymotion/markerGenerator.ts 16ms
src/actions/plugins/easymotion/registerMoveActions.tssrc/actions/plugins/easymotion/registerMoveActions.ts 47ms
src/actions/plugins/easymotion/types.tssrc/actions/plugins/easymotion/types.ts 6ms
src/actions/plugins/surround.tssrc/actions/plugins/surround.ts 150ms
src/actions/textobject.tssrc/actions/textobject.ts 230ms
src/cmd_line/commandLine.tssrc/cmd_line/commandLine.ts 17ms
src/cmd_line/commands/close.tssrc/cmd_line/commands/close.ts 12ms
src/cmd_line/commands/deleteRange.tssrc/cmd_line/commands/deleteRange.ts 27ms
src/cmd_line/commands/file.tssrc/cmd_line/commands/file.ts 31ms
src/cmd_line/commands/nohl.tssrc/cmd_line/commands/nohl.ts 5ms
src/cmd_line/commands/only.tssrc/cmd_line/commands/only.ts 20ms
src/cmd_line/commands/quit.tssrc/cmd_line/commands/quit.ts 32ms
src/cmd_line/commands/read.tssrc/cmd_line/commands/read.ts 23ms
src/cmd_line/commands/register.tssrc/cmd_line/commands/register.ts 16ms
src/cmd_line/commands/setoptions.tssrc/cmd_line/commands/setoptions.ts 11ms
src/cmd_line/commands/sort.tssrc/cmd_line/commands/sort.ts 15ms
src/cmd_line/commands/substitute.tssrc/cmd_line/commands/substitute.ts 46ms
src/cmd_line/commands/tab.tssrc/cmd_line/commands/tab.ts 15ms
src/cmd_line/commands/wall.tssrc/cmd_line/commands/wall.ts 4ms
src/cmd_line/commands/write.tssrc/cmd_line/commands/write.ts 17ms
src/cmd_line/commands/writequit.tssrc/cmd_line/commands/writequit.ts 18ms
src/cmd_line/commands/writequitall.tssrc/cmd_line/commands/writequitall.ts 15ms
src/cmd_line/lexer.tssrc/cmd_line/lexer.ts 67ms
src/cmd_line/node.tssrc/cmd_line/node.ts 30ms
src/cmd_line/parser.tssrc/cmd_line/parser.ts 14ms
src/cmd_line/scanner.tssrc/cmd_line/scanner.ts 33ms
src/cmd_line/subparser.tssrc/cmd_line/subparser.ts 8ms
src/cmd_line/subparsers/close.tssrc/cmd_line/subparsers/close.ts 4ms
src/cmd_line/subparsers/deleteRange.tssrc/cmd_line/subparsers/deleteRange.ts 2ms
src/cmd_line/subparsers/file.tssrc/cmd_line/subparsers/file.ts 6ms
src/cmd_line/subparsers/nohl.tssrc/cmd_line/subparsers/nohl.ts 2ms
src/cmd_line/subparsers/only.tssrc/cmd_line/subparsers/only.ts 1ms
src/cmd_line/subparsers/quit.tssrc/cmd_line/subparsers/quit.ts 6ms
src/cmd_line/subparsers/read.tssrc/cmd_line/subparsers/read.ts 10ms
src/cmd_line/subparsers/register.tssrc/cmd_line/subparsers/register.ts 3ms
src/cmd_line/subparsers/setoptions.tssrc/cmd_line/subparsers/setoptions.ts 14ms
src/cmd_line/subparsers/sort.tssrc/cmd_line/subparsers/sort.ts 3ms
src/cmd_line/subparsers/substitute.tssrc/cmd_line/subparsers/substitute.ts 32ms
src/cmd_line/subparsers/tab.tssrc/cmd_line/subparsers/tab.ts 11ms
src/cmd_line/subparsers/wall.tssrc/cmd_line/subparsers/wall.ts 4ms
src/cmd_line/subparsers/write.tssrc/cmd_line/subparsers/write.ts 8ms
src/cmd_line/subparsers/writequit.tssrc/cmd_line/subparsers/writequit.ts 6ms
src/cmd_line/subparsers/writequitall.tssrc/cmd_line/subparsers/writequitall.ts 3ms
src/cmd_line/token.tssrc/cmd_line/token.ts 4ms
src/common/matching/matcher.tssrc/common/matching/matcher.ts 37ms
src/common/matching/quoteMatcher.tssrc/common/matching/quoteMatcher.ts 6ms
src/common/matching/tagMatcher.tssrc/common/matching/tagMatcher.ts 12ms
src/common/motion/position.tssrc/common/motion/position.ts 278ms
src/common/motion/range.tssrc/common/motion/range.ts 23ms
src/common/number/numericString.tssrc/common/number/numericString.ts 13ms
src/configuration/configuration.tssrc/configuration/configuration.ts 68ms
src/configuration/decoration.tssrc/configuration/decoration.ts 4ms
src/configuration/notation.tssrc/configuration/notation.ts 8ms
src/configuration/remapper.tssrc/configuration/remapper.ts 45ms
src/editorIdentity.tssrc/editorIdentity.ts 7ms
src/error.tssrc/error.ts 13ms
src/globals.tssrc/globals.ts 2ms
src/history/historyTracker.tssrc/history/historyTracker.ts 121ms
src/mode/mode.tssrc/mode/mode.ts 8ms
src/mode/modeHandler.tssrc/mode/modeHandler.ts 247ms
src/mode/modeHandlerMap.tssrc/mode/modeHandlerMap.ts 7ms
src/mode/modes.tssrc/mode/modes.ts 13ms
src/neovim/nvimUtil.tssrc/neovim/nvimUtil.ts 46ms
src/register/register.tssrc/register/register.ts 72ms
src/state/globalState.tssrc/state/globalState.ts 11ms
src/state/recordedState.tssrc/state/recordedState.ts 23ms
src/state/replaceState.tssrc/state/replaceState.ts 4ms
src/state/searchState.tssrc/state/searchState.ts 36ms
src/state/vimState.tssrc/state/vimState.ts 27ms
src/statusBar.tssrc/statusBar.ts 8ms
src/taskQueue.tssrc/taskQueue.ts 14ms
src/textEditor.tssrc/textEditor.ts 46ms
src/transformations/transformations.tssrc/transformations/transformations.ts 17ms
src/util.tssrc/util.ts 9ms
test/actions/baseAction.test.tstest/actions/baseAction.test.ts 34ms
test/cmd_line/lexer.test.tstest/cmd_line/lexer.test.ts 40ms
test/cmd_line/parser.test.tstest/cmd_line/parser.test.ts 8ms
test/cmd_line/scanner.test.tstest/cmd_line/scanner.test.ts 17ms
test/cmd_line/sort.test.tstest/cmd_line/sort.test.ts 9ms
test/cmd_line/subparser.close.test.tstest/cmd_line/subparser.close.test.ts 7ms
test/cmd_line/subparser.quit.test.tstest/cmd_line/subparser.quit.test.ts 15ms
test/cmd_line/subparser.substitute.test.tstest/cmd_line/subparser.substitute.test.ts 5ms
test/cmd_line/subparser.test.tstest/cmd_line/subparser.test.ts 13ms
test/cmd_line/substitute.test.tstest/cmd_line/substitute.test.ts 66ms
test/cmd_line/vsplit.test.tstest/cmd_line/vsplit.test.ts 7ms
test/cmd_line/writequit.test.tstest/cmd_line/writequit.test.ts 14ms
test/configuration/notation.test.tstest/configuration/notation.test.ts 6ms
test/error.test.tstest/error.test.ts 5ms
test/extension.test.tstest/extension.test.ts 8ms
test/index.tstest/index.ts 4ms
test/macro.test.tstest/macro.test.ts 14ms
test/mode/modeHandler.test.tstest/mode/modeHandler.test.ts 7ms
test/mode/modeHandlerMap.test.tstest/mode/modeHandlerMap.test.ts 11ms
test/mode/modeInsert.test.tstest/mode/modeInsert.test.ts 58ms
test/mode/modeNormal.test.tstest/mode/modeNormal.test.ts 338ms
test/mode/modeReplace.test.tstest/mode/modeReplace.test.ts 9ms
test/mode/modeVisual.test.tstest/mode/modeVisual.test.ts 208ms
test/mode/modeVisualBlock.test.tstest/mode/modeVisualBlock.test.ts 81ms
test/mode/modeVisualLine.test.tstest/mode/modeVisualLine.test.ts 187ms
test/mode/normalModeTests/commands.test.tstest/mode/normalModeTests/commands.test.ts 92ms
test/mode/normalModeTests/dot.test.tstest/mode/normalModeTests/dot.test.ts 20ms
test/mode/normalModeTests/motions.test.tstest/mode/normalModeTests/motions.test.ts 114ms
test/motion.test.tstest/motion.test.ts 137ms
test/number/numericString.test.tstest/number/numericString.test.ts 4ms
test/operator/comment.test.tstest/operator/comment.test.ts 5ms
test/operator/put.test.tstest/operator/put.test.ts 5ms
test/operator/shift.test.tstest/operator/shift.test.ts 6ms
test/plugins/easymotion.test.tstest/plugins/easymotion.test.ts 22ms
test/plugins/surround.test.tstest/plugins/surround.test.ts 19ms
test/register/register.test.tstest/register/register.test.ts 17ms
test/register/repeatableMovement.test.tstest/register/repeatableMovement.test.ts 4ms
test/testSimplifier.tstest/testSimplifier.ts 46ms
test/testUtils.tstest/testUtils.ts 18ms
test/textEditor.test.tstest/textEditor.test.ts 11ms
typings/custom/promised-neovim-client.d.tstypings/custom/promised-neovim-client.d.ts 93ms

@@ -31,15 +31,22 @@ class StatusBarClass implements vscode.Disposable {
}
}

public SetColor(color: string) {
public SetColor(background: string, foreground?: string) {
const currentColorCustomizations = vscode.workspace
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you call Configuration.getConfiguration here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean instead of calling vscode.workspace.getConfiguration('workbench').get('colorCustomizations') I should use something like Configuration.getConfiguration('workspace').get('colorCustomizations')? (not able to look up the exact syntax right now :)). If so, then it should be used when updating the configuration as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually scratch that, I realize this fx is not exposed in IConfiguration.

src/statusBar.ts Outdated
};
if (foreground !== undefined) {
newColorCustomizations['statusBar.foreground'] = `${foreground}`;
} else if (currentColorCustomizations !== undefined && 'statusBar.foreground' in currentColorCustomizations) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be sufficient to only have an else, and run delete currentColorCustomizations['statusBar.foreground']; if foreground is undefined.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would result in [ts] Object is possibly 'undefined'.

Copy link
Member

@jpoon jpoon Feb 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I realized that the delete will modify the object, but won't actually update it with VSCode.

This should be better:

  public SetColor(background: string, foreground?: string) {
    const currentColorCustomizations = vscode.workspace
      .getConfiguration('workbench')
      .get('colorCustomizations');

    let colorCustomizations = Object.assign(currentColorCustomizations, {
      'statusBar.background': `${background}`,
      'statusBar.noFolderBackground': `${background}`,
      'statusBar.debuggingBackground': `${background}`,
    });

    if (foreground === undefined) {
      delete colorCustomizations['statusBar.foreground'];
    } else {
      colorCustomizations['statusBar.foreground'] = `${foreground}`;
    }

    vscode.workspace
      .getConfiguration('workbench')
      .update('colorCustomizations', colorCustomizations, true);
  }

@jpoon jpoon self-requested a review January 31, 2018 20:44
Copy link
Member

@jpoon jpoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on. Can you address CI failures?

@mgor
Copy link
Contributor Author

mgor commented Feb 2, 2018

Sorry for late response, I have had a hectic week. I'll fix it during the weekend, when my additional questions has been cleared out.

@mgor mgor force-pushed the statusbar-foreground branch 2 times, most recently from 479bdb6 to 5c8b17c Compare February 2, 2018 19:16
Basically a reimplementation of pull#2102. Updated
documentation to include instructions on how colors are set.
@jpoon
Copy link
Member

jpoon commented Feb 15, 2018

Sorry for taking so long to merge this in. Still on vacation. I'll merge as soon as this new build passes CI.

@jpoon jpoon merged commit f490de5 into VSCodeVim:master Feb 15, 2018
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants