From 5501acff354c63151d950aac628b54a0c9ca3a42 Mon Sep 17 00:00:00 2001 From: mbroedl Date: Mon, 26 Feb 2018 19:45:33 +0000 Subject: [PATCH] show words and characters of section in title put words and characters of the section in the html-title element so that it shows on hover --- lib/outline-tree.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/outline-tree.js b/lib/outline-tree.js index 4ba8dd2..c8f5905 100644 --- a/lib/outline-tree.js +++ b/lib/outline-tree.js @@ -69,6 +69,14 @@ class OutlineTreeView { let iconClass = `icon ${this.icon}`; let itemClass = `list-nested-item list-selectable-item ${this.highlight}`; let itemId = `document-outline-${this.startRow}-${this.endRow}`; + const editor = atom.workspace.getActiveTextEditor(); + let text = editor.getTextInBufferRange([[this.startRow -1,0],[this.endRow -1,0]]); + let title = '' + if (text) { + let wordcount = text.match(/\S+/g).length; + let charcount = text.length - 1; + title = wordcount + " W | " + charcount + " C"; + } return
- {this.plainText}