Skip to content

Instantly share code, notes, and snippets.

View vickylance's full-sized avatar
🎧
Chilling and slapping on the keyboard until the world makes sense

Vignesh S vickylance

🎧
Chilling and slapping on the keyboard until the world makes sense
View GitHub Profile
var lastActiveElement = document.activeElement;
function setCaretPosition(elem, caretPos) {
if (elem != null) {
if (elem.createTextRange) {
var range = elem.createTextRange();
range.move("character", caretPos);
range.select();
} else {
if (elem.selectionStart) {
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
{
name: ""
}