-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shellvars: fix insertion at top of file that starts with blank lines
Possible blank lines at the start of a file were mapped with Util.empty which produces empty 'hidden' nodes (nodes with NULL label and value) This causes problem when a user inserts something before these nodes, for example with "insert 'foo' before /*[1]". Even though the nodes that Util.empty produces are generally hidden from the user, they are still in the tree and /*[1] selects such a node. The resulting tree has a hidden node in the middle, something that Shellvars.lns does not allow and therefore putting this tree fails. This is really hard to understand for users as the tree they see with 'print' is indistinguishable from one that doesn't have these hidden nodes. To fix this, the changed lens simply deletes the blank lines at the beginning of the file without creating any tree nodes. This makes the above insertion work at the cost of losing these blank lines as soon as anything is inserted into or deleted from the file. Fixes #202
- Loading branch information
Showing
3 changed files
with
34 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters