File tree Expand file tree Collapse file tree 5 files changed +23
-5
lines changed Expand file tree Collapse file tree 5 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -1095,6 +1095,12 @@ const Buffer = Module("buffer", {
10951095
10961096 scrollVertical : function scrollVertical ( elem , increment , number ) {
10971097 elem = elem || Buffer . findScrollable ( number , false ) ;
1098+
1099+ if ( elem == null && buffer . loaded == 0 ) {
1100+ liberator . echoerr ( "Page is still loading" ) ;
1101+ return ;
1102+ }
1103+
10981104 let fontSize = parseInt ( util . computedStyle ( elem ) . fontSize ) ;
10991105 if ( increment == "lines" )
11001106 increment = fontSize ;
@@ -1108,6 +1114,12 @@ const Buffer = Module("buffer", {
11081114
11091115 scrollHorizontal : function scrollHorizontal ( elem , increment , number ) {
11101116 elem = elem || Buffer . findScrollable ( number , true ) ;
1117+
1118+ if ( elem == null && buffer . loaded == 0 ) {
1119+ liberator . echoerr ( "Page is still loading" ) ;
1120+ return ;
1121+ }
1122+
11111123 let fontSize = parseInt ( util . computedStyle ( elem ) . fontSize ) ;
11121124 if ( increment == "columns" )
11131125 increment = fontSize ; // Good enough, I suppose.
Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ const Command = Class("Command", {
155155 action : null ,
156156 /**
157157 * @property {string } This command's argument count spec.
158- * @see Commands#parseArguments
158+ * @see Commands#parseArgs
159159 */
160160 argCount : 0 ,
161161 /**
@@ -167,7 +167,7 @@ const Command = Class("Command", {
167167 hereDoc : false ,
168168 /**
169169 * @property {Array } The options this command takes.
170- * @see Commands@parseArguments
170+ * @see Commands@parseArgs
171171 */
172172 options : [ ] ,
173173 /**
Original file line number Diff line number Diff line change @@ -1098,7 +1098,7 @@ const Events = Module("events", {
10981098
10991099 onKeyUpOrDown : function ( event ) {
11001100 // Always let the event be handled by the webpage/Firefox for certain modes
1101- if ( modes . passNextKey || modes . isMenuShown )
1101+ if ( modes . isMenuShown )
11021102 return ;
11031103
11041104 let key = events . toString ( event ) ;
@@ -1115,6 +1115,11 @@ const Events = Module("events", {
11151115 // Many sites perform (useful) actions on keydown.
11161116 // Let's keep the most common ones unless we have a mapping for that
11171117 if ( event . type == "keydown" && this . isEscapeKey ( key ) ) {
1118+ if ( modes . passNextKey ) {
1119+ modes . passNextKey = false ;
1120+ return ;
1121+ }
1122+
11181123 this . onEscape ( ) ; // We do our Escape handling here, as the on "onKeyPress" may not always work if websites override the keydown event
11191124 event . stopPropagation ( ) ;
11201125 return ;
Original file line number Diff line number Diff line change @@ -349,7 +349,7 @@ const Mappings = Module("mappings", {
349349 */
350350 hasMap : function ( mode , cmd , patternOrUrl ) {
351351 let self = this ;
352- this . _user [ mode ] . some ( function ( map ) map . hasName ( cmd ) && self . _matchingUrlsTest ( map , patternOrUrl ) ) ;
352+ return this . _user [ mode ] . some ( function ( map ) map . hasName ( cmd ) && self . _matchingUrlsTest ( map , patternOrUrl ) ) ;
353353 } ,
354354
355355 /**
Original file line number Diff line number Diff line change @@ -717,7 +717,8 @@ const Tabs = Module("tabs", {
717717 commands . add ( [ "tabd[o]" , "bufd[o]" ] ,
718718 "Execute a command in each tab" ,
719719 function ( args ) {
720- for ( let i = 0 ; i < tabs . count ; i ++ ) {
720+ let count = tabs . count ;
721+ for ( let i = 0 ; i < Math . min ( tabs . count , count ) ; i ++ ) {
721722 tabs . select ( i ) ;
722723 liberator . execute ( args . string , null , true ) ;
723724 }
You can’t perform that action at this time.
0 commit comments