suplemon-editor 0.3.0__tar.gz → 0.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. {suplemon_editor-0.3.0/suplemon_editor.egg-info → suplemon_editor-0.3.2}/PKG-INFO +24 -2
  2. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/README.md +23 -1
  3. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/cursor.py +1 -1
  4. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/help.py +4 -4
  5. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/helpers.py +1 -1
  6. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/lexer.py +25 -5
  7. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/main.py +1 -1
  8. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/module_loader.py +1 -1
  9. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/autodocstring.py +2 -2
  10. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/linter.py +1 -1
  11. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/prompt.py +2 -2
  12. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/suplemon_module.py +1 -1
  13. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/viewer.py +8 -8
  14. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2/suplemon_editor.egg-info}/PKG-INFO +24 -2
  15. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/LICENSE +0 -0
  16. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/MANIFEST.in +0 -0
  17. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/setup.cfg +0 -0
  18. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/setup.py +0 -0
  19. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/__init__.py +0 -0
  20. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/__main__.py +0 -0
  21. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/cli.py +0 -0
  22. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/config/defaults.json +0 -0
  23. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/config/keymap.json +0 -0
  24. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/config.py +0 -0
  25. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/editor.py +0 -0
  26. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/file.py +0 -0
  27. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/hex2xterm.py +0 -0
  28. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/key_mappings.py +0 -0
  29. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/line.py +0 -0
  30. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/linelight/__init__.py +0 -0
  31. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/linelight/color_map.py +0 -0
  32. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/linelight/css.py +0 -0
  33. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/linelight/diff.py +0 -0
  34. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/linelight/html.py +0 -0
  35. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/linelight/js.py +0 -0
  36. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/linelight/json.py +0 -0
  37. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/linelight/lua.py +0 -0
  38. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/linelight/md.py +0 -0
  39. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/linelight/php.py +0 -0
  40. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/linelight/py.py +0 -0
  41. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/logger.py +0 -0
  42. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/application_state.py +0 -0
  43. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/autocomplete.py +0 -0
  44. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/battery.py +0 -0
  45. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/bulk_delete.py +0 -0
  46. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/clock.py +0 -0
  47. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/comment.py +0 -0
  48. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/config.py +0 -0
  49. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/date.py +0 -0
  50. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/diff.py +0 -0
  51. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/eval.py +0 -0
  52. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/hostname.py +0 -0
  53. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/input_test.py +0 -0
  54. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/keymap.py +0 -0
  55. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/lower.py +0 -0
  56. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/lstrip.py +0 -0
  57. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/paste.py +0 -0
  58. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/reload.py +0 -0
  59. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/replace_all.py +0 -0
  60. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/reverse.py +0 -0
  61. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/rstrip.py +0 -0
  62. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/save.py +0 -0
  63. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/save_all.py +0 -0
  64. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/sort_lines.py +0 -0
  65. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/strip.py +0 -0
  66. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/system_clipboard.py +0 -0
  67. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/tabstospaces.py +0 -0
  68. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/toggle_whitespace.py +0 -0
  69. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/modules/upper.py +0 -0
  70. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/themes/8colors.tmTheme +0 -0
  71. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/themes/monokai.tmTheme +0 -0
  72. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/themes.py +0 -0
  73. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon/ui.py +0 -0
  74. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon_editor.egg-info/SOURCES.txt +0 -0
  75. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon_editor.egg-info/dependency_links.txt +0 -0
  76. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon_editor.egg-info/entry_points.txt +0 -0
  77. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon_editor.egg-info/requires.txt +0 -0
  78. {suplemon_editor-0.3.0 → suplemon_editor-0.3.2}/suplemon_editor.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: suplemon-editor
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Console text editor with multi cursor support. Maintained fork of Suplemon.
5
5
  Home-page: https://github.com/leancode/suplemon/
6
6
  Author: Richard Lewis
@@ -114,7 +114,7 @@ kept in small, self contained commits so they can be offered back.
114
114
  * Find, Find next and Find all (Ctrl + F, Ctrl + D, Ctrl + A)
115
115
  * Custom keyboard shortcuts (and easy-to-use defaults)
116
116
  * Mouse support
