summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-12-05 20:12:41 +0100
committerBram Moolenaar <Bram@vim.org>2019-12-05 20:12:41 +0100
commit6e0ce171e19d0118ecd7c2b16e2a1bd50aa76013 (patch)
tree5446531fc72732454fef2eb38b5f86532c1b9340 /src
parentc95e8d649045add4e77b423bc159dc0d845af559 (diff)
patch 8.1.2392: using old C style commentsv8.1.2392
Problem: Using old C style comments. Solution: Use // comments where appropriate.
Diffstat (limited to 'src')
-rw-r--r--src/nbdebug.c54
-rw-r--r--src/netbeans.c527
-rw-r--r--src/normal.c1222
-rw-r--r--src/ops.c709
-rw-r--r--src/option.c961
-rw-r--r--src/version.c2
6 files changed, 1727 insertions, 1748 deletions
diff --git a/src/nbdebug.c b/src/nbdebug.c
index 2af0288ce4..43bee8d8fd 100644
--- a/src/nbdebug.c
+++ b/src/nbdebug.c
@@ -30,7 +30,7 @@
#include "vim.h"
FILE *nb_debug = NULL;
-u_int nb_dlevel = 0; /* nb_debug verbosity level */
+u_int nb_dlevel = 0; // nb_debug verbosity level
void nbdb(char *, ...);
@@ -46,19 +46,19 @@ static int errorHandler(Display *, XErrorEvent *);
* from a background process this is the only way to debug
* startup problems.
*/
-
-void nbdebug_wait(
- u_int wait_flags, /* tells what to do */
- char *wait_var, /* wait environment variable */
- u_int wait_secs) /* how many seconds to wait */
+ void
+nbdebug_wait(
+ u_int wait_flags, // tells what to do
+ char *wait_var, // wait environment variable
+ u_int wait_secs) // how many seconds to wait
{
- init_homedir(); /* not inited yet */
+ init_homedir(); // not inited yet
#ifdef USE_WDDUMP
WDDump(0, 0, 0);
#endif
- /* for debugging purposes only */
+ // for debugging purposes only
if (wait_flags & WT_ENV && wait_var && getenv(wait_var) != NULL) {
sleep(atoi(getenv(wait_var)));
} else if (wait_flags & WT_WAIT && lookup("~/.gvimwait")) {
@@ -69,16 +69,15 @@ void nbdebug_wait(
;
}
}
-} /* end nbdebug_wait */
-
+}
-void
+ void
nbdebug_log_init(
- char *log_var, /* env var with log file */
- char *level_var) /* env var with nb_debug level */
+ char *log_var, // env var with log file
+ char *level_var) // env var with nb_debug level
{
- char *file; /* possible nb_debug output file */
- char *cp; /* nb_dlevel pointer */
+ char *file; // possible nb_debug output file
+ char *cp; // nb_dlevel pointer
if (log_var && (file = getenv(log_var)) != NULL)
{
@@ -90,20 +89,17 @@ nbdebug_log_init(
if (level_var && (cp = getenv(level_var)) != NULL) {
nb_dlevel = strtoul(cp, NULL, 0);
} else {
- nb_dlevel = NB_TRACE; /* default level */
+ nb_dlevel = NB_TRACE; // default level
}
#ifdef USE_NB_ERRORHANDLER
XSetErrorHandler(errorHandler);
#endif
}
-} /* end nbdebug_log_init */
-
+}
-void
-nbdbg(
- char *fmt,
- ...)
+ void
+nbdbg(char *fmt, ...)
{
va_list ap;
@@ -114,12 +110,10 @@ nbdbg(
fflush(nb_debug);
}
-} /* end nbdbg */
-
+}
-static int
-lookup(
- char *file)
+ static int
+lookup(char *file)
{
char buf[BUFSIZ];
@@ -131,10 +125,10 @@ lookup(
(access(buf, 0) == 0);
#endif
-} /* end lookup */
+}
#ifdef USE_NB_ERRORHANDLER
-static int
+ static int
errorHandler(
Display *dpy,
XErrorEvent *err)
@@ -160,4 +154,4 @@ errorHandler(
#endif
-#endif /* NBDEBUG */
+#endif // NBDEBUG
diff --git a/src/netbeans.c b/src/netbeans.c
index 98714d399c..f55f388e8a 100644
--- a/src/netbeans.c
+++ b/src/netbeans.c
@@ -36,12 +36,12 @@
#include "version.h"
-#define GUARDED 10000 /* typenr for "guarded" annotation */
-#define GUARDEDOFFSET 1000000 /* base for "guarded" sign id's */
-#define MAX_COLOR_LENGTH 32 /* max length of color name in defineAnnoType */
+#define GUARDED 10000 // typenr for "guarded" annotation
+#define GUARDEDOFFSET 1000000 // base for "guarded" sign id's
+#define MAX_COLOR_LENGTH 32 // max length of color name in defineAnnoType
-/* The first implementation (working only with Netbeans) returned "1.1". The
- * protocol implemented here also supports A-A-P. */
+// The first implementation (working only with Netbeans) returned "1.1". The
+// protocol implemented here also supports A-A-P.
static char *ExtEdProtocolVersion = "2.5";
static long pos2off(buf_T *, pos_T *);
@@ -64,7 +64,7 @@ static void nb_free(void);
#define NETBEANS_OPEN (channel_can_write_to(nb_channel))
static channel_T *nb_channel = NULL;
-static int r_cmdno; /* current command number for reply */
+static int r_cmdno; // current command number for reply
static int dosetvisible = FALSE;
/*
@@ -98,7 +98,7 @@ netbeans_close(void)
netbeans_send_disconnect();
if (nb_channel != NULL)
{
- /* Close the socket and remove the input handlers. */
+ // Close the socket and remove the input handlers.
channel_close(nb_channel, TRUE);
channel_clear(nb_channel);
}
@@ -113,7 +113,7 @@ netbeans_close(void)
inAtomic = 0;
nb_free();
- /* remove all signs and update the screen after gutter removal */
+ // remove all signs and update the screen after gutter removal
coloncmd(":sign unplace *");
changed_window_setting();
update_screen(CLEAR);
@@ -139,18 +139,18 @@ netbeans_connect(char *params, int doabort)
if (*params == '=')
{
- /* "=fname": Read info from specified file. */
+ // "=fname": Read info from specified file.
if (getConnInfo(params + 1, &hostname, &address, &password) == FAIL)
return FAIL;
}
else
{
if (*params == ':')
- /* ":<host>:<addr>:<password>": get info from argument */
+ // ":<host>:<addr>:<password>": get info from argument
arg = params + 1;
if (arg == NULL && (fname = getenv("__NETBEANS_CONINFO")) != NULL)
{
- /* "": get info from file specified in environment */
+ // "": get info from file specified in environment
if (getConnInfo(fname, &hostname, &address, &password) == FAIL)
return FAIL;
}
@@ -158,7 +158,7 @@ netbeans_connect(char *params, int doabort)
{
if (arg != NULL)
{
- /* ":<host>:<addr>:<password>": get info from argument */
+ // ":<host>:<addr>:<password>": get info from argument
hostname = arg;
address = strchr(hostname, ':');
if (address != NULL)
@@ -170,7 +170,7 @@ netbeans_connect(char *params, int doabort)
}
}
- /* Get the missing values from the environment. */
+ // Get the missing values from the environment.
if (hostname == NULL || *hostname == '\0')
hostname = getenv("__NETBEANS_HOST");
if (address == NULL)
@@ -178,7 +178,7 @@ netbeans_connect(char *params, int doabort)
if (password == NULL)
password = getenv("__NETBEANS_VIM_PASSWORD");
- /* Move values to allocated memory. */
+ // Move values to allocated memory.
if (hostname != NULL)
hostname = (char *)vim_strsave((char_u *)hostname);
if (address != NULL)
@@ -188,7 +188,7 @@ netbeans_connect(char *params, int doabort)
}
}
- /* Use the default when a value is missing. */
+ // Use the default when a value is missing.
if (hostname == NULL || *hostname == '\0')
{
vim_free(hostname);
@@ -210,12 +210,12 @@ netbeans_connect(char *params, int doabort)
nb_channel = channel_open(hostname, port, 3000, nb_channel_closed);
if (nb_channel != NULL)
{
- /* success */
+ // success
# ifdef FEAT_BEVAL_GUI
bevalServers |= BEVAL_NETBEANS;
# endif
- /* success, login */
+ // success, login
vim_snprintf(buf, sizeof(buf), "AUTH %s\n", password);
nb_send(buf, "netbeans_connect");
@@ -271,11 +271,11 @@ getConnInfo(char *file, char **host, char **port, char **auth)
return FAIL;
}
- /* Read the file. There should be one of each parameter */
+ // Read the file. There should be one of each parameter
while ((lp = (char_u *)fgets((char *)buf, BUFSIZ, fp)) != NULL)
{
if ((nlp = vim_strchr(lp, '\n')) != NULL)
- *nlp = 0; /* strip off the trailing newline */
+ *nlp = 0; // strip off the trailing newline
if (STRNCMP(lp, "host=", 5) == 0)
{
@@ -308,7 +308,7 @@ struct keyqueue
typedef struct keyqueue keyQ_T;
-static keyQ_T keyHead; /* dummy node, header for circular queue */
+static keyQ_T keyHead; // dummy node, header for circular queue
/*
@@ -323,15 +323,15 @@ postpone_keycommand(char_u *keystr)
node = ALLOC_ONE(keyQ_T);
if (node == NULL)
- return; /* out of memory, drop the key */
+ return; // out of memory, drop the key
- if (keyHead.next == NULL) /* initialize circular queue */
+ if (keyHead.next == NULL) // initialize circular queue
{
keyHead.next = &keyHead;
keyHead.prev = &keyHead;
}
- /* insert node at tail of queue */
+ // insert node at tail of queue
node->next = &keyHead;
node->prev = keyHead.prev;
keyHead.prev->next = node;
@@ -350,18 +350,18 @@ handle_key_queue(void)
while (!postponed && keyHead.next && keyHead.next != &keyHead)
{
- /* first, unlink the node */
+ // first, unlink the node
keyQ_T *node = keyHead.next;
keyHead.next = node->next;
node->next->prev = node->prev;
- /* Now, send the keycommand. This may cause it to be postponed again
- * and change keyHead. */
+ // Now, send the keycommand. This may cause it to be postponed again
+ // and change keyHead.
if (node->keystr != NULL)
postponed = !netbeans_keystring(node->keystr);
vim_free(node->keystr);
- /* Finally, dispose of the node */
+ // Finally, dispose of the node
vim_free(node);
}
}
@@ -382,30 +382,30 @@ netbeans_parse_messages(void)
{
node = channel_peek(nb_channel, PART_SOCK);
if (node == NULL)
- break; /* nothing to read */
+ break; // nothing to read
- /* Locate the end of the first line in the first buffer. */
+ // Locate the end of the first line in the first buffer.
p = channel_first_nl(node);
if (p == NULL)
{
- /* Command isn't complete. If there is no following buffer,
- * return (wait for more). If there is another buffer following,
- * prepend the text to that buffer and delete this one. */
+ // Command isn't complete. If there is no following buffer,
+ // return (wait for more). If there is another buffer following,
+ // prepend the text to that buffer and delete this one.
if (channel_collapse(nb_channel, PART_SOCK, TRUE) == FAIL)
return;
continue;
}
- /* There is a complete command at the start of the buffer.
- * Terminate it with a NUL. When no more text is following unlink
- * the buffer. Do this before executing, because new buffers can
- * be added while busy handling the command. */
+ // There is a complete command at the start of the buffer.
+ // Terminate it with a NUL. When no more text is following unlink
+ // the buffer. Do this before executing, because new buffers can
+ // be added while busy handling the command.
*p++ = NUL;
if (*p == NUL)
{
own_node = TRUE;
buffer = channel_get(nb_channel, PART_SOCK, NULL);
- /* "node" is now invalid! */
+ // "node" is now invalid!
}
else
{
@@ -413,15 +413,15 @@ netbeans_parse_messages(void)
buffer = node->rq_buffer;
}
- /* Now, parse and execute the commands. This may set nb_channel to
- * NULL if the channel is closed. */
+ // Now, parse and execute the commands. This may set nb_channel to
+ // NULL if the channel is closed.
nb_parse_cmd(buffer);
if (own_node)
- /* buffer finished, dispose of it */
+ // buffer finished, dispose of it
vim_free(buffer);
else if (nb_channel != NULL)
- /* more follows, move it to the start */
+ // more follows, move it to the start
channel_consume(nb_channel, PART_SOCK, (int)(p - buffer));
}
}
@@ -452,12 +452,12 @@ nb_parse_cmd(char_u *cmd)
if (STRCMP(cmd, "DISCONNECT") == 0)
{
- /* We assume the server knows that we can safely exit! */
- /* Disconnect before exiting, Motif hangs in a Select error
- * message otherwise. */
+ // We assume the server knows that we can safely exit!
+ // Disconnect before exiting, Motif hangs in a Select error
+ // message otherwise.
netbeans_close();
getout(0);
- /* NOTREACHED */
+ // NOTREACHED
}
if (STRCMP(cmd, "DETACH") == 0)
@@ -467,7 +467,7 @@ nb_parse_cmd(char_u *cmd)
FOR_ALL_BUFFERS(buf)
buf->b_has_sign_column = FALSE;
- /* The IDE is breaking the connection. */
+ // The IDE is breaking the connection.
netbeans_close();
return;
}
@@ -480,7 +480,7 @@ nb_parse_cmd(char_u *cmd)
semsg("E627: missing colon: %s", cmd);
return;
}
- ++verb; /* skip colon */
+ ++verb; // skip colon
for (q = verb; *q; q++)
{
@@ -540,8 +540,8 @@ struct nbbuf_struct
typedef struct nbbuf_struct nbbuf_T;
static nbbuf_T *buf_list = NULL;
-static int buf_list_size = 0; /* size of buf_list */
-static int buf_list_used = 0; /* nr of entries in buf_list actually in use */
+static int buf_list_size = 0; // size of buf_list
+static int buf_list_used = 0; // nr of entries in buf_list actually in use
static char **globalsignmap = NULL;
static int globalsignmaplen = 0;
@@ -566,7 +566,7 @@ nb_free(void)
nbbuf_T buf;
int i;
- /* free the netbeans buffer list */
+ // free the netbeans buffer list
for (i = 0; i < buf_list_used; i++)
{
buf = buf_list[i];
@@ -582,7 +582,7 @@ nb_free(void)
buf_list_size = 0;
buf_list_used = 0;
- /* free the queued key commands */
+ // free the queued key commands
while (key_node != NULL && key_node != &keyHead)
{
keyQ_T *next = key_node->next;
@@ -597,7 +597,7 @@ nb_free(void)
key_node = next;
}
- /* free the queued netbeans commands */
+ // free the queued netbeans commands
if (nb_channel != NULL)
channel_clear(nb_channel);
}
@@ -658,7 +658,7 @@ isNetbeansModified(buf_T *bufp)
static nbbuf_T *
nb_get_buf(int bufno)
{
- /* find or create a buffer with the given number */
+ // find or create a buffer with the given number
int incr;
if (bufno <= 0)
@@ -666,13 +666,13 @@ nb_get_buf(int bufno)
if (!buf_list)
{
- /* initialize */
+ // initialize
buf_list = alloc_clear(100 * sizeof(nbbuf_T));
buf_list_size = 100;
}
- if (bufno >= buf_list_used) /* new */
+ if (bufno >= buf_list_used) // new
{
- if (bufno >= buf_list_size) /* grow list */
+ if (bufno >= buf_list_size) // grow list
{
nbbuf_T *t_buf_list = buf_list;
@@ -691,7 +691,7 @@ nb_get_buf(int bufno)
while (buf_list_used <= bufno)
{
- /* Default is to fire text changes. */
+ // Default is to fire text changes.
buf_list[buf_list_used].fireChanges = 1;
++buf_list_used;
}
@@ -734,14 +734,14 @@ netbeans_end(void)
continue;
if (netbeansForcedQuit)
{
- /* mark as unmodified so NetBeans won't put up dialog on "killed" */
+ // mark as unmodified so NetBeans won't put up dialog on "killed"
sprintf(buf, "%d:unmodified=%d\n", i, r_cmdno);
nbdebug(("EVT: %s", buf));
nb_send(buf, "netbeans_end");
}
sprintf(buf, "%d:killed=%d\n", i, r_cmdno);
nbdebug(("EVT: %s", buf));
- /* nb_send(buf, "netbeans_end"); avoid "write failed" messages */
+ // nb_send(buf, "netbeans_end"); avoid "write failed" messages
nb_send(buf, NULL);
}
}
@@ -769,7 +769,7 @@ nb_reply_nil(int cmdno)
nbdebug(("REP %d: <none>\n", cmdno));
- /* Avoid printing an annoying error message. */
+ // Avoid printing an annoying error message.
if (!NETBEANS_OPEN)
return;
@@ -831,8 +831,8 @@ nb_quote(char_u *txt)
case '\"':
case '\\':
*q++ = '\\'; *q++ = *p; break;
- /* case '\t': */
- /* *q++ = '\\'; *q++ = 't'; break; */
+ // case '\t':
+ // *q++ = '\\'; *q++ = 't'; break;
case '\n':
*q++ = '\\'; *q++ = 'n'; break;
case '\r':
@@ -861,7 +861,7 @@ nb_unquote(char_u *p, char_u **endp)
char *q;
int done = 0;
- /* result is never longer than input */
+ // result is never longer than input
result = alloc_clear(STRLEN(p) + 1);
if (result == NULL)
return NULL;
@@ -895,7 +895,7 @@ nb_unquote(char_u *p, char_u **endp)
case 'r': *q++ = '\r'; break;
case '"': *q++ = '"'; break;
case NUL: --p; break;
- /* default: skip over illegal chars */
+ // default: skip over illegal chars
}
++p;
break;
@@ -924,7 +924,7 @@ nb_partialremove(linenr_T lnum, colnr_T first, colnr_T last)
oldtext = ml_get(lnum);
oldlen = (int)STRLEN(oldtext);
- if (first >= (colnr_T)oldlen || oldlen == 0) /* just in case */
+ if (first >= (colnr_T)oldlen || oldlen == 0) // just in case
return;
if (lastbyte >= oldlen)
lastbyte = oldlen - 1;
@@ -974,55 +974,55 @@ nb_do_cmd(
char_u *cmd,
int func,
int cmdno,
- char_u *args) /* points to space before arguments or NUL */
+ char_u *args) // points to space before arguments or NUL
{
int do_update = 0;
long off = 0;
nbbuf_T *buf = nb_get_buf(bufno);
static int skip = 0;
int retval = OK;
- char *cp; /* for when a char pointer is needed */
+ char *cp; // for when a char pointer is needed
nbdebug(("%s %d: (%d) %s %s\n", (func) ? "FUN" : "CMD", cmdno, bufno, cmd,
STRCMP(cmd, "insert") == 0 ? "<text>" : (char *)args));
if (func)
{
-/* =====================================================================*/
+// =====================================================================
if (streq((char *)cmd, "getModified"))
{
if (buf == NULL || buf->bufp == NULL)
- /* Return the number of buffers that are modified. */
+ // Return the number of buffers that are modified.
nb_reply_nr(cmdno, (long)count_changed_buffers());
else
- /* Return whether the buffer is modified. */
+ // Return whether the buffer is modified.
nb_reply_nr(cmdno, (long)(buf->bufp->b_changed
|| isNetbeansModified(buf->bufp)));
-/* =====================================================================*/
+// =====================================================================
}
else if (streq((char *)cmd, "saveAndExit"))
{
- /* Note: this will exit Vim if successful. */
+ // Note: this will exit Vim if successful.
coloncmd(":confirm qall");
- /* We didn't exit: return the number of changed buffers. */
+ // We didn't exit: return the number of changed buffers.
nb_reply_nr(cmdno, (long)count_changed_buffers());
-/* =====================================================================*/
+// =====================================================================
}
else if (streq((char *)cmd, "getCursor"))
{
char_u text[200];
- /* Note: nb_getbufno() may return -1. This indicates the IDE
- * didn't assign a number to the current buffer in response to a
- * fileOpened event. */
+ // Note: nb_getbufno() may return -1. This indicates the IDE
+ // didn't assign a number to the current buffer in response to a
+ // fileOpened event.
sprintf((char *)text, "%d %ld %d %ld",
nb_getbufno(curbuf),
(long)curwin->w_cursor.lnum,
(int)curwin->w_cursor.col,
pos2off(curbuf, &curwin->w_cursor));
nb_reply_text(cmdno, text);
-/* =====================================================================*/
+// =====================================================================
}
else if (streq((char *)cmd, "getAnno"))
{
@@ -1040,12 +1040,12 @@ nb_do_cmd(
cp = (char *)args;
serNum = strtol(cp, &cp, 10);
- /* If the sign isn't found linenum will be zero. */
+ // If the sign isn't found linenum will be zero.
linenum = (long)buf_findsign(buf->bufp, serNum, NULL);
}
#endif
nb_reply_nr(cmdno, linenum);
-/* =====================================================================*/
+// =====================================================================
}
else if (streq((char *)cmd, "getLength"))
{
@@ -1062,7 +1062,7 @@ nb_do_cmd(
len = get_buf_size(buf->bufp);
}
nb_reply_nr(cmdno, len);
-/* =====================================================================*/
+// =====================================================================
}
else if (streq((char *)cmd, "getText"))
{
@@ -1116,7 +1116,7 @@ nb_do_cmd(
nb_reply_text(cmdno, text);
vim_free(text);
}
-/* =====================================================================*/
+// =====================================================================
}
else if (streq((char *)cmd, "remove"))
{
@@ -1124,7 +1124,7 @@ nb_do_cmd(
pos_T first, last;
pos_T *pos;
pos_T *next;
- linenr_T del_from_lnum, del_to_lnum; /* lines to be deleted as a whole */
+ linenr_T del_from_lnum, del_to_lnum; // lines to be deleted as a whole
int oldFire = netbeansFireChanges;
int oldSuppress = netbeansSuppressNoLines;
int wasChanged;
@@ -1153,7 +1153,7 @@ nb_do_cmd(
off = strtol(cp, &cp, 10);
count = strtol(cp, &cp, 10);
args = (char_u *)cp;
- /* delete "count" chars, starting at "off" */
+ // delete "count" chars, starting at "off"
pos = off2pos(buf->bufp, off);
if (!pos)
{
@@ -1182,58 +1182,58 @@ nb_do_cmd(
del_to_lnum = last.lnum;
do_update = 1;
- /* Get the position of the first byte after the deleted
- * section. "next" is NULL when deleting to the end of the
- * file. */
+ // Get the position of the first byte after the deleted
+ // section. "next" is NULL when deleting to the end of the
+ // file.
next = off2pos(buf->bufp, off + count);
- /* Remove part of the first line. */
+ // Remove part of the first line.
if (first.col != 0
|| (next != NULL && first.lnum == next->lnum))
{
if (first.lnum != last.lnum
|| (next != NULL && first.lnum != next->lnum))
{
- /* remove to the end of the first line */
+ // remove to the end of the first line
nb_partialremove(first.lnum, first.col,
(colnr_T)MAXCOL);
if (first.lnum == last.lnum)
{
- /* Partial line to remove includes the end of
- * line. Join the line with the next one, have
- * the next line deleted below. */
+ // Partial line to remove includes the end of
+ // line. Join the line with the next one, have
+ // the next line deleted below.
nb_joinlines(first.lnum, next->lnum);
del_to_lnum = next->lnum;
}
}
else
{
- /* remove within one line */
+ // remove within one line
nb_partialremove(first.lnum, first.col, last.col);
}
- ++del_from_lnum; /* don't delete the first line */
+ ++del_from_lnum; // don't delete the first line
}
- /* Remove part of the last line. */
+ // Remove part of the last line.
if (first.lnum != last.lnum && next != NULL
&& next->col != 0 && last.lnum == next->lnum)
{
nb_partialremove(last.lnum, 0, last.col);
if (del_from_lnum > first.lnum)
{
- /* Join end of last line to start of first line; last
- * line is deleted below. */
+ // Join end of last line to start of first line; last
+ // line is deleted below.
nb_joinlines(first.lnum, last.lnum);
}
else
- /* First line is deleted as a whole, keep the last
- * line. */
+ // First line is deleted as a whole, keep the last
+ // line.
--del_to_lnum;
}
- /* First is partial line; last line to remove includes
- * the end of line; join first line to line following last
- * line; line following last line is deleted below. */
+ // First is partial line; last line to remove includes
+ // the end of line; join first line to line following last
+ // line; line following last line is deleted below.
if (first.lnum != last.lnum && del_from_lnum > first.lnum
&& next != NULL && last.lnum != next->lnum)
{
@@ -1241,12 +1241,12 @@ nb_do_cmd(
del_to_lnum = next->lnum;
}
- /* Delete whole lines if there are any. */
+ // Delete whole lines if there are any.
if (del_to_lnum >= del_from_lnum)
{
int i;
- /* delete signs from the lines being deleted */
+ // delete signs from the lines being deleted
for (i = del_from_lnum; i <= del_to_lnum; i++)
{
int id = buf_findsign_id(buf->bufp, (linenr_T)i, NULL);
@@ -1269,10 +1269,10 @@ nb_do_cmd(
del_lines(del_to_lnum - del_from_lnum + 1, FALSE);
}
- /* Leave cursor at first deleted byte. */
+ // Leave cursor at first deleted byte.
curwin->w_cursor = first;
check_cursor_lnum();
- buf->bufp->b_changed = wasChanged; /* logically unchanged */
+ buf->bufp->b_changed = wasChanged; // logically unchanged
netbeansFireChanges = oldFire;
netbeansSuppressNoLines = oldSuppress;
@@ -1280,7 +1280,7 @@ nb_do_cmd(
u_clearall(buf->bufp);
}
nb_reply_nil(cmdno);
-/* =====================================================================*/
+// =====================================================================
}
else if (streq((char *)cmd, "insert"))
{
@@ -1293,12 +1293,12 @@ nb_do_cmd(
return OK;
}
- /* get offset */
+ // get offset
cp = (char *)args;
off = strtol(cp, &cp, 10);
args = (char_u *)cp;
- /* get text to be inserted */
+ // get text to be inserted
args = skipwhite(args);
args = to_free = (char_u *)nb_unquote(args, NULL);
/*
@@ -1327,13 +1327,13 @@ nb_do_cmd(
netbeansFireChanges = 0;
- /* Jump to the buffer where we insert. After this "curbuf"
- * can be used. */
+ // Jump to the buffer where we insert. After this "curbuf"
+ // can be used.
nb_set_curbuf(buf->bufp);
old_b_changed = curbuf->b_changed;
- /* Convert the specified character offset into a lnum/col
- * position. */
+ // Convert the specified character offset into a lnum/col
+ // position.
pos = off2pos(curbuf, off);
if (pos != NULL)
{
@@ -1344,27 +1344,27 @@ nb_do_cmd(
}
else
{
- /* If the given position is not found, assume we want
- * the end of the file. See setLocAndSize HACK. */
+ // If the given position is not found, assume we want
+ // the end of the file. See setLocAndSize HACK.
if (buf_was_empty)
- lnum_start = 1; /* above empty line */
+ lnum_start = 1; // above empty line
else
lnum_start = curbuf->b_ml.ml_line_count + 1;
}
- /* "lnum" is the line where we insert: either append to it or
- * insert a new line above it. */
+ // "lnum" is the line where we insert: either append to it or
+ // insert a new line above it.
lnum = lnum_start;
- /* Loop over the "\n" separated lines of the argument. */
+ // Loop over the "\n" separated lines of the argument.
do_update = 1;
while (*args != NUL)
{
nlp = vim_strchr(args, '\n');
if (nlp == NULL)
{
- /* Incomplete line, probably truncated. Next "insert"
- * command should append to this one. */
+ // Incomplete line, probably truncated. Next "insert"
+ // command should append to this one.
len = STRLEN(args);
}
else
@@ -1393,7 +1393,7 @@ nb_do_cmd(
char_u *newline;
int col = pos == NULL ? 0 : pos->col;
- /* Insert halfway a line. */
+ // Insert halfway a line.
newline = alloc(STRLEN(oldline) + len + 1);
if (newline != NULL)
{
@@ -1406,8 +1406,8 @@ nb_do_cmd(
}
else
{
- /* Append a new line. Not that we always do this,
- * also when the text doesn't end in a "\n". */
+ // Append a new line. Not that we always do this,
+ // also when the text doesn't end in a "\n".
ml_append((linenr_T)(lnum - 1), args,
(colnr_T)(len + 1), FALSE);
++added;
@@ -1419,7 +1419,7 @@ nb_do_cmd(
args = nlp + 1;
}
- /* Adjust the marks below the inserted lines. */
+ // Adjust the marks below the inserted lines.
appended_lines_mark(lnum_start - 1, (long)added);
/*
@@ -1443,15 +1443,15 @@ nb_do_cmd(
* text the buffer has been updated but not written. Will
* netbeans guarantee to write it? Even if I do a :q! ?
*/
- curbuf->b_changed = old_b_changed; /* logically unchanged */
+ curbuf->b_changed = old_b_changed; // logically unchanged
netbeansFireChanges = oldFire;
- /* Undo info is invalid now... */
+ // Undo info is invalid now...
u_blockfree(curbuf);
u_clearall(curbuf);
}
vim_free(to_free);
- nb_reply_nil(cmdno); /* or !error */
+ nb_reply_nil(cmdno); // or !error
}
else
{
@@ -1460,12 +1460,12 @@ nb_do_cmd(
retval = FAIL;
}
}
- else /* Not a function; no reply required. */
+ else // Not a function; no reply required.
{
-/* =====================================================================*/
+// =====================================================================
if (streq((char *)cmd, "create"))
{
- /* Create a buffer without a name. */
+ // Create a buffer without a name.
if (buf == NULL)
{
nbdebug((" invalid buffer identifier in create\n"));
@@ -1474,7 +1474,7 @@ nb_do_cmd(
}
VIM_CLEAR(buf->displayname);
- netbeansReadFile = 0; /* don't try to open disk file */
+ netbeansReadFile = 0; // don't try to open disk file
do_ecmd(0, NULL, 0, 0, ECMD_ONE, ECMD_HIDE + ECMD_OLDBUF, curwin);
netbeansReadFile = 1;
buf->bufp = curbuf;
@@ -1484,7 +1484,7 @@ nb_do_cmd(
if (gui.in_use)
gui_update_menus(0);
#endif
-/* =====================================================================*/
+// =====================================================================
}
else if (streq((char *)cmd, "insertDone"))
{
@@ -1500,7 +1500,7 @@ nb_do_cmd(
buf->bufp->b_p_ro = *args == 'T';
print_read_msg(buf);
}
-/* =====================================================================*/
+// =====================================================================
}
else if (streq((char *)cmd, "saveDone"))
{
@@ -1510,7 +1510,7 @@ nb_do_cmd(
nbdebug((" invalid buffer identifier in saveDone\n"));
else
print_save_msg(buf, savedChars);
-/* =====================================================================*/
+// =====================================================================
}
else if (streq((char *)cmd, "startDocumentListen"))
{
@@ -1521,7 +1521,7 @@ nb_do_cmd(
return FAIL;
}
buf->fireChanges = 1;
-/* =====================================================================*/
+// =====================================================================
}
else if (streq((char *)cmd, "stopDocumentListen"))
{
@@ -1542,15 +1542,15 @@ nb_do_cmd(
}
else
{
- /* NetBeans uses stopDocumentListen when it stops editing
- * a file. It then expects the buffer in Vim to
- * disappear. */
+ // NetBeans uses stopDocumentListen when it stops editing
+ // a file. It then expects the buffer in Vim to
+ // disappear.
do_bufdel(DOBUF_DEL, (char_u *)"", 1,
buf->bufp->b_fnum, buf->bufp->b_fnum, TRUE);
vim_memset(buf, 0, sizeof(nbbuf_T));
}
}
-/* =====================================================================*/
+// =====================================================================
}
else if (streq((char *)cmd, "setTitle"))
{
@@ -1562,7 +1562,7 @@ nb_do_cmd(
}
vim_free(buf->displayname);
buf->displayname = nb_unquote(args, NULL);
-/* =====================================================================*/
+// =====================================================================
}
else if (streq((char *)cmd, "initDone"))
{
@@ -1577,9 +1577,9 @@ nb_do_cmd(
nb_set_curbuf(buf->bufp);
apply_autocmds(EVENT_BUFREADPOST, 0, 0, FALSE, buf->bufp);
- /* handle any postponed key commands */
+ // handle any postponed key commands
handle_key_queue();
-/* =====================================================================*/
+// =====================================================================
}
else if (streq((char *)cmd, "setBufferNumber")
|| streq((char *)cmd, "putBufferNumber"))
@@ -1607,19 +1607,19 @@ nb_do_cmd(
buf->bufp = bufp;
buf->nbbuf_number = bufp->b_fnum;
- /* "setBufferNumber" has the side effect of jumping to the buffer
- * (don't know why!). Don't do that for "putBufferNumber". */
+ // "setBufferNumber" has the side effect of jumping to the buffer
+ // (don't know why!). Don't do that for "putBufferNumber".
if (*cmd != 'p')
coloncmd(":buffer %d", bufp->b_fnum);
else
{
buf->initDone = TRUE;
- /* handle any postponed key commands */
+ // handle any postponed key commands
handle_key_queue();
}
-/* =====================================================================*/
+// =====================================================================
}
else if (streq((char *)cmd, "setFullName"))
{
@@ -1632,7 +1632,7 @@ nb_do_cmd(
vim_free(buf->displayname);
buf->displayname = nb_unquote(args, NULL);
- netbeansReadFile = 0; /* don't try to open disk file */
+ netbeansReadFile = 0; // don't try to open disk file
do_ecmd(0, (char_u *)buf->displayname, 0, 0, ECMD_ONE,
ECMD_HIDE + ECMD_OLDBUF, curwin);
netbeansReadFile = 1;
@@ -1642,7 +1642,7 @@ nb_do_cmd(
if (gui.in_use)
gui_update_menus(0);
#endif
-/* =====================================================================*/
+// =====================================================================
}
else if (streq((char *)cmd, "editFile"))
{
@@ -1652,7 +1652,7 @@ nb_do_cmd(
emsg("E644: invalid buffer identifier in editFile");
return FAIL;
}
- /* Edit a file: like create + setFullName + read the file. */
+ // Edit a file: like create + setFullName + read the file.
vim_free(buf->displayname);