From e9c40fa8513b5e3548881420e084cacba1f7390b Mon Sep 17 00:00:00 2001 From: xevidos Date: Tue, 23 Apr 2019 14:00:07 -0400 Subject: [PATCH] Fixed issue where mouse position was set too often resulting in periodical line jumping. --- components/active/init.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/components/active/init.js b/components/active/init.js index 6ad3440..7269a96 100755 --- a/components/active/init.js +++ b/components/active/init.js @@ -399,19 +399,21 @@ this.highlightEntry(path, moveToTabList); if(path != this.getPath()) { + codiad.editor.setSession(this.sessions[path]); this.history.push(path); - $.get(this.controller, {'action':'focused', 'path':path}); + $.get(this.controller, {'action':'focused', 'path':path}, function() { + + if( ! ( this.positions[`${path}`] === undefined ) ) { + + this.setPosition( this.positions[`${path}`] ); + } + }); } /* Check for users registered on the file. */ this.check(path); - if( ! ( this.positions[`${path}`] === undefined ) ) { - - this.setPosition( this.positions[`${path}`] ); - } - /* Notify listeners. */ amplify.publish('active.onFocus', path); },