117
- * Restores cursor and scroll positions when reopenning files
117
+ * Restores cursor and scroll positions when reopening files
118
118
  * Extensions (easy to write your own)
119
119
  * Lots more...
120
120
 
@@ -183,6 +183,28 @@ externally managed (PEP 668) and will refuse `sudo pip install` outright.
183
183
  suplemon [filename:row:col]... # Open one or more files at a specific row or column (optional)
184
184
 
185
185
 
186
+ ### Editing a root-owned file
187
+
188
+ `sudo suplemon /etc/hosts` will say `command not found`. That is sudo, not
189
+ Suplemon: sudo replaces `$PATH` with its own `secure_path`, which never
190
+ includes `~/.local/bin`, so it cannot see the launcher. Give it the full
191
+ path instead:
192
+
193
+ sudo ~/.local/bin/suplemon /etc/hosts
194
+
195
+ That works because the launcher hard-codes an absolute path to the source
196
+ tree. `$HOME` is root's under sudo, so a launcher written in terms of
197
+ `$HOME` would look for the interpreter in the wrong place.
198
+
199
+ If you do this often, either add `~/.local/bin` to `secure_path` in
200
+ `visudo`, or use `sudoedit`, which copies the file to a temporary location,
201
+ opens it as you rather than as root, and copies it back:
202
+
203
+ SUDO_EDITOR=~/.local/bin/suplemon sudoedit /etc/hosts
204
+
205
+ `sudoedit` is the safer of the two: the editor never runs as root.
206
+
207
+
186
208
  ### Notes
187
209
  - **Python 3.8 or higher.** Python 2 is not supported.
188
210
  - *The master branch is considered stable.*
@@ -73,7 +73,7 @@ kept in small, self contained commits so they can be offered back.
73
73
  * Find, Find next and Find all (Ctrl + F, Ctrl + D, Ctrl + A)
74
74
  * Custom keyboard shortcuts (and easy-to-use defaults)
75
75
  * Mouse support
76
- * Restores cursor and scroll positions when reopenning files
76
+ * Restores cursor and scroll positions when reopening files
77
77
  * Extensions (easy to write your own)
78
78
  * Lots more...
79
79
 
@@ -142,6 +142,28 @@ externally managed (PEP 668) and will refuse `sudo pip install` outright.
142
142
  suplemon [filename:row:col]... # Open one or more files at a specific row or column (optional)
143
143
 
144
144
 
145
+ ### Editing a root-owned file
146
+
147
+ `sudo suplemon /etc/hosts` will say `command not found`. That is sudo, not
148
+ Suplemon: sudo replaces `$PATH` with its own `secure_path`, which never
149
+ includes `~/.local/bin`, so it cannot see the launcher. Give it the full
150
+ path instead:
151
+
152
+ sudo ~/.local/bin/suplemon /etc/hosts
153
+
154
+ That works because the launcher hard-codes an absolute path to the source
155
+ tree. `$HOME` is root's under sudo, so a launcher written in terms of
156
+ `$HOME` would look for the interpreter in the wrong place.
157
+
158
+ If you do this often, either add `~/.local/bin` to `secure_path` in
159
+ `visudo`, or use `sudoedit`, which copies the file to a temporary location,
160
+ opens it as you rather than as root, and copies it back:
161
+
162
+ SUDO_EDITOR=~/.local/bin/suplemon sudoedit /etc/hosts
163
+
164
+ `sudoedit` is the safer of the two: the editor never runs as root.
165
+
166
+
145
167
  ### Notes
146
168
  - **Python 3.8 or higher.** Python 2 is not supported.
147
169
  - *The master branch is considered stable.*
@@ -115,7 +115,7 @@ class Cursor:
115
115
  return False
116
116
 
117
117
  def __ne__(self, item):
118
- """Check cursor for unequality."""
118
+ """Check cursor for inequality."""
119
119
  if isinstance(item, Cursor):
120
120
  if item.x != self.x or item.y != self.x:
121
121
  return False
@@ -41,11 +41,11 @@ putting more cursors down.
41
41
  > three lines.
42
42
 
43
43
  * Ctrl + D
