mirror of
https://github.com/VSCodeVim/Vim.git
synced 2024-09-11 12:25:59 +03:00
Merge pull request #2889 from xconverge/change-commandline-history-location
Move commandline history to XDG_CACHE_HOME or %APPDATA%
This commit is contained in:
commit
e295565ec3
@ -600,9 +600,11 @@
|
||||
"postinstall": "node ./node_modules/vscode/bin/install"
|
||||
},
|
||||
"dependencies": {
|
||||
"appdirectory": "0.1.0",
|
||||
"clipboardy": "1.2.3",
|
||||
"diff-match-patch": "1.0.1",
|
||||
"lodash": "4.17.10",
|
||||
"mkdirp": "0.5.1",
|
||||
"neovim-client": "2.1.0",
|
||||
"promised-neovim-client": "2.0.2",
|
||||
"untildify": "3.0.3",
|
||||
|
@ -3,6 +3,8 @@ import * as path from 'path';
|
||||
import { configuration } from '../configuration/configuration';
|
||||
import { logger } from '../util/logger';
|
||||
|
||||
const mkdirp = require('mkdirp');
|
||||
|
||||
export class CommandLineHistory {
|
||||
private static readonly _historyFileName = '.cmdline_history';
|
||||
private _historyDir: string;
|
||||
@ -59,7 +61,7 @@ export class CommandLineHistory {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
try {
|
||||
if (!fs.existsSync(this._historyDir)) {
|
||||
fs.mkdirSync(this._historyDir, 0o775);
|
||||
mkdirp.sync(this._historyDir, 0o775);
|
||||
}
|
||||
} catch (err) {
|
||||
logger.error(
|
||||
|
@ -5,6 +5,8 @@ import { Position } from '../common/motion/position';
|
||||
import { Range } from '../common/motion/range';
|
||||
import { logger } from './logger';
|
||||
|
||||
const AppDirectory = require('appdirectory');
|
||||
|
||||
/**
|
||||
* This is certainly quite janky! The problem we're trying to solve
|
||||
* is that writing editor.selection = new Position() won't immediately
|
||||
@ -38,5 +40,8 @@ export async function getCursorsAfterSync(timeout: number = 0): Promise<Range[]>
|
||||
}
|
||||
|
||||
export function getExtensionDirPath(): string {
|
||||
return path.join(os.homedir(), '.VSCodeVim');
|
||||
const dirs = new AppDirectory('VSCodeVim');
|
||||
logger.debug("VSCodeVim Cache Directory: " + dirs.userCache());
|
||||
|
||||
return dirs.userCache();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user