Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/utils/__tests__/powerline-settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ describe('powerline settings helpers', () => {
expect(updated.powerline.theme).toBe('catppuccin');
});

it('keeps a custom theme when enabling powerline again', () => {
const settings = {
...DEFAULT_SETTINGS,
powerline: {
...DEFAULT_SETTINGS.powerline,
enabled: false,
theme: 'custom'
}
};

const updated = buildEnabledPowerlineSettings(settings);
expect(updated.powerline.theme).toBe('custom');
});

it('keeps manual separators alongside flex separators when enabling', () => {
const line: WidgetItem[] = [
{ id: '1', type: 'model' },
Expand Down
4 changes: 3 additions & 1 deletion src/utils/powerline-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import type { Settings } from '../types/Settings';

import { getDefaultPowerlineTheme } from './colors';

// Only a first enable has no theme yet. 'custom' is chosen in the Themes menu,
// which is open only while Powerline is enabled, so it is kept.
function resolveEnabledPowerlineTheme(theme: string | undefined): string {
if (!theme || theme === 'custom') {
if (!theme) {
return getDefaultPowerlineTheme();
}

Expand Down
Loading