44
- > Add a cursor at the next occurance of the word the cursor is on.
44
+ > Add a cursor at the next occurrence of the word the cursor is on.
45
45
  > Press it repeatedly to gather up matches one at a time.
46
46
 
47
47
  * Ctrl + A
48
- > Add a cursor at every occurance of the last search term at once.
48
+ > Add a cursor at every occurrence of the last search term at once.
49
49
  > Search with Ctrl + F or Ctrl + D first to set the term.
50
50
 
51
51
  * ESC
@@ -104,10 +104,10 @@ the complete reference.
104
104
  > Search for a string or regular expression (configurable)
105
105
 
106
106
  * Ctrl + D
107
- > Search for next occurance or find the word the cursor is on. Adds a new cursor at each new occurance.
107
+ > Search for next occurrence or find the word the cursor is on. Adds a new cursor at each new occurrence.
108
108
 
109
109
  * Ctrl + A
110
- > Add a cursor at every occurance of the last search term. Search with
110
+ > Add a cursor at every occurrence of the last search term. Search with
111
111
  > Ctrl + F or Ctrl + D first, otherwise there is no term to look for.
112
112
 
113
113
  * Ctrl + T
@@ -32,7 +32,7 @@ def get_error_info():
32
32
 
33
33
 
34
34
  def get_string_between(start, stop, s):
35
- """Search string for a substring between two delimeters. False if not found."""
35
+ """Search string for a substring between two delimiters. False if not found."""
36
36
  i1 = s.find(start)
37
37
  if i1 == -1:
38
38
  return False
@@ -15,6 +15,9 @@ class Lexer:
15
15
  pygments.token.Generic.Strong: "string",
16
16
  pygments.token.Generic.Subheading: "string",
17
17
  pygments.token.Generic.Deleted: "invalid",
18
+ pygments.token.Generic.Heading: "entity.name",
19
+ pygments.token.Generic.Emph: "italic",
20
+ pygments.token.Generic.Inserted: "string",
18
21
  pygments.token.Punctuation: "punctuation",
19
22
  pygments.token.Operator: "keyword",
20
23
  pygments.token.Operator.Word: "keyword.control",
@@ -56,8 +59,28 @@ class Lexer:
56
59
  pygments.token.Error: "invalid",
57
60
  }
58
61
 
62
+ def scope_for_token(self, token):
63
+ """Return the theme scope for a pygments token.
64
+
65
+ Pygments tokens are hierarchical: Token.Literal.String.Single is a
66
+ child of Token.Literal.String. Mapping only exact matches left every
67
+ subtype the map doesn't name unstyled, which is why single quoted
68
+ Python strings, C preprocessor lines and all leading whitespace came
69
+ out unhighlighted. Walk up to the nearest mapped ancestor, which is
70
+ how pygments' own formatters resolve a style.
71
+
72
+ :param token: Pygments token type.
73
+ :return: Theme scope name, or "global" if nothing matches.
74
+ """
75
+ while token is not None:
76
+ if token in self.token_map:
77
+ return self.token_map[token]
78
+ token = token.parent
79
+ self.logger.debug("No token_map entry for '{0}'.".format(token))
80
+ return "global"
81
+
59
82
  def lex(self, code, lex):
60
- """Return tokenified code.
83
+ """Return tokenized code.
61
84
 
62
85
  Return a list of tuples (scope, word) where word is the word to be
63
86
  printed and scope the scope name representing the context.
@@ -79,10 +102,7 @@ class Lexer:
79
102
  token = word[0]
80
103
  scope = "global"
81
104
 
82
- if token in self.token_map.keys():
83
- scope = self.token_map[token]
84
- else:
85
- self.logger.warning("Token '{0}' for word '{1}' not found in token_map.".format(token, word[1]))
105
+ scope = self.scope_for_token(token)
86
106
 
87
107
  scopes.append((scope, word[1]))
88
108
  return scopes
@@ -18,7 +18,7 @@ from .logger import logger
18
18
  from .config import Config
19
19
  from .editor import Editor
20
20
 
21
- __version__ = "0.3.0"
21
+ __version__ = "0.3.2"
22
22
 
23
23
 
