Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.1.11: Bug Fixes #54

Merged
merged 6 commits into from
Jun 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 0.1.11

- Fixed undo operation for the _insert_ and _rename_ commands (Some other commands may still need fixes to their 'undo' support)
- Fixed crashing but when editing body pane under Leo 6.2

## 0.1.10

- Added more [welcome content](https://code.visualstudio.com/api/extension-guides/tree-view#welcome-content) in outlines panes that have not yet opened a tree for starting a server, connecting to it, and added content to help with automation settings.
Expand Down
30 changes: 22 additions & 8 deletions leoInteg.leo
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,15 @@
</vnodes>
<tnodes>
<t tx="felix.20190922171916.2">@doc
I should have started self documentation here from the start in august!
I should have started self documentation here from the start in august!

# TODO : Offer 'Real Clipboard' operations, instead of leo's 'internal' clipboard behavior -
# Note : ('Real Clipboard') Use globals.gui.clipboard and the real clipboard with g.app.gui.getTextFromClipboard()
# Note : ('Real Clipboard') For pasting, use g.app.gui.replaceClipboardWith(p_realClipboard)</t>
This Leo file will contain all of the source for the Visual Studio Code Leo Integration Extension

For now, it contains the 'Leo bridge server' script, as the first leonine source of this project.

To contribute, see the official issues page for current list of 'TODO's at https://github.com/boltex/leointeg/issues

</t>
<t tx="felix.20191126232434.10">def outputPNode(self, p_node=False):
if p_node:
return self.sendLeoBridgePackage("node", self.p_to_ap(p_node)) # Single node, singular
Expand Down Expand Up @@ -250,6 +254,8 @@ if __name__ == '__main__':
</t>
<t tx="felix.20191126232434.21">def setNewBody(self, p_body):
'''Change Body of selected node'''
# TODO : This method is unused for now? Remove if unnecessary.
# TODO : Does this support 'Undo'?
if(self.commander.p):
self.commander.p.b = p_body['body']
return self.outputPNode(self.commander.p)
Expand All @@ -261,9 +267,9 @@ if __name__ == '__main__':
'''Change Body text of a node'''
for w_p in self.commander.all_positions():
if w_p.v.gnx == p_package['gnx']: # found
b = self.commander.undoer.beforeChangeNodeContents(w_p, oldYScroll=0) # setup undoable operation
w_bunch = self.commander.undoer.beforeChangeNodeContents(w_p) # setup undoable operation
w_p.v.setBodyString(p_package['body'])
self.commander.undoer.afterChangeNodeContents(w_p, command="set-body", bunch=b, dirtyVnodeList=[w_p.v])
self.commander.undoer.afterChangeNodeContents(w_p, "Body Text", w_bunch)
if not w_p.v.isDirty():
w_p.setDirty()
break
Expand All @@ -278,7 +284,9 @@ if __name__ == '__main__':
w_p = self.ap_to_p(w_ap)
if w_p:
# set this node's new headline
w_bunch = self.commander.undoer.beforeChangeNodeContents(w_p)
w_p.h = w_newHeadline
self.commander.undoer.afterChangeNodeContents(w_p, 'Change Headline', w_bunch)
return self.outputPNode(w_p)
else:
return self.outputError("Error in setNewHeadline")
Expand Down Expand Up @@ -520,7 +528,7 @@ if __name__ == '__main__':
# ! functions called this way need to accept at least a parameter other than 'self'
# ! See : getSelectedNode and getAllGnx
# TODO : Block functions starting with underscore or reserved
answer = getattr(integController, w_param['action'])(w_param['param'])
answer = getattr(integController, w_param['action'])(w_param['param']) # Crux
else:
answer = "Error in processCommand"
print(answer)
Expand Down Expand Up @@ -565,7 +573,10 @@ if __name__ == '__main__':
if(p_ap):
w_p = self.ap_to_p(p_ap)
if w_p:
w_bunch = self.commander.undoer.beforeInsertNode(w_p)
w_newNode = w_p.insertAfter()
w_newNode.setDirty()
self.commander.undoer.afterInsertNode(w_newNode, 'Insert Node', w_bunch)
self.commander.selectPosition(w_newNode)
return self.outputPNode(self.commander.p) # in both cases, return selected node
else:
Expand Down Expand Up @@ -796,10 +807,13 @@ wsPort = 32125
if(w_ap):
w_p = self.ap_to_p(w_ap)
if w_p:
w_u = self.commander.undoer.beforeInsertNode(w_p)
w_newNode = w_p.insertAfter()
self.commander.selectPosition(w_newNode)
# set this node's new headline
w_newNode.h = w_newHeadline
w_newNode.setDirty()
self.commander.undoer.afterInsertNode(w_newNode, 'Insert Node', w_u)
self.commander.selectPosition(w_newNode)
return self.outputPNode(self.commander.p) # in any case, return selected node
else:
return self.outputError("Error in insertNamedPNode no w_p node found") # default empty
Expand Down
18 changes: 14 additions & 4 deletions leobridgeserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,10 @@ def insertPNode(self, p_ap):
if(p_ap):
w_p = self.ap_to_p(p_ap)
if w_p:
w_bunch = self.commander.undoer.beforeInsertNode(w_p)
w_newNode = w_p.insertAfter()
w_newNode.setDirty()
self.commander.undoer.afterInsertNode(w_newNode, 'Insert Node', w_bunch)
self.commander.selectPosition(w_newNode)
return self.outputPNode(self.commander.p) # in both cases, return selected node
else:
Expand All @@ -693,10 +696,13 @@ def insertNamedPNode(self, p_apHeadline):
if(w_ap):
w_p = self.ap_to_p(w_ap)
if w_p:
w_u = self.commander.undoer.beforeInsertNode(w_p)
w_newNode = w_p.insertAfter()
self.commander.selectPosition(w_newNode)
# set this node's new headline
w_newNode.h = w_newHeadline
w_newNode.setDirty()
self.commander.undoer.afterInsertNode(w_newNode, 'Insert Node', w_u)
self.commander.selectPosition(w_newNode)
return self.outputPNode(self.commander.p) # in any case, return selected node
else:
return self.outputError("Error in insertNamedPNode no w_p node found") # default empty
Expand Down Expand Up @@ -854,6 +860,8 @@ def getBodyLength(self, p_gnx):

def setNewBody(self, p_body):
'''Change Body of selected node'''
# TODO : This method is unused for now? Remove if unnecessary.
# TODO : Does this support 'Undo'?
if(self.commander.p):
self.commander.p.b = p_body['body']
return self.outputPNode(self.commander.p)
Expand All @@ -864,9 +872,9 @@ def setBody(self, p_package):
'''Change Body text of a node'''
for w_p in self.commander.all_positions():
if w_p.v.gnx == p_package['gnx']: # found
b = self.commander.undoer.beforeChangeNodeContents(w_p, oldYScroll=0) # setup undoable operation
w_bunch = self.commander.undoer.beforeChangeNodeContents(w_p) # setup undoable operation
w_p.v.setBodyString(p_package['body'])
self.commander.undoer.afterChangeNodeContents(w_p, command="set-body", bunch=b, dirtyVnodeList=[w_p.v])
self.commander.undoer.afterChangeNodeContents(w_p, "Body Text", w_bunch)
if not w_p.v.isDirty():
w_p.setDirty()
break
Expand All @@ -880,7 +888,9 @@ def setNewHeadline(self, p_apHeadline):
w_p = self.ap_to_p(w_ap)
if w_p:
# set this node's new headline
w_bunch = self.commander.undoer.beforeChangeNodeContents(w_p)
w_p.h = w_newHeadline
self.commander.undoer.afterChangeNodeContents(w_p, 'Change Headline', w_bunch)
return self.outputPNode(w_p)
else:
return self.outputError("Error in setNewHeadline")
Expand Down Expand Up @@ -1069,7 +1079,7 @@ async def leoBridgeServer(websocket, path):
# ! functions called this way need to accept at least a parameter other than 'self'
# ! See : getSelectedNode and getAllGnx
# TODO : Block functions starting with underscore or reserved
answer = getattr(integController, w_param['action'])(w_param['param'])
answer = getattr(integController, w_param['action'])(w_param['param']) # Crux
else:
answer = "Error in processCommand"
print(answer)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "leointeg",
"displayName": "Leo Editor Integration with Visual Studio Code",
"description": "Use Leo, the literate editor with outline, directly in vscode.",
"version": "0.1.10",
"version": "0.1.11",
"author": {
"name": "Félix"
},
Expand All @@ -13,7 +13,7 @@
"url": "https://github.com/boltex/leointeg"
},
"engines": {
"vscode": "^1.45.1"
"vscode": "^1.46.0"
},
"keywords": [
"leo",
Expand Down
4 changes: 2 additions & 2 deletions src/webviews/apps/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ <h1>Leo<span class="header__logo--highlight">Integ</span></h1>
<section id="welcome"
class="section--full mb-0">
<h2 class="section__title section__title--primary">
Welcome to <span class="highlight">LeoInteg 0.1.10</span>
Welcome to <span class="highlight">LeoInteg 0.1.11</span>
</h2>
<div class="center mt-1">
<a class="button button--flat"
title="LeoInteg's Features"
href="https://github.com/boltex/leointeg#features">
See What's New in LeoInteg 0.1.10
See What's New in LeoInteg 0.1.11
</a>
</div>
<p class="blurb center ml-0 mr-0">
Expand Down