feat: enhanced status bar with word count, char count, line/col, encoding

- Restructured status bar into left/right sections with separators
- Added character count, cursor line/column position, encoding, and language mode indicators
- Added cursor position tracking via CodeMirror onUpdate callback
- Added file path display that updates on tab switch
- Simplified word count display for cleaner status bar layout
This commit is contained in:
2026-03-04 15:50:31 +05:30
parent affe1a7e33
commit 37502fb733
4 changed files with 67 additions and 25 deletions
+5
View File
@@ -43,6 +43,7 @@ const { oneDark } = require('@codemirror/theme-one-dark');
* @param {Object} options
* @param {string} options.content - initial document content (default '')
* @param {Function} options.onChange - called with new content string on every doc change
* @param {Function} options.onUpdate - called with the EditorView on every update (selection, doc change, etc.)
* @param {boolean} options.isDark - apply oneDark theme when true (default false)
* @param {boolean} options.showLineNumbers - show line-number gutter (default true)
* @returns {EditorView} the created editor view
@@ -51,6 +52,7 @@ function createEditor(parentElement, options = {}) {
const {
content = '',
onChange = () => {},
onUpdate = null,
isDark = false,
showLineNumbers = true,
} = options;
@@ -76,6 +78,9 @@ function createEditor(parentElement, options = {}) {
if (update.docChanged) {
onChange(update.state.doc.toString());
}
if (onUpdate && (update.docChanged || update.selectionSet)) {
onUpdate(update.view);
}
}),
EditorView.lineWrapping,
];