24
24
  class App:
@@ -80,7 +80,7 @@ class ModuleLoader:
80
80
  names = sorted(self.get_module_names())
81
81
  for name in names:
82
82
  name, module = self.load_single(name)
83
- # Skip modules that can't be run expicitly
83
+ # Skip modules that can't be run explicitly
84
84
  if module["class"].run.__module__ == "suplemon.suplemon_module":
85
85
  continue
86
86
  # Skip undocumented modules
@@ -70,7 +70,7 @@ class AutoDocstring(Module):
70
70
  def get_docstring_indent(self, line_data):
71
71
  """Get indent amount for docstring.
72
72
 
73
- Gets the indentation of the function definiton line, and
73
+ Gets the indentation of the function definition line, and
74
74
  adds +1 to account for the function body.
75
75
 
76
76
  :param line_data: The line of the function definition.
@@ -124,7 +124,7 @@ class AutoDocstring(Module):
124
124
 
125
125
  :param editor: Editor instance to get lines from.
126
126
  :param line_number: Line number of the function definition.
127
- :return: Boolean indicating wether the function something.
127
+ :return: Boolean indicating whether the function something.
128
128
  """
129
129
  for i in range(line_number+1, len(editor.lines)):
130
130
  line = editor.get_line(i)
@@ -14,7 +14,7 @@ class Linter(Module):
14
14
  def init(self):
15
15
  self.init_logging(__name__)
16
16
 
17
- # TODO: Run linting in a seperate thread to avoid
17
+ # TODO: Run linting in a separate thread to avoid
18
18
  # blocking the UI when the app is loading
19
19
 
20
20
  # Lint all files after app is loaded
@@ -147,7 +147,7 @@ class PromptFiltered(Prompt):
147
147
 
148
148
  def handle_input(self, event):
149
149
  """Handle special bindings for the prompt."""
150
- # The cancel and accept keys are kept for concistency
150
+ # The cancel and accept keys are kept for consistency
151
151
  if event.key_name in ["ctrl+c", "escape"]:
152
152
  self.on_cancel()
153
153
  return False
@@ -304,7 +304,7 @@ class PromptFile(PromptAutocmp):
304
304
  # This might happen if the cwd has been
305
305
  # removed after starting suplemon.
306
306
  return []
307
- # In case we don't have sufficent permissions
307
+ # In case we don't have sufficient permissions
308
308
  try:
309
309
  contents = os.listdir(path)
310
310
  except OSError:
@@ -66,7 +66,7 @@ class Storage:
66
66
  self.data = data
67
67
 
68
68
  def set_automatic(self, auto):
69
- """Set wether the data should be stored automatically when changed."""
69
+ """Set whether the data should be stored automatically when changed."""
70
70
  self.automatic = auto
71
71
 
72
72
  def store(self):
@@ -380,7 +380,7 @@ class BaseViewer:
380
380
  # because it can get sliced. Sliced lines won't always get
381
381
  # completely highlighted (partial words). Syntax highlighting
382
382
  # should be done first and then only render visible words.
383
- # 2) Additionaly highlighing should be done for all lines at once
383
+ # 2) Additionally highlighting should be done for all lines at once
384
384
  # and tokens should be cached in line instances. That way we can
385
385
  # support multi line comment syntax etc. It should also perform
386
386
  # better, since we only need to re-highlight lines when they change.
@@ -400,7 +400,7 @@ class BaseViewer:
400
400
  bg = int(settings.get("background") or -1)
401
401
  curses.init_pair(pair, fg, bg)
402
402
  curs_color = curses.color_pair(pair)
403
- # Only add tab indicators to the inital whitespace
403
+ # Only add tab indicators to the initial whitespace
404
404
  if first_token and self.config["show_tab_indicators"]:
405
405
  text = self.add_tab_indicators(text)
406
406
  self.window.addstr(y, x_offset, text, curs_color)
@@ -520,14 +520,14 @@ class BaseViewer:
520
520
  ###########################################################################
521
521
 
522
522
  def scroll_up(self):
523
- """Scroll view up if neccesary."""
523
+ """Scroll view up if necessary."""
524
524
  cursor = self.get_first_cursor()
