mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-13 08:44:12 +03:00
Add opened files and folders to recent documents menu
This commit is contained in:
parent
7c9d32d8d6
commit
948aaa0652
@ -109,6 +109,9 @@ class ApplicationDelegate
|
||||
setRepresentedFilename: (filename) ->
|
||||
ipc.send("call-window-method", "setRepresentedFilename", filename)
|
||||
|
||||
addRecentDocument: (filename) ->
|
||||
ipc.send("add-recent-document", filename)
|
||||
|
||||
setRepresentedDirectoryPaths: (paths) ->
|
||||
loadSettings = getWindowLoadSettings()
|
||||
loadSettings['initialPaths'] = paths
|
||||
|
@ -885,7 +885,9 @@ class AtomEnvironment extends Model
|
||||
else
|
||||
@project.addPath(pathToOpen)
|
||||
|
||||
unless fs.isDirectorySync(pathToOpen)
|
||||
if fs.isDirectorySync(pathToOpen)
|
||||
@applicationDelegate.addRecentDocument(pathToOpen)
|
||||
else
|
||||
@workspace?.open(pathToOpen, {initialLine, initialColumn})
|
||||
|
||||
return
|
||||
|
@ -281,6 +281,9 @@ class AtomApplication
|
||||
ipc.on 'write-to-stderr', (event, output) ->
|
||||
process.stderr.write(output)
|
||||
|
||||
ipc.on 'add-recent-document', (event, filename) ->
|
||||
app.addRecentDocument(filename)
|
||||
|
||||
setupDockMenu: ->
|
||||
if process.platform is 'darwin'
|
||||
dockMenu = Menu.buildFromTemplate [
|
||||
|
@ -488,6 +488,9 @@ class Workspace extends Model
|
||||
if initialLine >= 0 or initialColumn >= 0
|
||||
item.setCursorBufferPosition?([initialLine, initialColumn])
|
||||
|
||||
path = item.getPath?()
|
||||
@applicationDelegate.addRecentDocument(path) if path?
|
||||
|
||||
index = pane.getActiveItemIndex()
|
||||
@emitter.emit 'did-open', {uri, pane, item, index}
|
||||
item
|
||||
|
Loading…
Reference in New Issue
Block a user