Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mscalora/e9620b857a405a6abe7011647beadeb6 to your computer and use it in GitHub Desktop.
Save mscalora/e9620b857a405a6abe7011647beadeb6 to your computer and use it in GitHub Desktop.
Remove extra nano undo debug logging
Index: src/winio.c
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/winio.c (revision )
+++ src/winio.c (date 1462931713000)
@@ -3076,12 +3076,6 @@
(long)openfile->filebot->lineno, linepct,
(unsigned long)cur_xpt, (unsigned long)cur_lenpt, colpct,
(unsigned long)i, (unsigned long)openfile->totsize, charpct);
-
-#ifdef DEBUG
- /* dump the undo stack to stderr every time the stats feature is invoked *
- * debug build only */
- debug_display_undo_stack();
-#endif
}
/* Unconditionally display the current cursor position. */
Index: src/proto.h
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/proto.h (revision )
+++ src/proto.h (date 1462931713000)
@@ -754,9 +754,6 @@
void update_comment_undo(ssize_t lineno);
bool comment_line(bool add_comment, filestruct *f, const char *comment_seq);
#endif
-#ifdef DEBUG
-void debug_display_undo_stack();
-#endif
#endif
size_t get_totsize(const filestruct *begin, const filestruct *end);
filestruct *fsfromline(ssize_t lineno);
Index: src/text.c
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/text.c (revision )
+++ src/text.c (date 1462931713000)
@@ -1239,53 +1239,6 @@
openfile->last_action = action;
}
-#ifdef DEBUG
-void debug_display_undo_stack() {
- static const char *UNDOSTR[] = {
- "ADD", "DEL", "BACK", "CUT", "CUT_EOF", "REPLACE",
-#ifndef DISABLE_WRAPPING
- "SPLIT_BEGIN", "SPLIT_END",
-#endif
-#ifndef DISABLE_COMMENT
- "COMMENT", "UNCOMMENT",
-#endif
- "JOIN", "PASTE", "INSERT", "ENTER", "OTHER"
- };
- int i = 1;
- undo *u = openfile->undotop;
- fprintf(stderr, "\n");
- if (!u)
- fprintf(stderr, "UNDO: none\n");
- while(u) {
- if (u==openfile->current_undo)
- fprintf(stderr, "UNDO: ---- TOP -- undo: v redo: %s ------\n", (i>1 ? "^" : "none"));
- fprintf(stderr, "UNDO %2d: %s at %d with %d:%s%.70s%s\n",
- i,
- UNDOSTR[(int)u->type],
- (int)u->lineno,
- (int)u->begin,
- u->strdata ? "\"" : "",
- u->strdata ? u->strdata : "NULL",
- u->strdata ? "\"" : ""
- );
- undo_group *grouping = u->grouping;
- while(grouping) {
- fprintf(stderr, " %ld to %ld\n", grouping->top_line, grouping->bottom_line);
- grouping = grouping->next;
- }
- i++;
- u = u->next;
- if (i>=50) {
- i = -1;
- fprintf(stderr, "UNDO: -- more items not shown --\n");
- break;
- }
- }
- if (i>1 && 0==openfile->current_undo)
- fprintf(stderr, "UNDO: ---- TOP -- undo: none redo: ^ ------\n");
-}
-#endif
-
#ifndef DISABLE_COMMENT
/* Add a comment undo action. This should be called once for each use
* of the comment or uncomment feature that modifies the document. */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment