Author |
Topic |
|
dgehri
Senior Member
Switzerland
43 Posts |
Posted - Sep 08 2006 : 07:44:43 AM
|
I'm using VA.X 1534 and I have a .h C++ file, in which VA.X prevents me from typing an opening bracket "(". I have to disable VA.X to get it to work...
Any ideas ?
- Daniel
#ifndef INCLUDED_420946040617_H
#define INCLUDED_420946040617_H
#ifdef _MSC_VER
#pragma once
#endif
#include <streambuf>
namespace lc {
namespace util {
class cntstreambuf : public std::streambuf
{
public:
// constructor
cntstreambuf(std::streambuf* sbuf) :
streamBuf_(sbuf),
lineNumber_(1),
lastLineNumber_(1),
column_(0),
prevColumn_(static_cast<size_t>(-1)),
filePos_(0)
{
}
// Get current line number
size_t lineno() const { return lineNumber_; }
// Get line number of last read character
size_t lastLineNumber() { return lastLineNumber_; }
// Get current column
size_t colno() const { return column_; }
// Get file position
size_t filepos() const { return filePos_; }
protected:
cntstreambuf(const cntstreambuf&);
cntstreambuf& operator=(const cntstreambuf&);
// extract next character from stream w/o advancing read pos
std::streambuf::int_type underflow()
{
return streamBuf_->sgetc();
}
// extract next character from stream
std::streambuf::int_type uflow()
{
int_type rc = streamBuf_->sbumpc();
lastLineNumber_ = lineNumber_;
if (traits_type::eq_int_type(rc, traits_type::to_int_type('\\n')))
{
++lineNumber_;
prevColumn_ = column_ + 1;
column_ = static_cast<size_t>(-1);
}
++column_;
++filePos_;
return rc;
}
// put back last character
std::streambuf::int_type pbackfail(std::streambuf::int_type c)
{
if (traits_type::eq_int_type(c, traits_type::to_int_type('\\n')))
{
--lineNumber_;
lastLineNumber_ = lineNumber_;
column_ = prevColumn_;
prevColumn_ = 0;
}
--column_;
--filePos_;
if (c != traits_type::eof())
return streamBuf_->sputbackc(traits_type::to_char_type(c));
else
return streamBuf_->sungetc();
}
// change position by offset, according to way and mode
virtual std::ios::pos_type seekoff(std::ios::off_type pos,
std::ios_base::seekdir dir,
std::ios_base::openmode mode)
{
if (dir == std::ios_base::beg && pos == static_cast<std::ios::off_type>(0))
{
lastLineNumber_ = 1;
lineNumber_ = 1;
column_ = 0;
prevColumn_ = static_cast<size_t>(-1);
filePos_ = 0;
return streamBuf_->pubseekoff(pos, dir, mode);
}
else
return std::streambuf::seekoff(pos, dir, mode);
}
// change to specified position, according to mode
virtual std::ios::pos_type seekpos(std::ios::pos_type pos,
std::ios_base::openmode mode)
{
if (pos == static_cast<std::ios::pos_type>(0))
{
lastLineNumber_ = 1;
lineNumber_ = 1;
column_ = 0;
prevColumn_ = static_cast<size_t>(-1);
filePos_ = 0;
return streamBuf_->pubseekpos(pos, mode);
}
else
return std::streambuf::seekpos(pos, mode);
}
private:
std::streambuf* streamBuf_; // hosted streambuffer
size_t lineNumber_; // current line number
size_t lastLineNumber_;// line number of last read character
size_t column_; // current column
size_t prevColumn_; // previous column
size_t filePos_; // file position
};
} // namespace util
} // namespace lc
|
Edited by - dgehri on Sep 08 2006 07:48:18 AM |
|
support
Whole Tomato Software
5566 Posts |
Posted - Sep 08 2006 : 2:21:36 PM
|
We copy your sample code into VS2005 and can type ( as expected.
Is the problem specific only to this file? If so, can you zip and email it to us?
Is the problem specific to a location in the file?
Can you tell us what you type prior to the paren? Is there a listbox open at the time? |
|
|
dgehri
Senior Member
Switzerland
43 Posts |
Posted - Sep 08 2006 : 3:12:11 PM
|
Yes, it is (was) specific to this file. But now, after restarting VS, it works fine again. I had the same problem in the past, using the same file. The code I posted is the complete content of the file, except the a missing copyright notice at the top.
- D |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Sep 08 2006 : 8:47:11 PM
|
We suspect the problem might not be related to the file so you look for something common in what you did when the glitch occurs. |
|
|
carnitron
Junior Member
17 Posts |
Posted - Sep 09 2006 : 5:59:18 PM
|
I have seen this frequently. The "(" is actually being received, it just ends up at some other point in the file, or up in one of the VAX combo boxes at the top. I think it may relate to the cursor location not being updated properly, but I'm not sure.
I also think it may be related to both the file and some "bad action" in that file. If you close all instances of the file and reopen it, the problem goes away, but not until then. I have theorized that is related to typing invalid syntax, but I have no evidence to support this theory yet. |
|
|
grandchain
Junior Member
United Kingdom
22 Posts |
Posted - Sep 11 2006 : 09:25:08 AM
|
I've seen this too. Not sure what caused it, but I found the text I had typed ended up in a different file window - the previous one I had been editing.
Cheers,
Ian |
|
|
eco
Tomato Guru
102 Posts |
Posted - Sep 11 2006 : 09:43:51 AM
|
I've already post a topic on this bug, but it seem to have been deleted. I've found that the parenthesis was inserted in another opened file... close all files (not the project) and reopen it and I think it will be good for '(' |
|
|
jpizzi
Tomato Guru
USA
642 Posts |
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Sep 17 2006 : 12:13:26 PM
|
has anyone ever seen any sort of pattern to these problems? anything that seems to trigger them happening? |
zen is the art of being at one with the two'ness |
|
|
eco
Tomato Guru
102 Posts |
Posted - Sep 19 2006 : 08:43:17 AM
|
I saw this this morning again It started just after I type '{' and immediatly a '(' (i know, this is stupid). to correct the pb, I close my file, and reopen. But I cannot reproduce it anymore :(
|
|
|
eco
Tomato Guru
102 Posts |
Posted - Sep 21 2006 : 03:52:06 AM
|
Today, I got a new thing that is probably related to this pb. '(' do not work... a yesterday morning, it's ok. but today I see for the first time that Autotext is inserted in a bad file... the same file as '('.
If I close my file and reopen every thing is ok. |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Oct 02 2006 : 5:24:50 PM
|
eco, which language, IDE and version of VA are you using?
i don't think this has ever happened to me, but i have seen it reported before. are you shutting down or rebooting you workstation? or is it staying on all of the time?
do you have any idea why one day would be different to another? |
zen is the art of being at one with the two'ness |
|
|
rhummer
Tomato Guru
USA
527 Posts |
Posted - Oct 10 2006 : 7:58:22 PM
|
We have had the issue reported enough we have added a case for it.
case=2951 |
Tools Engineer - Raven Software VS2005 SP2/VS2008 SP1 - VAX <LATEST> - Win 7 x64
|
|
|
|
Topic |
|