File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -1293,6 +1293,15 @@ const Buffer = Module("buffer", {
1293
1293
if ( filename ) {
1294
1294
let file = io . File ( filename ) ;
1295
1295
1296
+ if ( file . exists ( ) && file . isDirectory ( ) ) {
1297
+ if ( doc . doctype !== null ) {
1298
+ filename = OS . Path . join ( filename , document . title + ".html" ) ;
1299
+ } else {
1300
+ filename = OS . Path . join ( filename , filename = doc . location . pathname . split ( "/" ) . pop ( ) ) ;
1301
+ }
1302
+ file = io . File ( filename )
1303
+ }
1304
+
1296
1305
liberator . assert ( ! file . exists ( ) || args . bang , "File exists (add ! to override)" ) ;
1297
1306
1298
1307
chosenData = { file : file , uri : window . makeURI ( doc . location . href , doc . characterSet ) } ;
Original file line number Diff line number Diff line change @@ -470,11 +470,12 @@ have the following possibilities:
470
470
471
471
<item >
472
472
<tags >:w :write :sav :saveas</tags >
473
- <spec >:sav<oa >eas</oa ><oa >!</oa > <oa >file</oa ></spec >
473
+ <spec >:sav<oa >eas</oa ><oa >!</oa > <oa >file|directory </oa ></spec >
474
474
<description >
475
475
<p >
476
- Save current web page to disk. If <oa >file</oa > is omitted, save to the page's
477
- default filename. Existing documents will only be overwritten if <oa >!</oa > is given.
476
+ Save current web page to disk. If <oa >file</oa > is omitted, or a <oa >directory</oa >
477
+ is given save to the page's default filename. Existing documents will only be overwritten
478
+ if <oa >!</oa > is given.
478
479
</p >
479
480
</description >
480
481
</item >
Original file line number Diff line number Diff line change 3
3
* new: support <label> for <input type=file>
4
4
* new: fire 'change' event on file upload
5
5
* fix search highlighting (hlsearch) in firefox 51
6
+ * allow passing a <directory> to `:w` instead of a complete <file>
6
7
* fix ssl icon in statusbar
7
8
* fix "preferences" button in Firefox add-ons page
8
9
* disable urlseparator by default as its unexpected behaviour irritates users
You can’t perform that action at this time.
0 commit comments