525
525
  if cursor.y - self.y_scroll < 0:
526
526
  # Scroll up
527
527
  self.y_scroll = cursor.y
528
528
 
529
529
  def scroll_down(self):
530
- """Scroll view up if neccesary."""
530
+ """Scroll view up if necessary."""
531
531
  cursor = self.get_last_cursor()
532
532
  size = self.get_size()
533
533
  if cursor.y - self.y_scroll >= size[1]:
@@ -839,7 +839,7 @@ class BaseViewer:
839
839
  # On the current line begin from the last cursor x pos
840
840
  x_offset = last_cursor.x
841
841
 
842
- # Find all occurances of search string
842
+ # Find all occurrences of search string
843
843
  s = str(line[x_offset:]) # Data to search in
844
844
  if y < len(self.lines)-1: # Make line breaks findable (add them to all except last line)
845
845
  s = s + "\n"
@@ -873,7 +873,7 @@ class BaseViewer:
873
873
  return False
874
874
  else:
875
875
  # If we only have one cursor, and it's not
876
- # where the first occurance is, just remove it
876
+ # where the first occurrence is, just remove it
877
877
  if len(self.cursors) == 1 and self.cursors[0].tuple() != new_cursors[0].tuple():
878
878
  self.cursors = []
879
879
  self.last_find = what # Only store string if it's really found
@@ -888,7 +888,7 @@ class BaseViewer:
888
888
  self.store_action_state("find") # Store undo point
889
889
 
890
890
  def find_next(self):
891
- """Find next occurance."""
891
+ """Find next occurrence."""
892
892
  what = self.last_find
893
893
  if what == "":
894
894
  cursor = self.get_cursor()
@@ -907,7 +907,7 @@ class BaseViewer:
907
907
  self.find(what)
908
908
 
909
909
  def find_all(self):
910
- """Find all occurances."""
910
+ """Find all occurrences."""
911
911
  self.find(self.last_find, True)
912
912
 
913
913
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: suplemon-editor
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Console text editor with multi cursor support. Maintained fork of Suplemon.
5
5
  Home-page: https://github.com/leancode/suplemon/
6
6
  Author: Richard Lewis
@@ -114,7 +114,7 @@ kept in small, self contained commits so they can be offered back.
114
114
  * Find, Find next and Find all (Ctrl + F, Ctrl + D, Ctrl + A)
115
115
  * Custom keyboard shortcuts (and easy-to-use defaults)
116
116
  * Mouse support
117
- * Restores cursor and scroll positions when reopenning files
117
+ * Restores cursor and scroll positions when reopening files
118
118
  * Extensions (easy to write your own)
119
119
  * Lots more...
120
120
 
@@ -183,6 +183,28 @@ externally managed (PEP 668) and will refuse `sudo pip install` outright.
183
183
  suplemon [filename:row:col]... # Open one or more files at a specific row or column (optional)
184
184
 
185
185
 
186
+ ### Editing a root-owned file
187
+
188
+ `sudo suplemon /etc/hosts` will say `command not found`. That is sudo, not
189
+ Suplemon: sudo replaces `$PATH` with its own `secure_path`, which never
190
+ includes `~/.local/bin`, so it cannot see the launcher. Give it the full
191
+ path instead:
192
+
193
+ sudo ~/.local/bin/suplemon /etc/hosts
194
+
195
+ That works because the launcher hard-codes an absolute path to the source
196
+ tree. `$HOME` is root's under sudo, so a launcher written in terms of
197
+ `$HOME` would look for the interpreter in the wrong place.
198
+
199
+ If you do this often, either add `~/.local/bin` to `secure_path` in
200
+ `visudo`, or use `sudoedit`, which copies the file to a temporary location,
201
+ opens it as you rather than as root, and copies it back:
202
+
203
+ SUDO_EDITOR=~/.local/bin/suplemon sudoedit /etc/hosts
204
+
205
+ `sudoedit` is the safer of the two: the editor never runs as root.
206
+
207
+
186
208
  ### Notes
187
209
  - **Python 3.8 or higher.** Python 2 is not supported.
188
210
  - *The master branch is considered stable.*
File without changes